Wednesday, November 2, 2011

Relay control hack

My father recently picked up a vacuem system for his woodshop.  It is second hand, and looks very nice, it comes with an air filter also.  How it works however is their is a plug that goes into a standard 120v wall outlet and it has a box on it that you plug the vacuem to.  Now this box is just a relay, a circut breaker, and a RF recever.  It should have a remote to go with it, but one of the fun things about getting second hand stuff is that you don't always get everything.

Now I'm not good at RF, yet.  I just don't have the equipment for that kind of freqency, but what I can do is IR. (Infra-Red)  Now this was fun because I got to tear open this box and modify a pre-existing circut.  After opening it up I studyed the circut a bit and was able break it up into 3 main parts: the Relay itself, a 5v regulated power supply, and a RF recever circut.

For this hack I just disconnect the RF circut, build my own IR circut and attach it to the supplied 5v line.  I will be using an attiny13a microcontoller atached to an IR recver to decode IR codes, and then toggle a pin attached to the relay turning the vacume on and off.

To start with I built the circut on an Arduino and just had it watch for any IR activity to turn a lamp on and off.  After  mking sure the proof of concept worked I set out to remake it using the attiny and an old TV remote.  My plan is to be able to set up timer using the remotes number buttons.

LED Flood-Light

So my neighbor was complaing about a 500 watt flood light that he has to leave on to keep his dog from barking at night.  He claims that the thing averaged $100 a month in eletricity, now I don't know if that is correct but I do know that switching to LEDs would defently use less power than a halogen bulb.  So we decided to build a LED flood light useing his old one as a base.

The first step in this build was to source some LEDs, I suggested some 1-watt or 3-watt LEDs that I had used before.  He wanted this thing to be bright as the sun so we setteled on some 10-watt cool white LEDs that we found on ebay.  We ordered 10 but are only useing 5 in this build.  Now let me tell you when I say these things are bright, I mean I have to where my sun glasses when testing this thing and I still see tracers.

After the LEDs had arived I spent a little bit of time familarizing myself with them.  If you look close at them they appear to be 9 LEDs wired in 3 series of 3 each.  After checking the data sheet I beleve my hypothosis to be correct, because the forward voltage is around 9 volts (That is to say, I need 9 volts to get it to light up)  and a standard white LED is around 3 volts.  The other thing to consider is the power that can run through one of these, 1000 mA.  Wow! 1 amp.  To give a comparson a typical 5 mm LED is at about 20 mA.

So now that I know what my power requirements are we set out to find a way to drive these buggers.  Once again we went to ebay and found an AC-DC power adapter that outputs 12v upto 5 amps.  At 5 LEDs each capable of drawing 1 amp each this should work.  Now acording to Ohm's law I = V/R
that is Current equals Voltage divded by Resistance.  So with our setup it would be 1 = 3 / R.  I used a 3 in the voltage spot because our source is 12v minus the voltage drop of 9v from the LED for a total of 3v.  Rearanged we get R = 3.  So we need a 3 ohm resistor to limit the current to each LED.  Back to ebay!

We finally setteled on some 5 ohm 5 watt resisters.  I chose to use a higher ohm rating to keep the current draw a bit lower than maximum and hopfuly make the LEDs last a lot longer.  After some inital tests, we were happy with the results of the brightness of theses.

Whall testing I noticed that these things got HOT!  So some thermal manegment was in order.  After digging around in a few boxes of old parts we came across an old dead Xbox 360 that was already tore open.  We robbed a heat sink from it that was big enough to fit all 5 LEDs on.  These LEDs are big enogh that they have small holes in them mounting with screws, so drilled a few small holes in the heat sink and added a little thermal paste under each LED and mounted them.

After mounting I got my trusty soldering iron out and wired up a bored for the resisers and then wired up the LEDs and connected them together.  I dug through a few more boxes of old parts and found that my old linksys wap11 wi-fi acsess point had the same size barrel jack as the power supply we were using and it didn't work anymore so I robbed the barrel jack from it.  A little hot glue later (Turns out this was a bad idea) I had insulated the contacts on the LEDs.  Before I J-B weld the barrel jack in place and secure the heatsink down I ran a trial run and measured with a contactless thermometer.  It very quickly got up to about 260-280 degrees Farenheight.  Hot enough to melt all my hot glue. (I really should have saw that coming)  Luckly it was just there as added insulation for the electcal connections and nothing shorted out, it just looks... melted, and sticky.  But after 2 hours on, it hasen't heated up enough to reflow the solder or burn out any LEDs.  In addtion to that I also measured it's wattage thanks to my Kill-a-watt,  just over 40 watts, less than one tenth of what he was useing before.