Scent-based Build Status XFD

November 25, 2010

eXtreme Feedback Devices (XFDs) work with your Continuous Integration (CI) server to give visual cues of your project’s build state.

Some of the more well-known devices include the red/green lava lamps and the glowing orb, but the are many creative devices to make code status more visible:

Why eXtreme Feedback?

Besides being schweet, XFDs are an intuitive and fun way to monitor CI build status. They show off your commitment to maintaining your build health.

Why Scent?

Why not? There are numerous visual and auditory indicators; it’s high time more olfactory XFDs made an appearance. For those with severe allergies, this kind of notification system will make you extra vigilant about keeping the build stable.

The Project

In January, (former) coworker, now Agile consultant, Matt Barcomb, stopped by my desk with a crazy idea about an XFD that substituted smells for the typical feedback. I jumped at the project.

Just the day before, I had seen a commercial for the new Glade Sense & Spray motion-activated air fresheners. They were mechanical and battery powered: perfect. I quested to Wal-Mart for some smelly supplies and began hacking and coding immediately. A day later, I emerged with a working prototype: 2 Glade Sense & Spray air fresheners (“apple cinnamon” and “fresh linen”) wired into an Arduino connected to my laptop.

Spray activation is controlled in a Python app running on my machine. The XFD reads from a Hudson RSS feed on interval and sprays the corresponding scent when the build status changes. You can set a reminder spray to remind you that the build’s still broken or still awesome.

Matt initially suggested a smell a la rotten eggs for failure, but I’ve yet to find that in the air freshener aisle.

How it Works

Parts List

  • 2x Glade Sense & Spray (2 different scents) $10 each
  • Arduino
  • Some wire

Note: I used an Arduino for rapid prototyping, but it’s not doing much beyond reading serial data from the PC. If serial ports weren’t obsolete, a microcontroller would be pointless. I’m currently working on an activation method using an old keyboard. Stay tuned.

Hacking the Glade Sense & Sprays

In the meantime, someone has already posted about hacking the Glade Sense & Sprays.

I soldered an activation wire near T20 (see picture). When idling, the voltage on this wire stays HIGH. To activate the spray, I drop it LOW for a sec.

I’m sure there’s a way to idle LOW and activate HIGH, but I didn’t look.

Code

A Python app runs on the host machine, monitors a Hudson RSS feed, and triggers the corresponding scent via a USB serial connection to the Arduino.

I wrote the controller program in Python for portability and because it’s awesome. It’s been a while since I’ve checked the state of the code, but you should at least be able to see how I do serial communication with the Arudino. Configure settings in src/python/IndicatorController.py, and run it.

Code:

Dependencies:


2010 Mazda 3 – Adding AUX Power to the Hatch

June 25, 2010

On no less that three occasions since I got my car 3 months ago, I’ve wanted to plug into an aux power outlet in my hatch. Slight problem: the 2010 Mazda 3 doesn’t come with one. I set out to add one, and following is how. This is a really easy mod and only took a couple hours, most of the time being spent removing interior trim.

Supplies

  • AUX power jack, preferably one that screws together instead of just snapping in [auto store]
  • 25′ wire (~10-14AWG?) [radio shack]
  • Ring terminal [radio shack or harbor freight]
  • Female blade terminal [radio shack or harbor freight]
  • For fusebox method #1: Add-a-circuit mini [auto store] + 10A & 15A mini fuses (not low profile!)
  • For fusebox method #2: ?? (this method would be best if you’ll draw >10A)
  • 10A mini fuse (if using the add-a-circuit, it cannot be a low-profile fuse)

Installing the outlet

  1. Figure out where you want to install the power outlet, and drill a hole slightly smaller than the diameter of the outlet. I wanted a concealed location that was easy to plug stuff into and easy to access the wiring. I chose the bottom part of the hatch light access panel.
  2. Insert the outlet and screw the halves together. You got a screw one, right? If you didn’t, the outlet will probably pull out the first time you use it.

Routing the Wire

