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.



Remote Controlled AC Outlet V1.01 Schematic:




Remote Controlled AC Outlet Parts List:

  • (1) PIC12F629
  • (1) 8-pin socket (optional)
  • (1) 6-pin female header, single row (optional)
  • (1) 5-pin female header, single row
  • (1) 5-pin male head, single row
  • (1) Red LED
  • (1) Blue LED
  • (1) Green LED
  • (3) 1.2K ohm resistor
  • (2) 10K ohm resistor
  • (1) 100 ohm resistor
  • (1) 2N4401 transistor
  • (1) 1N762 diode
  • (1) 40khz IR receiver
  • (1) +12V relay (220VAC rating)
  • (1) perfboard, 1.5cm x 4.5cm (relay board)
  • (1) perfboard, 3.5cm x 3.5cm (micro board)
  • (1) Momentary NO push button switch
  • AC outlet
  • AC outlet bracket
  • AC outlet faceplate (2 hole)
  • AC outlet box
  • (A/R) Blue wire
  • Some kind of +5V/+12V power supply

    The 8-pin socket and the 6-pin female header are optional if you pre-program the PIC before soldering it to your board.

    I have an ugly +5V/+12V power supply that slings under the AC outlet box. I want to put everything inside the AC outlet box, but I'm still working on a transformer-less 220V to +5V/+12V supply.

    The blue and green LEDs, and their associated 1.2K resistors, are just eye-candy for right now and are also optional. For a multi-outlet controller, you can have a different color LED that illuminates if the outlet is active. I figure 4 outlets / relay boards max - because that's all the free I/O that is on the PIC - so red, blue, green, and yellow LEDs to identify each active outlet.
Remote Controller AC Outlet Assembly Photos:

Installing the first parts on the Micro Board.
  

Rat's nest wiring started, IR receiver mounted.

Completed Micro Board.

Closer view of the complete Micro Board.

The Relay Board.

Back side of the Relay Board.

Side view of the Relay Board.

Fitting the Micro Board to the Relay Board.

Testing - Everything off.

Testing - Everything on (2 LEDs and AC outlet).

Micro Board mounted in the enclosure.
The cable is for +5V/+12V/Gnd

Front view of the Micro Board mounted in the enclosure.

Inside the enclosure with everything assembled

Front view of the enclosure before the faceplate is installed.

Front view of the enclosure (with faceplate).

Left side of the enclosure.

Right side of the enclosure.

Back view of enclosure.

The remote control I used for the project - a Fisher TV/VCR remote with a 'gizmo'.
This project actually recognizes 4 different remotes.

I drew up a quick schematic for quad outputs. It requires 3 more relay headers on the PIC board and 4 relay boards total.

Quad Remote Controlled AC Outlet Schematic V2.0


Demonstration videos:

Nighttime cheesy video (hard to see anything besides the lights):



Daytime cheesy video (easy to see everything EXCEPT the lights):

No comments:

Post a Comment