I had been pondering this idea for a while. However on sunday night lying there waiting to fall asleep I decided that I was wanted to be able to stand out the front of the house and turn on and off the christmas lights. Surely I couldn't sleep now, I had just thought of a fantastic idea. So many different ways of doing it came to my head, Do I make or buy a network controlled relay? Do I create some kind of java server that you connect to with an app and then activate it? Do I make a website that interfaces with it? Then came the question of how I actually control them, Should I use the parallel port with some simple hardware or try and work out a method with USB or something? Lots of decisions to make and so little time. I was up till 3am researching ideas and what I could do. But as the night went on I ended up deciding on one. I figured that a website interface would be cross system compatible and easy to access on most devices. I also figured that seeing as I had a parallel port connector laying around and an old computer with a parallel port that I would use that to interface with a relay.
Monday afternoon after school I spent the time trying to sort out getting Java to talk to the parallel port. A webserver was no issue I had done it many times before but this damn parallel port was just not being easy to talk to. I decided to go and have a look at what components I would need to make the hardware side of this. Now, having done quite a few electronic projects in the past I had ample amounts of the components needed to make the hardware side. All I would need to get was a relay and a power cable to link it all up. By now it was 3am again and I went off to bed having not solved the issue with the parallel port and feeling pretty down about the whole thing however I was still planning to get the relay if the project didn't work.
The circuit diagram. I replaced the resistor for a smaller one and added an LED in series to it
I got up on Tuesday rushing to get myself ready because I had slept in. Turns out that if you need to get up early, staying up till 3am really does not help you. After spending the day at school watching the clock tick slowly on till the home bell rang, I came home and started work again. I decided to download a program to check that the parallel port was actually working, and sure enough it was... But what was this? It had a .dll file with it "Inpout32.dll". After a quick google search I had found my answer. After this I implemented all the code I needed and finally tested it. Sure enough the 2 little LED's I had jammed into the parallel port lit up as I realized this may work after all. I spent the next hour or so cramming all the components onto a small piece of PC board, soldering each component together as in the diagram. Now it was time for the final test... I plugged it into the computer hoping for the best. Browsed to the webpage and pressed the 'ON' button. The little light on the board lit up instantly. I guess it was finally going to work.
Waking up on Wednesday I had a bit to do. After going to Jaycar to buy the relay and a nice box I came home and soldered it all together into a mess of wires. After connecting it all up to the Christmas lights it was time for the test. Time to see if I had Achieved my goal. I went out the front door, down the stairs and across the road. I browsed to the webpage, hit the button and sure enough the house erupted in light! With a massive cheese grin on my face I pressed the button a few more times for fun In complete amusement.
FIN.
I would show you the lights... but they aren't finished yet :p
Attachment:
20121219_235207.jpg [ 3.26 MiB | Viewed 5168 times ]
The computer and Circuit
Attachment:
20121219_235214.jpg [ 2.94 MiB | Viewed 5168 times ]
Half the mess of wires for the lights (The other half is downstairs but they are all controlled off this one board)