Important notice: This electronic project is directly connected to the mains, extreme caution should be taken when building and connecting this project to the mains supply. The result could be fatal. If you have any doubt about building/using the project on this page – stop now. Equipment can be bought off the shelf for the same purpose as the project here. I AM NOT RESPONSIBLE FOR YOUR SAFETY |
||
About | ||
This device switches mains and/or non-direct mains appliances on and off via an infrared remote control. The schematics control 3 appliances, but can be expanded to 8. | ||
Notes about the project | ||
I’ve taken precautions for safety: each mains output is fused, enclosed in a grounded metal box, and uses opto isolators to prevent back voltage. Zero crossing detection helps avoid interference. Always double-check your build before connecting to mains. | ||
Building it | ||
Part 1. The circuit uses a PIC16F84 which receives infrared via a module. It responds to predefined IR codes. It currently doesn’t learn from new remotes but works with compatible or programmable ones. A recognized signal switches one or more outputs. Powered via internal USB (stays powered when PC is off). The test circuit responds to a Goodman's remote and shows IR data on port B. | ||
The circuit responds to the Goodman's IR remote. | ![]() |
|
![]() | ||
The ASM and HEX files for this code are here. | ||
Photos of the infrared receiver (taken with a 2006 phone!): | ||
Top view | Better view of the receiver | |
![]() |
![]() |
|
The receiver is made by Sony. The 4 LEDs are connected to RA1–RA4. RA0 is input. The signal from the IR receiver is clean enough for direct connection to the PIC. Development used a second PIC to duplicate and send codes for fast testing. Here's a photo during development: |
||
![]() | ||
Note: RA4 operates as a drain, making it ideal for IPAC "insert coin" input. Not all IR receivers behave the same — Goodman’s had lower signal levels requiring amplification. I stuck with the Sony one. |
||
![]() |
This is my final build of the PIC circuit. | |
Part 2: Mains SwitchingFinal caution – this section involves mains power. Risk of injury or death. This section switches mains appliances using opto-triacs. The software controls 3 channels, but can be expanded. |
||
Mains switching | BTA26 pinouts | MOC3041 pinouts |
![]() |
![]() |
![]() |
![]() |
Initially planned 3 units but built only 1 for the marquee light. A BTA26 triac is probably overkill for this project. Rated at 600v @ 25 amps, your likly not going to be switching such a heavy load. I have used BTA16's in the past in the same circuit. Probably much more suitable. Rated at 600V @ 16 amps. |
|
![]() |
Fitted into a metal box and safely grounded. | |
The PIC and mains switching sides are kept separate for safety. Here’s the final full circuit: |
||
![]() | ||
Don't forget the PIC’s power connections. If everything responds to IR, you can try the final code for full output support. Use the remote shown at the top or a universal one. Press 1 to trigger RA1. Key 5 switches it off. Keys 2–4 toggle other outputs. Key 8 switches off another latch. I power mine from an internal USB header.
If you have Proteus by Labcenter, you should be able to load in this project and run it in that environment. All my work is here.
|