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 × 220V/12V 3.6VA (or 3.2VA) PCB Type Transformer (EI 38/13.6)
1 x Line Filter (2×10mH 1:1 Transformer)
4 × 12V Relay (SPDT Type)
4 x BC141 NPN Transistor
5 × 2 Terminal PCB Terminal Block
4 × 1N4007 Diode
1 × 250V Varistor (20mm Diameter)
1 x PCB Fuse Holder
1 × 400mA Fuse
2 × 100nF/630V Unpolarized Capacitor
1 × 220uF/25V Electrolytic Capacitor
1 × 47uF/16V Electrolytic Capacitor
1 × 10uF/16V Electrolytic Capacitor
2 × 330nF/63V Unpolarized Capacitor
1 × 100nF/63V Unpolarized Capacitor
1 × 4MHz Crystal Oscillator
2 × 22pF Capacitor
1 × 18 Pin 2 Way IC Socket
4 × 820 Ohm 1/4W Resistor
1 × 1K 1/4W Resistor
1 × 4.7K 1/4W Resistor
1 × 7805 Voltage Regulator (TO220)
1 × 7812 Voltage Regulator (TO220)
1 × 1A Bridge Diode
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.
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
| File Name | File Size |
|---|---|
| Schematic, Layout and PCB files | 399.01 KB |
Technical questions? Find your answers here! Digi-Key experts available 24-7!
Broad offering of high-performance analog, robust communications and innovative application-specific ICs
Designed for harsh-duty wash down areas, the V15W series of basic switch offers rugged, precise on/off control
3 years ago: It was a bit hard for me to find the same transformer but now everything works ok. thanks
2 years ago: can a 110 to 12 volt transformer work on this? Does anybody know?
2 years ago: Hi Rob, Of course you can use 110/12V transformer if you apply 110V AC to the power input.
2 years ago: Thanks I just wanted to make sure. I am looking at this to control pneumatic cylinders. I hope this works.
2 years ago: 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.
2 years ago: Oh and 110 not 220
2 years ago: I'm also wonderign if it can support more circuitry. Let's say double of what has been designed to support...
2 years ago: 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.
2 years ago: 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.
2 years ago: that was a nicely organized PCB with components!
2 years ago: I would like to ask if any interference/distortion caused on the controller by the relays switching on/off fast... thank you
2 years ago: 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
1 year ago: nice project...
may be the component you are trying to say is OPTOCOUPLER, isn't it Xcoder..
1 year ago: could someone tell me what is the function of this circuit.
what kind of application or situation that make people/industry use this circuit.
help me please.
may god bless you
11 months ago: hw can I connect it to my copmuter via rs 232 and control the relays from my computer ?
10 months ago: Hi every one. I am sagar, B.Tech 2nd year. Can someone help me to write program in ATMEGA128 micro controller for working of relay driver? We are doing project on intelligent irrigation system
10 months ago: how can i connect and operate relays to ATMEGA128 micro controller ?