Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

RC5 Remote Controlled Switch Board - AT89C2051 to PIC Based

Not open for further replies.


Advanced Member level 3
Aug 2, 2017
Reaction score
Trophy points
Activity points
RC5 Remote Controlled Switch Board - AT89C2051 to PIC Based

This attached circuit (image) is for a working AT89C2051 based RC5 Remote Controlled Switch Board (4 Lights, 2 Fans)

I want to implement this circuit using PIC18F

My questions are

1. As I will not be using a PIC reset circuit, can I omit AT89C2051 Pin 1 circuit composed of (100k, 33k, 10uF 50V, BC547, 10k)?

2. The Pin 8 circuit composed of (LED, 1N4007, 470R) is for RC5 data received Led. Can I omit the 1N4007 and replace 470R (Red Led) with 180R (for Blue LED)?

3. I will be using the internal 4MHz Oscillator of PIC and so I will omit the external Oscillator Circuit.

4. What is the purpose of 5V1 Zener + BC639 (Actually TCNL639) + 120R circuit? Can I omit it?

5. They have used 1uF 450V x 2 Capacitors in the power supply circuit but I will use single 2.2uF or 3.3uF 460V X rated Box Capacitors to get more current. Is that okay?

I will come to the code issues later when I make the PIC based circuit and start implementing the code. I have the AT89C2051 code which I had made some time back for the attached circuit and that works fine on hardware.


  • RCSB.jpg
    66.8 KB · Views: 153

I suspect the schematic has some errors.
I think the BC639 is supposed to be a 5V regulator for the IR receiver (possibly the MCU as well) but it does nothing as it is. The BC547 at the bottom of the schematic also looks wrong, I suspect the 1N4007 in its base should be between base and emitter.

1. Yes.
2. If you don't need indicators, don't fit them!
3. Should be OK.
4. See above, I suspect it should be a series emitter follower configuration. I would use a 78L05 instead.
5. With caution. The capacitors are used as reactive voltage droppers, if you increase the value it means the regulator has to work harder. Do you really need more current?



Thanks for the reply.

Okay, I will make a circuit using 78L05 and post it here for confirmation.

I guess I need max 200mA. I don't know how much PIC will draw buy I guess 50mA will be fine for PIC.

PIC - 50mA
6 TRIACs GATE Drive - 15mA * 6 = 90mA
LED - 2x X 10mA = 20mA

160mA total.

Are these correct?

I am using BTA10-800CWRG Snubberless Triacs 800V, Igt 35mA, 10A.

- - - Updated - - -


I was referring this but this method is for opto-triac based.

I will be driving Triac gates directly from PIC. Show what is the method to calculate gate resistor for my triac which is BTA10-800CWRG? Its Igt is 35mA.

Find my new modified circuit. The simulation runs okay but what happens if Phase and Neutral gets interchanged? How can I prevent that? Can I distribute the 2.2u 450V capacitor into say 2x 1uF capacitor that is one 1uF 450V on Phase line with its bleeded resistor and another 1uF 450V on Neutral with its own bleeded resistor?


    74 KB · Views: 105

It is more likely the PIC itself will draw around 5mA but you have to be careful about the current available on each IO pin AND the total available per port, there is a limit figure for both. Check the data sheet but most ports only allow 20mA so it wouldn't directly drive your triacs. The gate resistor calculation is just basic Ohms Law, (Vport - Vgate)/Igate.

Before worrying about the input capacitor, find the total load current and the voltage you need to drop, then use Ohms law to find the resistance that would do the job. Finally, calculate the capacitor with the same reactance as that resistance. Because the capacitor is effectively the voltage dropper, if you use a value bigger than needed you have to dump extra current as heat to keep the voltage down. You should add a fuse and consider a small series resistor too to limit surge current at switch on and during mains spikes.

I would strongly advise you to use a bridge rectifier at the input, if you use a half wave rectifier it will charge the capacitor to a high DC voltage which is not what you want. For the capacitor to work it needs alternating current flowing through it. A bridge will let it do that.

D3 and D4 will do very little, it would be better to replace them both with small Schottky diodes (BAT54 or 1N6263 for example) which have low Vf so it clamps the signal better between GND and 5V.


Okay, I can replace the power supply circuit with a transformerless power supply which I made for a circuit and it uses Bridge Rectifier. I have attached that circuit here. Somewhere in some application note, I read that if Bridge Rectifier is used then one cannot directly drive the gate of the Triac from MCU pins. So, if I use Bridge Rectifier (BR) then how can I drive the Triac gate directly?


    43.2 KB · Views: 113

By far the simplest way to drive the triac is through a zero crossing opto-coupler. It completely removes the need to find zero crossing yourself and it has sufficient current capability to drive your main triac. All your MCU has to do is provide enough current to drive the LED (~10mA) as a simple on/off high or low control signal. Just send current to the opto from the PIC pin and it will take care of all the switching for you. Look at the MOC3040 series data sheet.


Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to