Programmable relay switch using PIC MCU (revised version)


Raj has documented his DIY programmable relay switch using PIC16F1847 microcontroller:

Here are the summary of the features that this programmable relay switch has:

  • On-board +5V voltage regulator (operates at 9-15V DC input)
  • OFF and ON time setup for the relay operation
  • Option for cyclic run (maximum 100 cycles, after which the timer stops automatically)
  • Stores ON/OFF times and Cyclic option from previous setup into internal EEPROM
  • ON/OFF timing range: 0 to 99 hours and 59 minutes with 1 min resolution
  • Interactive user interface using 4 tact switches and a character LCD
  • On-board buzzer alarm

More details at Embedded Lab site.

Check out the video after the break.

Join the Conversation


  1. Hey folks, you should check out the schematics and the PCB…
    Can anyone justify the optocoupler?
    Both sides of the 4N35 are running on VCC, what is he trying to isolate anyway?
    Then he marked out a mains voltage area in the silkscreen but the copper fill looks to be poured everywhere, I looked very hard for breaks in the fill but didn’t see any. Gee, I would not have approved of this ver 1.4 board for production nor would I recommend this board to anyone.

    1. Holy flying spaghetti monster, I see your point! Not a sign of isolation around the HV traces. That 4N35 is useless – the relay itself will take care of isolation. I hope he sees this before any get sold and fry somebody…..

  2. Then again, the HV silkscreen area is incorrect too, it should not cover all of the relay…

  3. My goodness, that was scary. A PCB designer who knows that there will be a deadly high voltage section in his design will always check and verify everything. Can’t believe this passed on their PCB design review before being sent for fabrication.

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.