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.

Monday, October 17, 2011

RIP Dennis Ritchie

The world has lost one of it's
greatest programmers.
I missed it in the news and just now read about it.  Dennis Ritchie, the father of the C programming language, died on October 12, 2011 at the age of 70.  The work that Dennis has done to bring modern computing to us cannot be overstated.

From Wikipedia:

Ritchie was best known as the creator of the C programming language, a key developer of the UNIX operating system, and co-author of The C Programming Language, commonly referred to as K&R(in reference to the authors Kernighan and Ritchie). Ritchie worked together with Ken Thompson, the scientist credited with writing the original Unix; one of Ritchie's most important contributions to Unix was its porting to different machines and platforms.
The C language is widely used today in application, operating system, and embedded system development, and its influence is seen in most modern programming languages. UNIX has also been influential, establishing concepts and principles that are now precepts of computing.
Ritchie was elected to the National Academy of Engineering in 1988 for "development of the "C" programming language and for co-development of the UNIX operating system."

We will miss you Dennis.

Thursday, October 13, 2011

LED Analog Clock

The LEDs are blue
 I got inspired the other month about a Nuts and Volts article on an LED analog clock.  This is my take on the project.

I started with a thin piece of board and cut a square out of it with the table saw.  Next a sat at the kitchen table for several hour while I figured out how I was going to lay out the LEDs.  I finally settled on 24 "Hands" and 4 "Tiers" plus the center dot.  Originally I planed on having more tiers, but I had cut the board to small and this was the most I could fit on and keep the tiers evenly placed.

My hand hurt from striping all that wire
The LEDs are wired into a 24x4 matrix controlled by 3 74HC595 shift registers and 5 digital I/O pins (4 for the matrix 1 for the center dot) connected to an attiny2313.  I have a DS1307 real time clock (RTC) connected over the I2C bus to provide the time keeping for the whole piece.

I still have yet to encase this mess
Savy viewers might note the batteries are only hooked up to the RTC, and they would be correct.  The batteries are only there to make sure the RTC keeps it's time and do not power the entire circuit.  I have yet to decide on how I want to power the clock, I could either choose a large battery pack and hope that it powers it for a long time (not likely) or I could tear up a wall wart and regulate the power to 5v and have it plug into a wall.

In a future version I think I'll move to
strip board instead of pad per hole
Apart from said power issues, the clock does work.  I do have a few additions I would like to make to it.  Mainly it needs a couple of buttons on it so that the time can be adjusted.  Currently the time can only be set by programming the AVR chip on board, and I need some way to adjust for daylight savings time.  The second big improvement it needs is some kind of frame to hold all of it's "guts" inside, instead of this mess of wires hanging out.  Lastly I was thinking to program in some "demo" modes because, well, I have a 97 led display and I want to do neat things.

I'll see about drawing up a schematic and posting code in the next few days.

Welcome to OMG-LED

Greetings guests, and welcome to OMG-LED.  There isn't much here, and to be honest I don't know if there ever will be a lot.  The purpose of this site is kinda of a "stuff drawer" of projects of mine, things I find interesting, rants, raves, and just about anything else.