Thursday, 28 June 2012

Project: Beer Fridge Lighting

Flawed. My new beer fridge, a 50L-odd unheard of brand bought off eBay for $72, was basically brand new and unused. But it had a serious design problem - it was built without an internal light. So you know, when you go to get something from up the back or you didn't turn the light on as you entered the room, you can still see what you're doing. Nope. Ok, so it's a tiny fridge that only holds my beers, so it's hardly be a crime if I get the wrong beer, because it'll still be nice. But I wanted it anyway. Firstly, I nipped down to my usual hangout, Jaycar, and got this: - which is a 48cm hard strip of white LEDs that can be cut to length and run off 12v DC. Great for cars, boats, computers, etc. The fridge was, at the time, in my bedroom, so I had a few a cables running around.

The beer fridge where it was first placed in my bedroom. Notice the two power 
cable running along the wall.

I used some random speaker wire I had lying around to run power to the LEDs. This wire passed through the small hole in the rear top right corner of the fridge, which was there for the thermostat controls to pass through. When I bought the LEDs, I also asked the guy to provide me with a 12v DC power supply, however he must've been full of shit because it didn't work. Pretty sure it was the wrong one. Power then had to come from an auxillary output from my PC's PSU...which was great as long as it was on. I also had the original plug for the fridge to deal with.

My beer fridge, newly outfitted with about 18 white LEDs to the roof just inside.
Light was now available, but it was a bit crap because I had a few random wires everywhere and the light only turned on when I flicked the switch taped to the roof inside the fridge. It ended up staying like this for about 18 months, until holidays from uni showed up, and I got the chance to attack my ever growing list of projects. A few months back, I went digging. I have a huge box of assorted electric garbage, that every now and then puts out some solid gold. There just happened to be an laptop PSU, which output 12v DC. This was exactly what I needed to be able to run the relays of their own dedicated supply, and through just one plug (instead of separate plugs for the LEDs and fridge). Unfortunately I didn't take any photos of this, but I used something similar to these: - cutting the power plugs off the fridge and 12v DC PSU, I wired their respective wires into shared connectors (earth from the fridge and LEDs into one connector, etc), then used the remaining fridge plug/cable to complete the circuit. Now the fridge and LEDs were running off the one plug. And this worked great. The last problem was having the LEDs operate like normal fridge lights - on when the door is opened, off when the door is closed.

I considered relays, and mounting momentary normally closed push button switches, but because of the design of the fridge door, there was really no easy way to mount it. And I wasn't too keen on drilling into the walls of the fridge, and potentially destroying the whole thing. Reed switches. While trolling the Jaycar site, I came upon this bad boy: - a very small, normally open reed switch. Whilst it was backwards for my needs (circuit is open when the magnet moves away), I could use a 5 pin automotive relay to wire it in the opposite direction.

Circuit diagram plan - the text at the bottom refers to the normal operation of 
these kind of relays. The diagram is correct.

The plan was to have the relay switch the 12v DC output to an open pin when the magnet closed the reed switch, so that the LEDs would not operate. When the magnet moved away from the reed switch, power moves to the normally open pin - but actually goes to the LEDs and powers them up. Pretty standard operation of a relay I guess, but I think it's pretty cool. With that, check out the picture.

 LEDs in operation with reed switch and relay; notice the reed switch and magnet in the 
top right corner of the fridge?

And that's it. Pretty simply project I guess. The wiring for the reed switch unfortunately runs on the external top surface of the unit, so it's held down by copious amounts of duct tape. The relay is zip tied to the chassis, along with the 12v DC PSU and merging connector block. Many, delicious beers...


Project: Car A2DP Bluetooth Receiver

Extortion. I'm pretty sure that was word I used when I started looking into how much it would cost to be able to use bluetooth to stream music from my phone to the head unit in my car. I have a Pioneer DEH-5850MP 50Wx4 unit, which I picked up second hand and works fine. Pioneer manufacture a bluetooth module that interfaces with their proprietary IP Bus socket on the back of the unit, and weighs in at something like $599 AUD last time I checked. My car isn't even worth that much. Additionally, the whole purpose of using bluetooth is to a) do away with cables, and b) be able to skip tracks without having to touch my phone. Which the Pioneer unit still wouldn't offer. So I started thinking about what I could hack together for the purpose.
Nokia BH-503 headphones.

The Nokia BH-503. These are the bluetooth headphones I use day to day for streaming music to my brain. Rechargeable, lightweight, and feature audio controls on the right side earpiece. I came up with the idea of using the PCB as the basis of a system that would suit my needs. I had a broken BH-501 (predecessor model, volume and call answer/end functionality only), so I drew up a circuit in the most bad arse design program going, MS Paint, to see how it would come together. The picture does have an obvious open circuit, which in hindsight needs a resistor, followed by connection to +12v DC to bring the supply voltage for the LEDs in the push buttons to 3.5-4.0v. More on illuminated push buttons later.

 BH-501 concept circuit diagram.

So that was cool. Guess the headset needed to be cracked open, to see how damn small the Fins had made it. Some of these pictures will be the BH-501, but towards the end they will all be the BH-503.

 BH-501 PCB, showing connections and former Nokia ingenuity.