We’re just need to run a single wire from the outlet to the + from the fuse box. The outlet grounds to a bolt in the hatch.

We’ll route the wire along the right side of the car. From the hatch, it’ll follow existing wiring along the floor of the seats to the front. It then goes under the glove, through the console, under the driver’s dash, and to the fuse box. I ran two wires in case I want to wire something else up in the future.

From the hatch to the back seat
  1. Remove the hatch light access panel.
  2. Fold down the back seats.
  3. Pull back the weather stripping along the back part of the door.
  4. Tug where the lower and upper trim meet, and separate it slightly from the door. The bottom part is still attached, so don’t break anything. If you need more room, there’s a pushlock down by the seat you can remove. I did. (the picture is an old one of the left panel, not the right)
  5. If you look between the trim and the metal towards the hatch, you can see light coming through the hatch light access panel. This is the path for the wire.
  6. I tied the wire to a rod, and inserted it from the backseat through to the hatch.
From the back seat to the dash
  1. Remove the front and back scuff plates.
  2. Remove the B-pillar lower trim. (It pretty much just pops off)
  3. Remove the passenger front side trim.
  4. There’s a carpet fastener in the front and back near the door that just pop out with a little upward force. Remove these.
  5. Behind the trim and under the carpet you can see where the existing wiring harness goes. Just lay your wire and follow that, zip-tieing strategically to keep things in place.

    (rear/front)
From the passenger side to the fuse box
  1. Remove the passenger dash under cover. There are two small clips at the front you push in, and it comes off.
  2. Remove the driver/passenger side walls
  3. [Optional] Remove the cupholders and shift panel. It’s possible to wire straight between the driver/passenger side without doing this, but I wanted to follow the factory harness, which traveled this route.
  4. String the wire following the factory harness, around/through the console to the driver’s side. Zip tie as desired.
  5. Remove the fuse panel cover, put a light on the driver’s floor, and route the wire up to and out of the fuse box.

Connect the outlet

  1. In the hatch, cut the wire off where desired, and crimp on a female blade terminal. Connect this to the center blade of the outlet.
  2. Cut a 6″ section of black wire, crimp a ring terminal on one end, and a female blade terminal on the other. The ring must be able to fit over the tail light bolt.
  3. Remove a tail light nut and screw down the ring terminal. Plug the blade into the outlet.

Connect to the fuse box (Method 1 – Add-a-circuit)

For switched power, use the add-a-circuit with the cigarette light fuse. For always-on power, use the a-a-c with the console power fuse.

  1. The a-a-c comes with crimp connector already attached. Connect your wire to it with this.
  2. The a-a-c really only works in one direction. To test, only put in the fuse for the accessory and plug it in. If your outlet has power, the a-a-c is facing the right way. Otherwise, flip it over and try again.
  3. Plug in the original fuse, and you’re done!

Connect to the fuse box (Method 2 – Directly adding to the fuse panel for a factory-look)

IN PROGRESS: Working on this one at the moment. Still a couple wires I’m trying to get a hold of.

Trim reassembly

  1. Reverse of disassembly. Be nice to your weatherstripping!


2010 Mazda 3 – Making the Big Non-Functional Button Functional

June 2, 2010

At the bottom of his post on Mazda3Revolution forums, mazdazoom talks about making the two fake dash buttons functional (the ones to the left of the steering wheel by DSC and AFS toggles). Using that as inspiration, I set out to make the big fake button next to them functional. I succeeded, and it can now be used for anything.

Supplies

Tools

  • Dremel/Utility Knife
  • Soldering Iron
  • Pushpin, or similar
  • Crimper – (HarborFreight) pretty cheap and worth the investment
  • Sandpaper?

Getting to the big fake button

Below are the necessary dash removal instructions to get to the button (excerpted from the Satellite Radio-iPod Install Instructions). I don’t have pictures of removing the button unit, but it’s just a couple clips that, when released, let it come out. After that, push in the clips holding in the big fake button and remove it.

Making the faceplate actionable

