Electromagnetic relay is a commonly used component in automatic control. It uses electromagnetic principle to realize an automatic switch that turns on or off one or a group of contacts. It is widely used in electronic equipment, instrumentation and automation equipment. However, in various automatic control devices, there is a problem of interconnection between a low-voltage automatic control circuit and a high-voltage electrical circuit: on the one hand, the control signal of the low-voltage electronic circuit can control the actuator of the high-voltage electrical circuit; Provides good electrical isolation for electronic circuits and electrical circuits to protect electronic circuits and personnel. To this end, the PIC16F87X microcontroller is used to control the electromagnetic relay to try to complete this bridge.
1 electromagnetic relay working principle
An electromagnetic relay is a relay that produces a predetermined response by the relative motion of mechanical components under the action of current in the input circuit. The electromagnetic relay is generally composed of a control coil, an iron core, an armature, a contact reed, etc., and the control coil and the contact group are insulated from each other to provide a good electrical isolation function for the control circuit. It mainly uses the principle of electromagnetic induction to work. When the rated voltage of the coil is added at both ends of the coil of the relay, a certain current flows in the coil, thereby generating an electromagnetic effect, and the armature will be attracted by the electromagnetic force. Overcoming the pulling force of the return spring sucks toward the iron core, thereby driving the movable contact of the armature to the static contact (normally open contact); when the coil is powered off, the electromagnetic suction force also disappears, and the armature is in the spring The reaction force returns to the original position, and the moving contact is brought into contact with the original static contact (normally closed contact). The pull-in and release of the relay act as a switch that turns on and off in the circuit. The following points should be noted when selecting an electromagnetic relay:
(1) Selection of the rated working voltage of the relay. When using the relay, first understand the working power supply voltage in the circuit where the relay is located. The working voltage of the relay should be equal to the voltage, or the circuit power supply voltage is 80% of the working voltage of the relay. It can also ensure the normal operation of the relay, but it can not make the circuit workpiece. The voltage exceeds the rated working voltage of the relay, otherwise the relay coil is easy to burn.
(2) Selection of relay contact load. The number and form of the contact load should be determined according to the characteristics of the circuit controlled by the relay, and then the contact capacity can be selected by the type of current, the voltage and the current in the contact control circuit. The size of the contact capacitance reflects the voltage applied to the contacts and the ability to pass the current through the contacts. The load of the contacts should not exceed the capacity of the contacts.
(3) Selection of relay coil power supply. Under normal circumstances, the circuit design uses DC relay, and the type of relay can be considered according to the characteristics of the control circuit, and the power consumed by the relay should also be considered.
(4) Selection of relay action time. The action time and release time of the relay should be selected according to the time requirement of the actual circuit for the action of the controlled object. Electronic components can also be added to the relay circuit to speed up or delay the action and release time of the relay to meet different requirements.
(5) Working environment conditions. When selecting a relay, the ambient temperature, working life, and shock vibration should also be considered.
2 PIC16F87X control circuit design
2.1 PIC16F87X Features
Microchip's PIC16F87X family of 8-bit microcontrollers is a high-performance embedded microcontroller with a reduced instruction set (RISC) architecture and Flash memory technology. It is fast, scalable, powerful, logically structured, and has in-circuit programming. Power-on, power-down reset protection, and watchdog functions.
2.2 relay control circuit principle
Based on the many features of the PIC16F87X, the hardware circuit of the PIC16F87X control relay is designed (see Figure 1).
Figure 1 PIC16F87X control relay circuit schematic diagram When the RD0 pin of the single-chip microcomputer outputs low level, the optocoupler U1 is cut off, there is no potential difference between the two ends of the relay coil, the relay armature is released, the relay normally open contact is released, which is equivalent to the switch disconnection; When the RD0 pin outputs a high level, the optocoupler U1 is saturated and turned on. The 24V power supply is applied to both ends of the relay coil, and the relay is closed. The normally open contact is closed, which is equivalent to the switch closing.
At the moment when the optocoupler is turned off, the current in the coil cannot be abruptly changed to zero. A high-voltage induced electromotive force is generated at both ends of the relay coil. A diode D1 should be placed at both ends of the coil to cause the induced electromotive force generated by the coil to be released through D1. Protect the triode from breakdown and eliminate the interference of the induced electromotive force on other circuits.
2.3 PIC16F87X control software design
The PIC16F87X control software is developed in C language under the MPLABIDE environment, and compiled by the PICC compiler developed by Hitech. The program flow is shown in Figure 2.
The source code of the relay control software is as follows:
After the source program is compiled, it is programmed into the PIC16F87X through ICD2 programming, and the control circuit is powered on. The relay is repeatedly turned on and off within the specified time. You can hear the relay "嘀哒" and keep watching the RD0 output with the oscilloscope. The signal is shown in Figure 3.
3 Conclusion
The electromagnetic relay based on the I6X MCU uses a photocoupler to drive and isolate the relay; the diode freewheeling prevents the high back pressure that occurs when the current in the relay coil is cut off, protecting the device that drives the relay. The circuit is simple in design, reliable in operation, and has certain application value.
Welcome to reprint, this article from the electronic enthusiast network (http://)
Rotary ploughing Cultivator Machine:
This ploughing cultivator is centered on a rotating column and surrounded by ploughing knives. The land ploughed by our machines is very loose, the soil has been improved, fertilizer and soil conservation. Through cultivated land, the surface soil layer of a year is turned to the lower layer, so soil maturation is accelerated, which is conducive to promoting the journey of soil aggregate structure, thickening the living soil layer, deepening the cultivation layer, and increasing the living soil layer.
Rotary ploughing Cultivator Machine Technical Parameters:
1. Cutter shaft: single-axis
2. Tilling width: 2000 mm
3. Size: 2250*750*980 mm
4. Rated power: 51.5-65KW
5. Weight: 386KG
Typical Applications: can be worked in paddy field, dryland or hilly ground.
If you have any questions, please contact us directly. Crawler tractor for agriculture are produced by Hunan Nongfu with high quality and good appearance.
welcome you can visit our factory for inquiry, please send mail directly to us.
Rotary ploughing Cultivator Machine
Tiller Cultivator, Small Tractor Cultivator, mini tillage machine, rotary tiller
Hunan NongFu Machinery&Electronic.Co., Ltd. , http://www.nfagmachine.com