Friday, January 5, 2018

Fix your car's AC with 3 zip ties and save $900

Last summer, it seemed like the AC in my 2003 Nissan Sentra stopped working. I would turn up the fan, and I would hear the fan become louder, but air no additional air (of any temperature) came out. Atlanta in the Summer without AC is a markedly unpleasant experience. For a while I just rolled the windows down, but that has limited utility once July rolls around. 

I took my car in for repair. I had thought that maybe a hose had come loose and the CA (conditioned air, being the thing created by the air conditioning) was being dumped into the engine compartment, and hoped that would be a relatively inexpensive fix. The Nissan folks told me that the entire HVAC "computer unit" would need replaced, for a cost of $900. They then came back and said that they couldn't do the repair anyway since they couldn't order the part from Nissan, who had discontinued manufacturing that unit. They told me that if I managed to acquire such a unit, they could install it and just charge me for the install.

While I was looking at eBay and other sources to see how cheaply I could acquire the unit, I noticed that air was coming out of the defrost vents -- cold air, if I had the AC on. I realized that the core AC and fan components were working fine, but the knob that controls where the air comes out had stopped functioning and stuck on defrost regardless of where the knob was set. A bit of web searching discovered that this was not an uncommon problem, so I dived in. 

Alas, the lighting conditions for these photographs were suboptimal; I had to perform the procedure at night so I wouldn't be sweltering.

First, snap off the big plastic bit that covers the lower control panels:

Second, you need to remove two screws to remove the HVAC's bezel:

Third, you need to remove the plastic covering the middle vents:

I had to unplug the radio to be able to maneuver:

Now we can see the culprit. The rear of the vent selector knob is the big chunk of white plastic, with a metal rod that slides in and out of the black sheath with the shiny end. In the defrost setting, the big chunk of white plastic moves far enough to activate the microswitch on the lower right of the photo. There's supposed to be a clip that holds the shiny end of the black sheath in place. You can see it's broken off, with the result that turning the knob makes the metal rod push and pull the black sheath instead of sliding in and out of it, so the actual setting stays the same:

I used three zip ties and some epoxy/glue/sticky-something (I don't remember exactly what) to keep the shiny end in its place:


Unfortunately, at some point in this process I accidentally broke the clip that holds the corresponding black sheath for the temperature setting in place:

The clip was still in place, it just wasn't snapped on all the way, so I was able to use the temperature control as normal for about six months -- I just tried to avoid turning it unless I absolutely had to, and I turned it slowly when I did. It finally broke a couple days ago and is now stuck on the full heat setting. Luckily this isn't too terrible since it's freezing out and I generally want the heat on anyway, but when Spring comes around I'll need to dig back in there again and fix it.

There was another problem. When I plugged the radio back in and started to screw it back into place, I got disturbing sparks between the radio chassis and the car chassis. (Yes, I should have disconnected the car battery before beginning my expedition). I got out my multimeter and measured an 8 volt difference between the radio chassis and the car chassis. Needless to say, this was a BAD THING. The rest of the car appeared to be in working order, so I presumed the fault was in the radio. It had been working fine that day; I have no idea what went wrong. I took this opportunity to replace the radio (whose CD player had died years ago) with an aftermarket radio with an aux input jack and USB and SD card readers that I got from Fry's on clearance for around $8 -- but that is the topic for another blog post.

Here is the radio that bit the dust:

Sunday, September 17, 2017

Running Energia on Mac OS X

Energia is a programming environment for the Texas Instruments LaunchPads, based on the Wiring and Arduino frameworks. It took a bit of effort to get it working on my Mac. I'm running OS X 10.11.6, El Capitan; hopefully these instructions will work for the more recent OS X 10.12, Sierra.

1) The most obvious thing is to go to instead of the windows page.

2) After starting Energia, go to the Tools -> Board -> Board Manager menu item and choose your target board. You should see a list of boards. For instance, you can choose

Energia MSP432 boards by Energia
Boards included in this package:

Clink Install for the entry corresponding to your target board. (I believe the entry listed above is for the black MSP432 Launchpad. If you have a red board, you should probably install the "MSP432 EMT Red boards" instead -- just a guess.)

3) Now quit Energia, since we'll need to implement an annoying workaround. When I first tried compiling a program, I got a dialog box with this error:

To use the "java" command-line tool you need to install a JDK.

Some discussion about this error may be found here. After doing a lot of google searching and hitting my head against the table a lot, I came up with a somewhat annoying but not utterly dreadful workaround.

If you open up a Terminal and type which java, it will tell you: /usr/bin/java

If you type java -version, it will tell you: No Java runtime present, requesting install.

Based on this webpage, I discovered /usr/bin/java is a link to


Instead, it should be a link to

/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java

You can't readily change the /usr/bin/java link without disabling something called System Integrity Protection (SIP), which isn't really something I wanted to do.

So, here's my hack:

3A) In the Terminal, type

sudo ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java” /usr/local/bin/java

That puts a link in /usr/local/bin, which SIP doesn't complain about.

3B) We need to get into the "package" of (I'm assuming you put it in your main Applications folder.) In the Terminal, type

cd /Applications/

In that folder, you'll find a file called Energia, which starts up the program. Let's rename it something else that we can call from our own Energia script. Type:

mv Energia Energia_main

3C) Then create a text file called Energia that contains these three lines:

export PATH=/usr/local/bin:$PATH

Now, when you double-click on the Energia icon, it will change your path to put /usr/local/bin before /usr/bin so Energia will find the correct java command line program. This path change is restricted to this running of Energia, so hopefully this won't mess up any other program that for whatever reason really should have /usr/bin before /usr/local/bin in the path.

Usual caveats apply; your mileage may vary. Use the above information at your own risk (although I don't think I'm suggesting that you do anything particularly risky.)

Saturday, September 16, 2017

Teardown of SNES and Genesis USB Gamepads

I picked up these incredibly cheap USB gamepads on eBay: Two SNES-style for $8.90 total, and two Genesis style for $15.24 total. They work reasonably well.
Let's take them apart, starting with the SNES-style controller. Removing the screws from the back reveals the boring side of the PCB, showing the crystal and the four standard USB wires.

Flipping over the board reveals a glop top and ten nice pads and two through-hole connections for the shoulder buttons that you could solder to, giving you twelve inputs if you wanted to use the PCB as general button-like-thing-to-USB converter.

Here's what the SNES-style controller looks like with the buttons and D-pad removed.
Now let's take look at the Genesis-style controller. Removing the screws from the back once again reveals a crystal and the four standard USB wires. Also note that the shoulder buttons are tactile switches.

Flipping over the board reveals a glop top, eleven nice pads and two through-hole connections for the shoulder buttons that you could solder to, giving you thirteen inputs if you wanted to use the PCB as general button-like-thing-to-USB converter.
Here's what it looks like with the rubber membranes removed.
For completeness, here's what the individual buttons look like, along with the inside of the back of the controller: 

Tuesday, September 12, 2017

Let's put those electrons to work!

I'm Aaron Lanterman, a Professor of Electrical and Computer Engineering at Georgia Tech.* This is my blog on DIY electronics**, with an aesthetic bent towards the retrofuristic: steampunk, dieselpunk, and games such as Bioshock and Fallout. Over the next few months, we'll design and construct a custom bass guitar pedal and a R2-D2 hat that bleeps and blinks. We'll hack together some custom game controllers and portable gaming consoles. We'll play around with analog circuits for music synthesis. We'll fix some old tube radios. We'll fix a car's air conditioning using three zip ties and install a new car stereo.

Along the way, we'll do some reverse engineering, and experiment with "single-board computers" like the Raspberry Pi and "microcontroller boards" like Arduinos and the Texas Instruments Launchpads.

I have another blog, focused on education: Edupocalypse Now: Education and Innovation in the End Times.

Like everyone else in 2006, I had a Livejournal where I posted political rants and personal life observations. (I technically still have it, although I don't post much there nowadays.)

*Opinions expressed here are my own, and not those of my employer. I may at times provide commentary on equipment that was donated to me or  Georgia Tech; I will disclose such situations in the interest of fairness (although I believe I can offer unbiased advise).

**Any electronic project may present a risk of injury or death, particularly when dealing with mains voltages. It is important to follow appropriate safety practices. The author of these pages, Aaron Lanterman, disclaims any liability for injury, death, or other damage caused in using any of the information contained on these webpages.