The faceplate of the fake button will need to be able to move up and down if it’s to work as a real button. The 4 small clips that held it in place and a ledge that goes all the way around are in our way, but fortunately, we’re in a destructive mood.

  1. Unclip the face of the button from its case with some light prying.
  2. Cut the clips flush with the rest of the plastic, and completely cut off the ledges too. I’ve tried to highlight these areas in red. When done, the faceplate should be able to slide down until the guide hits the part outlined in green.
  3. Make the slit longer by cutting out the part filled with green. The faceplate should be able to slide down all the way.
  4. Shave down the plastic on the base unit until the button still fits well, but can slide easily, otherwise the sliding action is too tight to work as a good button. I spent about 10-15 minutes with a dremel and sandpaper thinning the sides of the base unit plastic and trimming the guides that are on each corner.

Creating the button mount

Below is what we’re starting to create. The real button will go inside a base made from the CD spindle and placed inside the fake button, allowing it to be depressed by the fake button faceplate.

  1. Find an old CD/DVD spindle and cut out the center post and some of the base surrounding it.
  2. Trim the spindle post base to be a rectangle that will fit inside the fake button housing, with the post sitting centered. Dimensions are 1-1/16″ x 3/4″.
  3. Cut the tip off the post, and you’ll notice the button slides inside. If it doesn’t, find a new button.
  4. Slowly trim down the post so that when the button’s inside and the post is in the housing, the faceplate will sit as close to the housing as possible while still being able to fully depress. The trick is to get it high enough that the button will activate properly once mounted in the car, but not so high that it will stick up out of the dash. For me, the distance from the bottom of the post to the top of the button is ~1.25″. Make sure the post top is cut flat.
  5. Drill a hole in the bottom of the fake button case for wires to pass through. I also had to chop off some of the plastic on the underside for a different implementation attempt. You may or may not need to.

Doing the wiring

  1. Solder the wires to the button and clean it up with some heatshrink tubing. (Test it before proceeding!)
  2. Attach the quick-disconnect ends to the wire. Heatshrink tubing on this part will help prevent wear on the ends if they move around. Don’t forget to slide on the heatshrink tubing first!

Attaching the (real) button to it’s custom stand

  1. Slide the button in the custom stand we made from the CD post and JB Weld them together. I used rubber bands to hold them together and let it dry over night.

Creating a means for easy future disassembly

While we could glue our working button unit inside the fake button case, I prefer a solution that lends itself to easy disassembly in case something comes up later. The last picture is an everything-done picture; your faceplate won’t be on yet.

How: We’ll pin down the button unit inside the case with paperclips running through the case.

  1. Insert the working button unit into the case.
  2. Using a pushpin, poke two sets of opposing holes in the side of the case so that the holes are just above the plastic of the button unit. For me, this was 3.5mm up from the plastic the button unit sits on.
  3. Straighten the small paperclip, cut it in half, run the pieces through the case, and bend the ends over. The button unit should be solidly held in place.

Attaching the faceplate

  1. Put JBWeld on the top of the real button, and press the faceplate firmly against it.
  2. To make sure the faceplate dries flat relative to the case, depress the faceplate fully, and rubberband it in place. Let dry overnight.

Fitting it in the car

  1. If you went the route of the paperclip pins, you’ll have to file away part of the dash hole for them to fit through.
  2. Press the now-real button back in place until you hear the clips click.

Hooking it up to stuff

I put the button back long before I wired it up to anything. To get quick access to quick-disconnects, I just pulled firmly on that part of the dash, and it came out far enough to plug stuff into.


Investigating LED Turn Signals on Side Mirrors of 2010.5 Mazda 3

May 7, 2010

Follow any new discussion at Mazda3Revolution Forums.

This is my initial investigation into LED turn signals on the side mirrors of the 2010.5 Mazda s GT. There 2010 version came with these, but the mid-year revision cut them out.

