Project Summary

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.
Project Description

The components are listed below.

  1. 1 x PIC16F84A Microcontroller
  2. 1 × 220V/12V 3.6VA (or 3.2VA) PCB Type Transformer (EI 38/13.6)
  3. 1 x Line Filter (2×10mH 1:1 Transformer)
  4. 4 × 12V Relay (SPDT Type)
  5. 4 x BC141 NPN Transistor
  6. 5 × 2 Terminal PCB Terminal Block
  7. 4 × 1N4007 Diode
  8. 1 × 250V Varistor (20mm Diameter)
  9. 1 x PCB Fuse Holder
  10. 1 × 400mA Fuse
  11. 2 × 100nF/630V Unpolarized Capacitor
  12. 1 × 220uF/25V Electrolytic Capacitor
  13. 1 × 47uF/16V Electrolytic Capacitor
  14. 1 × 10uF/16V Electrolytic Capacitor
  15. 2 × 330nF/63V Unpolarized Capacitor
  16. 1 × 100nF/63V Unpolarized Capacitor
  17. 1 × 4MHz Crystal Oscillator
  18. 2 × 22pF Capacitor
  19. 1 × 18 Pin 2 Way IC Socket
  20. 4 × 820 Ohm 1/4W Resistor
  21. 1 × 1K 1/4W Resistor
  22. 1 × 4.7K 1/4W Resistor
  23. 1 × 7805 Voltage Regulator (TO220)
  24. 1 × 7812 Voltage Regulator (TO220)
  25. 1 × 1A Bridge Diode
Figure 1
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.

Figure 2
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 NameFile Size
Schematic, Layout and PCB files399.01 KB
 
Top