Circuit-Projects.com New Projects
Loading the search box...
Control

PIC Controlled Relay Driver

This circuit is a relay driver that is based on a PIC16F84A microcontroller. The board includes four relays so this lets us to control four distinct electrical devices. The controlled device may be a heater, a lamp, a computer or a motor. To use this board in the industrial area, the supply part is designed more attentively. To minimise the effects of the ac line noises, a 1:1 line filter transformer is used.

The components are listed below.

1 x PIC16F84A Microcontroller
1 x 220V/12V 3.6VA (or 3.2VA) PCB Type Transformer (EI 38/13.6)
1 x Line Filter (2x10mH 1:1 Transformer)
4 x 12V Relay (SPDT Type)
4 x BC141 NPN Transistor
5 x 2 Terminal PCB Terminal Block
4 x 1N4007 Diode
1 x 250V Varistor (20mm Diameter)
1 x PCB Fuse Holder
1 x 400mA Fuse
2 x 100nF/630V Unpolarized Capacitor
1 x 220uF/25V Electrolytic Capacitor
1 x 47uF/16V Electrolytic Capacitor
1 x 10uF/16V Electrolytic Capacitor
2 x 330nF/63V Unpolarized Capacitor
1 x 100nF/63V Unpolarized Capacitor
1 x 4MHz Crystal Oscillator
2 x 22pF Capacitor
1 x 18 Pin 2 Way IC Socket
4 x 820 Ohm 1/4W Resistor
1 x 1K 1/4W Resistor
1 x 4.7K 1/4W Resistor
1 x 7805 Voltage Regulator (TO220)
1 x 7812 Voltage Regulator (TO220)
1 x 1A Bridge Diode

Printed Circuit Board

The transformer is a 220V to 12V, 50Hz and 3.6VA PCB type transformer. The model seen in the photo is HRDiemen E3814056. Since it is encapsulated, the transformer is isolated from the external effects.

{mosgoogle}A 250V 400mA glass fuse is used to protect the circuit from damage due to excessive current.

A high power device which is connected to the same line may form unwanted high amplitude signals while turning on and off. To bypass this signal effects, a variable resistor (varistor) which has a 20mm diameter is paralelly connected to the input.

Another protective component on the AC line is the line filter. It minimises the noise of the line too. The connection type determines the common or differential mode filtering.

The last components in the filtering part are the unpolarized 100nF 630V capacitors. When the frequency increases, the capacitive reactance (Xc) of the capacitor decreases so it has a important role in reducing the high frequency noise effects. To increase the performance, one is connected to the input and the other one is connected to the output of the filtering part.

Click here to download the schematics, PCB layouts and the code files

PIC Controlled Relay Driver


After the filtering part, a 1A bridge diode is connected to make a full wave rectification. A 2200 uF capacitor then stabilizes the rectified signal.

The PIC controller schematic is given in the project file. It contains PIC16F84A microcontroller, NPN transistors, and SPDT type relays. When a relay is energised, it draws about 40mA.

As it is seen on the schematic, the relays are connected to the RB0-RB3 pins of the PIC via BC141 transistors. When the transistor gets cut off, a reverse EMF may occur and the transistor may be defected. To overcome this unwanted situation, 1N4007 diodes are connected between the supply and the transistor collectors.

There are a few number of resistors in the circuit. They are all radially mounted.

Example C and HEX code files are included in the project file. It energises the next relay after every five seconds.

Y. Erol


Comments (13)

john
It was a bit hard for me to find the same transformer but now everything works ok. thanks
Rob
can a 110 to 12 volt transformer work on this? Does anybody know?
jack
Hi Rob, Of course you can use 110/12V transformer if you apply 110V AC to the power input.
Rob
Thanks I just wanted to make sure. I am looking at this to control pneumatic cylinders. I hope this works.
Rob
Hey can this be made to run seven or eight outputs? If so what would it take? Or is there another design that will that I am missing? I am looking at this to control pneumatic cylinders. Any help is appreciated.
Rob
Oh and 110 not 220
noli locsin
I'm also wonderign if it can support more circuitry. Let's say double of what has been designed to support...
Rob
I was wondering the same thing but no-one answers. Maybe I wasn't clear with what I asked. I would like to see a design for eight output circuits.
XCoder
I think it's possible! You can use all 12 pins on PIC, but if you need buttons to control all of them individually then 6 buttons 6 relays. I managed to create code in asyambler and use pic16f84a with max232, now I'm able control all of my relays ( right now LED's) through computer, using only 2 pins on pic as buttons! I can control up to 10 relays.
gec chia
that was a nicely organized PCB with components!
schnitzer
I would like to ask if any interference/distortion caused on the controller by the relays switching on/off fast... thank you
Xcoder
I think it's not very smart to switch a relay on/off very fast, because a relay is still a mechanic device! There was an alternative, but I forgot that components name. :D
kVn7i
nice project...

may be the component you are trying to say is OPTOCOUPLER, isn't it Xcoder..

Write comment

smaller | bigger

busy
 
RSS
Get the latest projects to your e-mail box:
Subscribe to RSS Feed Follow us on Twitter
Contact | Privacy Policy | Advertising
Subscribe to RSS Feed