Conclusion

  • The wiring is present
    • The +12V that is for signal activation is the center pin.
    • The ground wire appears to be either black wire beside post in the car connector. I only tried one, though. Those black wires are also used for the heated mirror.
    • See demontration video of the intact signal wiring
  • I’m at a loss on how to disassemble the mirror plastic any further without breaking it. Being able to do this would allow mounting of an LED strip inside or just replacing the back cover with one that has a signal built-in. At the moment, replacing the entire mirror assembly is all I can suggest. If anyone can help with getting this open, I’d love to hear about it.

Initial Disassembly

There are a number of great tutorials on removing the mirror as part of adding heated mirrors. I followed these:

NOTES

  • One of the snaps on the triangular piece with the tweeter didn’t want to come out, so I gently used a flathead screwdriver to pop it out.
  • You’ll need a wrench to remove the lower left bolt, as there’s not enough space for a socket.
  • You can disconnect the heated mirror easily but just pulling the spade connectors out of it, and unclipping the wires. This makes further disassembly easier.
  • If you want to separate the two pieces of the mirror assembly
    • To get the connector that’s in the mirror assembly out, just grab it with some needle nose pliers, and pull firmly. It’ll come right out.
    • Wiggle, pull, and rip some of the foam wrapping the connector to pull it out of the base.

The pieces

Mirror removed from car

Mirror assembly with mirror removed.

With some pulling on the foam, it's possible to get the wire out of the mirror base so there aren't two pieces flopping around.

Confirming that the car connector is wired for the mirror turn signals

Test signal controlled by car-side mirror connector

Here's how I wired it up. Photo courtesy stitcH

Pulling apart the mirror case (INCOMPLETE)

If you want to signal lights without buying a whole new mirror assembly, you have to pull apart the mirror case and (a) cut and mount your own lights (b) buy aftermarket case backside that that the lights attached. I managed to get the motor out, but couldn’t figure out where to go from there without breaking anything. Any help would be greatly appreciated.

Removing the mirror motor

The steps are below. Refer to these pictures.

Motor clip diagram

Mirror with motor cover removed

Mirror with motor removed

  1. Undo the phillips screw
  2. The motor piece is made up of a top and a bottom part, with two clips holding it together; there are also clips holding the motor to the housing; and there are clips inside that hold the motor wires to the motor assembly.
  3. Use a flathead to push back the housing clips as well as those holding the top and bottom pieces together, and eventually, you’ll be able to work the top part of the motor assembly off and remove it.
  4. Now that you’re inside the motor assembly, remove the motors (when reassembling, remember that the words on the motors face down).
  5. Unclip the 2 sets of clips holding the wiring to the assembly.
  6. Lift the base of the motor assembly out, unclipping as necessary.
    !For mine, the lower right side didn’t want to come out and was really stuck on. I ended up sliding a flathead screwdriver under it and levering it quite forcefully. It came off without damaging anything.

Connectors

In his album, stitcH at Mazda3Revolution forums has some good pictures of the connectors. I also took some pics and labelled them below. Remember, this is for a 2010.5 Mazda 3 s GT. It’s interesting that the back view of stitcH’s mirror connector includes a center wire, unless his car has signal mirrors?

Mirror-side connector

Back view of mirror-side connector

Closeup of motor power connectors

original photo courtesy stitcH


DIY: Dual, Hidden LED Hatch Lights on a 2010 Mazda 3

April 26, 2010

The hatch light on the 2010 Mazda3 is an abysmal POS. It’s incandescent, gets super hot, and hardly illuminates anything.

My goal was to sub-in some LED light bars for better illumination. There are a couple write ups already, and I took my inspiration from StitcH’s great write-up on the Mazda3Revolution forums, but here’s where mine differs:

  1. I mounted LED bars on both sides of the hatch
  2. The LED bars are in the vents

My final product isn’t as bright as StitcH’s since my light bars aren’t as bright and the vent slats block some of the light, but the illumination is still really good, and it’s an amazing improvement over the stock lighting. I also really like how it’s hidden and looks like it came with the car.

Parts

  • Dummy bulb
  • 2x 10″ LED Piranha bars - These are great because they’re cheap, pretty bright, and come with mounting clips that work perfectly with the insides of the hatch vents.
  • Heatshrink tubing

