Wednesday, October 31, 2012

Homebrew Power Supply

I'm in the midst of designing / building a homebrew 220VAC to +12VDC / +5VDC power supply for the Remote Controlled AC Outlet projects. Not much else to say, just throwing up some pictures for now.

Oh, I will say this - if you are working with the mains voltage, BE CAREFUL. Sparks, smoke and flames are the least of your worries - electrocution and DEATH is what you should really worry about.

Here's an application note from MicroChip about transformerless power supplies: AN954


1st gen power supply design (right), connected to a PIC board (left)
It worked, but it shocked the heck out of me
when I touched the PIC board. And in the process,
it took out one of the LEDs.

Monday, October 29, 2012

Remote Controlled AC Outlet (PIC12F629)

For my next project, it's going to be something functional instead of just LED eye-candy. Yes, it still has LEDs on it (I have to have my blinky lights), but that's not all.

This project is a remote-controller AC Outlet, based on a PIC12F629. It incorporates a 40Khz IR receiver and all of the IR decoding is done on the PIC. When a POWER_ON IR code is received, it toggles the state of the AC control line (GP4), which either activates or deactivates a +12V relay. Right now there is only 1 relay (for one outlet) and a couple of LEDs on other control lines. Later I want to have a quad outlet where each outlet is individually controlled. But that means 4 relays, and - I only have one for right now.

This project was inspired when I was scrapping parts out of an old TV set and found a +12V relay in the power supply section (for the degaussing circuit, I'm guessing) and the IR receiver. That led to writing my own routines for decoding 40khz IR codes on the PIC12F629. And after I had remote control, I put it together with the relay.

  Yes, I know - it needs a lens over the open hole.
I haven't figured that out yet.

I'm using it to control the Christmas lights on my patio. Just point the remote at the window facing the patio and *click* the Christmas lights go on and *click* the Christmas lights go off. Yeah, it doesn't take much to amuse me.

Sunday, October 28, 2012

PIC12F629 Datasheet

If you are interested in working with the PIC12F629, you may want to download the datasheet from MicroChip HERE.

Dual Die Emulator V2.0

UPDATE 12:1113:
I've decided - after days of trying different schemes in the programming to get rid of the ghosting - that this is a really dumb design. Besides the ghosting, it draws _way_ too much current. In fact, depending on the number of LEDs lit at one time, it can sag the voltage from a little 500ma supply that I am running it on. That is too much for a battery operated toy. The money saved on transistors and resistors will be spend many, _many_ times over on a power supply. So - no more work on this design, I'm converting the V2 board I have back to a V1.
-----
In the aftermath of my Dual Die Emulator being posted at Hack-A-Day, I managed to glean some ideas from the good folks that comment there. That said, I came up with a V2.0 of the schematic and busily built a prototype tonight.

The original post is here.
The Hack-A-Day post is here.

This is V2.0 of the schematic that I came up with yesterday:


Sunday, October 21, 2012

Prototyping A Dual Die Emulator (PIC12F629)



Above The Post Update 12.1117:
Final changes have been made. I added two 220 ohm resistors - between the collector of each transistor and the cathodes of the corresponding LEDs. This helps to reduce the current draw and increases battery life. I also added a 9V Transistor Battery to +5V circuit, so I can connect an easy to find 9V battery to the device. Lastly, I cleaned up the schematic and it should be easier to read. That should be it for any changes, unless I need to increase the battery life even more.

 -----

I found some 100 LED Christmas lights at a local discount store for CHEAP. I paid only p169.50 (around US $4) for each string. I saw that they had one with PINK LEDs, so I bought that for projects and disassembled it once I got back to my MadLab.
100 LED Christmas light string in its' original condition.

The 100 LED Christmas light string - disassembled.
 
Since I had 100 Pink LEDs, I decided to build something LED intensive. So, using a PIC12F629 as the microcontroller, I decided to build a Dual Die Emulator. Each die would consume 7 LEDs, so I would use 14 LEDs total for the project.

 Back to the future: the project as it will look when completed.