There are three PCB mount push buttons, two pairs of speaker wires, a pair of wires for the battery, and the microphone. The processor is beneath the copper shield. Because I guess he's a douche. Anyway, knowing minimal about TRS audio configurations, I had to work out how to attach a female 3.5mm stereo TRS socket to the PCB using the four speaker pads. So that's four wires off the PCB going into three on the socket. The assumption was made that both channels can get away with a shared earth, whilst the positive sides go to their respective pins on the socket to keep the channels separated. Funnily enough, this actually worked. I did this by putting a tiny U-shaped piece of wire between the two earth pads, then attaching the TRS socket earth wire to one of them.

My old Nokia N900, which I literally sold today, A2DPing Radiohead to my 
PC speakers via the connected TRS socket.

The next step was power. The BH-501/3 runs on 3.7v DC, as is cleverly stated on the front of the 260mAh battery that powers it. Herp derp. So I figured running 12v DC from my car battery through it may cause some slight problems. In comes the LM317T, who sits down and says "I got this guys". The LM317T is a voltage regulator that can be used for reducing input voltage to an appropriate level. I'm sure it does other things too. Using the datasheet, LM317T calculator ( and my multimeter, I worked out what resistors to run it with to achieve the right voltage. Initially I had R1 set at 240Ω, and R2 at 470Ω, which resulted in 3.67v; unfortunately this caused some noise in the end product (crackles). Talking with an audio enthusiast over on TMO (, it was suggested to bump up the supply voltage slightly, as bluetooth audio units tend to play up under limited power conditions. With R1 at 220Ω, and R2 at 470Ω still, we were running nicely at 3.9v DC. It must've been quite funny for my neighbors to see me come outside with this bundle of wires that probably looked like a bomb, some headphones and a phone, hook them up to my car battery for five minutes, then go back in the house. Aaaand repeat. Many times over.

BH-501 running off 12v DC by use of a LM317T. And a lot of swearing.

So fast forward a bit, and skipping the plethora of problems I encountered (mostly inability to sensibly place components on a protoboard), I was ready to mount the BH-503 board in a project box, with a cable bundle coming out of a hole in the side, with all the necessary plugs. I didn't take a picture of this, but after using the finished project for a few weeks I started to smell that plastic-getting-slightly-too-hot-but-not-burning-yet smell. The LM317T was converting the excess voltage to heat, which I somehow calculated using some physics maths on found on the internet, and then measured. Temperature was reaching around 75°C, so I built a very small power circuit on a piece of protoboard, allowing the LM317T to be free standing (instead of laying down under a layer of tape), and then made a heat sink out of a bit of an old computer case. I also drilled three 6mm hole in the lid directly above the heat sink, and it's been fine ever since.

How it initially went in the car, before the overheating issue.

Close up of the component layout inside the project box (pre-overheat).

The last thing I needed to do was create a bank of buttons to control the BH-503, and the music I'm listening to. I only needed seek/skip backwards, play/pause, and seek/skip forwards, so I bought three back lit PCB mount push button switches ( Because the amps available to the unit is whatever my alternator puts out (probably minimum 70A), I can run the LEDs in the push button switches on the same power circuit. Well, there's probably a better way to do it, but that was my logic and it works well. Using an LED array calculator (, I worked out I only needed one 10Ω resistor to power the bank. This was made as small as possible, to mount in the dash fascia between the bottom of my head unit and the pocket where I put my phone while driving.

The bank of LED back lit push button switches mounted in the removable dash fascia.

Front view of the bank.

And with that, came time to mount it in the car. The car in question is a 1995 Mitsubishi TS Magna sedan (executive), sporting the "burly" combination of a V6 and manual transmission. Because it's basically a poverty pack, I have a lot of room in front of the gear stick and directly below the head unit. Perfect for fitting stuff in - if I was doing a carputer I'd be set. The box is now mounted to the dash support frame with the most versatile and useful building material known to man, the zip tie, with the plugs for power, lights and button bank going off in their respective directions. The head unit is connected to this fire hazard by an IP bus to 3.5mm TRS male cable, off eBay for a few bucks. Love it how all these weird cable combinations all come out of Hong Kong. They must have some insane backyard hacking going on over there.

And we're left with this.

The finished product, with horrible reflective dome self-tappers.

This has all been running wonderfully for about six months now, firstly with my N900, and now an SGS2. I should mention the multifunction button that turns the unit on and off and makes new pairings, is routed to a blank factory button on my dash just above the head unit. Unfortunately, the head unit has to be turned up to 50/60 (volume) to get loud sound out of it, so I'm looking into building a small inline amplifier to boost the signal before it reaches the head unit. Enjoy, modify to your own needs.


Edit: found a completed picture!

Completed unit after the overheating incident. Notice the power 
circuit with heat sink.

404: High quality work not found

Yep. You've stumbled onto one of the less polished corners of the internet. Where things kind of work, but are mostly unfinished, occupying space, and a nightmare to stand on in bare feet. It's my dumping ground for electronic ideas, and the occasional idea that makes it past the thunderclap headache they usually arrive with. I am by no means an engineer, as you shall see, but I've surprised myself with what a lot of hours of research can do. Maybe it'll be interesting to someone. Perhaps you? Likely not.

My "workshop", which looks like this 95% of the time.