Time: 2-3h

Cost: $25, shipped

Remove Vents

The light bars are going in the vents, so we have to remove them.

  1. Fold down the rear seats.
  2. There are tabs toward the rear of the vents that have a phillips screw underneath. Flip these down, and remove the screw.
  3. Use a small screwdriver to remove the pushlocks at the back, closest to the rear seats.
  4. Slide your hands along the edges of the vent to pop the clips out, and give a firm tug. They should mostly pop out.
    !There’s still a pushlock behind the passenger door trim that we still have to remove. Don’t break anything in the meantime.
  5. Pull gently on the vent piece close to the rear door until the trim starts popping out.
  6. Pop out the top part of that panel by following along the seam and popping out a couple clips. Pop out along the weather stripping by pushing down and pulling out. Play a bit until the top half pops away from the door. (The bottom will remain attached)
  7. You can now reach down and remove the pushlock for the vent that’s behind that panel. (referred to in stop #4)
    !Don’t drop it down there.
  8. The vent pops right off.
  9. Repeat for the other side.

Preparing the hatch for wiring

I ran the wire from one vent, down the side panel, along the front of the hatch (following the subwoofer wiring), up the other side panel, and to the other vent. This section is for gaining access to all those areas.

Remove the plastic trunk guard

  1. Take up the trunk mat and the foam around the spare tire.
  2. Undo the two pushlocks on either side of the plastic guard. (refer to picture above)
  3. Pop off the trapezoidal piece around the trunk latch.
  4. Pull up firmly and the guard pops out.

Pull back the side panels

  1. Undo the pushlock that’s were under the vent.
  2. Undo the pushlock by the net hook.
  3. Remove the net hook. The hook has a lid that pops up to reveal a 10mm bolt. Pop the lid and remove the bolt.
  4. Remove the light access panel for the right side, jack access panel for the left.
  5. There’s a strong metal snap along the side panel midway between the top and bottom, along the edge of the trunk. Get your fingers as close to it as possible and give a STRONG tug. It’ll make a loud POP! and come off.
  6. Repeat for the other side.

Wiring

I ran the wire from one vent, down the side panel, along the front of the hatch (following the subwoofer wiring), up the other side panel, and to the other vent.

  1. Feed the wire from vent to vent, behind the side panels, and along the front of the hatch. I lightly ziptied it to the subwoofer harness along the bottom and the rubber tubes behind the side panels. (We’ll tighten them later).
  2. Attach the connector ends to the wire and the dummy bulb. I used a drip of solder and covered with heatshrink. Make sure the extension wire gets different connector ends, and the end attached to the dummy bulb is opposite the connector on the wire it’ll be plugging into.
  3. Snap in the dummy bulb, and put all the connector ends over the panels where you want them.

Mount the LED bars

  1. Snap the bulb mounts onto the bulb.
  2. Position the bulb inside the vent. The snaps that snap the vent into the side panel are perfect for attaching the bulb mounts.
    !Don’t forget to flip the bulb in the right direction so the connectors are right.
  3. Use hot glue to attach the bulb mounts to the vent snaps.
  4. From here you can slide the bulb back and forth or spin it so the light will shine out the vent how you want.
  5. Repeat for the other side.

Finishing up

  1. Plug it all in and test it out before putting the hatch back together.
  2. Tighten zipties.
  3. Re-assembly is the reverse of the install. Make sure the weatherstripping doesn’t get pinched anywhere.

Before

After

The picture makes it seem a little dim in the middle, but it’s illuminated pretty well. As you can see in the second picture, the vent slats make the light appear in strips…a neat, unintended effect.


Cool Way to Get the Calling Method/Class in Java

August 13, 2009

I was looking for a graceful way of retrieving the class of the calling method. This isn’t half bad (found it here):

Class callingClass = new Throwable().fillInStackTrace().getStackTrace()[1].getClass();

And if you just want the name of the calling method:

new Throwable().fillInStackTrace().getStackTrace()[1].getMethodName();


Follow

Get every new post delivered to your Inbox.