Share this

Design of a CAN bus-based distributed security detection system

2026-04-06 01:53:33 · · #1
Abstract: In order to prevent accidents caused by misoperation or accidental entry in industrial production, and thus ensure personnel safety and normal production. This system uses the photoelectric conversion characteristics of infrared sensors, and uses AT89C51 microcontroller as the core control unit to process the detection signal. At the same time, it controls the CAN bus communication system composed of CAN bus controller/receiver to display the data transmission status, and completes the design of distributed safety protection detection and control system. This design realizes the safety protection detection and control of the production site based on infrared sensing technology, microcontroller technology, EDA technology and CAN bus technology. The article introduces the circuit principle of some modules of the system. Keywords: CAN bus; safety detection; infrared sensing; microcontroller 1. Introduction With the continuous development of automatic control technology and fieldbus technology, networking and integration have become important development directions of modern control systems. CAN bus (Controller Area Network) is a serial data communication protocol developed by Bosch in Germany in the early 1980s to solve the data exchange between many control and testing instruments in modern automobiles [1]. This article introduces a distributed control network that utilizes infrared sensors for non-contact detection, combined with microcontroller technology and CAN bus technology, to connect existing sensors, electronic control units, and actuators in the field. This network effectively ensures the personal safety of personnel and the normal operation of production. The system has broad application prospects and can be used for safety protection in hazardous locations and areas, safety protection in machining, textiles, and food processing, as well as home security alarms. 2. System Composition and Principle Infrared light is widely used in remote control devices because it is not easily scattered when passing through objects filled with suspended particles, such as clouds and fog, and has strong penetration and anti-interference capabilities. Furthermore, infrared remote control is less prone to crosstalk. The signal detection part of this system uses an active infrared sensor transmit/receive design. The infrared detection device is installed in the detection and control area. When no one enters the detection area, the receiver tube outputs no signal. Conversely, when someone enters, the receiver tube outputs a signal, which is demodulated, amplified, and compared to generate a TTL high-level signal, which is then sent to the microcontroller. Microcontroller programming technology is used to control voice alerts or the operation of field equipment. Due to its strong anti-interference capability, lack of address concept in communication and unlimited number of nodes, the CAN bus has been widely used in automobiles, CNC machine tools, instruments and meters, fieldbus control and other fields[2]. This system uses a single-chip microcomputer to control the CAN bus controller to form a CAN bus for data transmission. In this way, multiple detection devices form a bus communication system, which facilitates the display of multi-area detection control status. It reduces the system's losses in materials, installation and maintenance costs and reduces wiring complexity. The distributed safety detection system is mainly composed of DC power supply, signal detection circuit, signal processing circuit, single-chip microcomputer controller, interface circuit, watchdog, CAN bus controller, CAN bus transceiver, status indicator panel and other circuits. The system composition block diagram is shown in Figure 1. Figure 1 System hardware structure block diagram 3. System design 3.1 Signal generation circuit The system signal generation circuit uses CD4069 with external resistors and capacitors to form a charging and discharging path to generate square wave pulse signals. The circuit oscillation is achieved through the charging and discharging of capacitor C using the positive feedback principle. R2 in the circuit is a compensation resistor used to improve the oscillation frequency instability caused by power supply voltage changes. Since CD4069 is a hex inverter, the input terminals of the remaining parts are grounded to avoid interference. The circuit principle is shown in Figure 2. The resistance value of R2 in the signal generation circuit not only affects the oscillation frequency but also changes the duty cycle of the output waveform. This is because the fluctuation of VT is eliminated, enabling the output of a square wave with a 1/2 duty cycle. Usually, R1 >> R2, and R1 = 10R2 is generally chosen. 3.2 Transmitting Circuit System The signal transmitting circuit consists of transistors V5 and V6 forming a signal power amplifier circuit. A square wave signal with a smaller duty cycle is obtained to drive the infrared emitting diode. The infrared emitting diode is current-driven, operating at a high level and cut off at a low level. This keeps the infrared emitting diode in a pulse state, extending its lifespan. The circuit principle is shown in Figure 3. Figure 3. Transmitting Circuit. To prevent dust, flying insects, etc., from blocking the infrared beam and triggering the alarm, this circuit uses a dual-beam warning line. An alarm is triggered only when both beams are blocked simultaneously; blocking only one beam does not trigger an alarm. The interval between the two beams is adjustable; adjust the spacing appropriately according to the actual situation during installation. Furthermore, multiple sets of detectors can be installed to form an infrared barrier depending on the size of the detection area. This ensures that at least two beams are blocked only when people or other objects pass through, preventing false alarms. 3.3 Receiving Circuit. When there are no obstructions in the detection area, the pulse light emitted by the infrared transmitter is received unobstructed by the receiver, generating a negative photosensitive voltage in capacitor C3. No signal passes through capacitor C2. When an obstruction enters the detection area, the signal passes through capacitor C2 and is output to the signal processing unit. The electrical signal output by the receiver is very weak, therefore the electrical signal passing through capacitor C2 is very small and needs to be amplified before being transmitted to the next stage. The circuit principle is shown in Figure 4. Figure 4 shows the infrared receiving circuit. To meet the device's operational requirements, an infrared filter is installed at the front end of the receiving tube to remove visible light, maximizing the light-receiving area of ​​the infrared receiving tube and improving system accuracy. 3.4 The processing circuit system uses the low-power, high-gain, internally frequency-compensated quad operational amplifier integrated chip LM324. When no obstruction enters the detection area, only a DC signal is present in the circuit, which cannot pass through capacitor C8. When an obstruction enters the detection area, the output of the receiving circuit abruptly changes to an electrical signal, which is transmitted to the subsequent circuit through capacitor C8. After primary amplification by transistor Q6, it is sent to the amplifier circuit composed of LM324 for secondary amplification. Because the demodulated square wave and the infrared emitting tube operate synchronously in time, and the electronic switch is only turned on when the infrared emitting tube is working, only the light signal from the infrared emitting tube is received, while stray light is blocked. The square wave signal from the electronic switch is filtered and smoothed by a resistor-capacitor network, leaving a DC component. Thus, the light-blocking area signal of the obstruction is reconstructed: a larger light-blocking area results in a larger DC component, and vice versa. The processed electrical signal is then sent to the microcontroller. The circuit principle is shown in Figure 5. Figure 5 Signal Processing Circuit 3.5 CAN Bus Node Circuit The bus communication interface uses the Philips SJA1000 CAN bus controller and the 82C250 bus transceiver, primarily because the SJA1000 supports both CAN2.0A and CAN2.0B protocols, with a communication rate of up to 1Mbps. The microcontroller is responsible for both initializing the SJA1000 bus controller and controlling data reception and transmission. The circuit principle is shown in Figure 6. Figure 6 CAN Bus Node Circuit Furthermore, the 82C250 interface with the CAN bus incorporates certain safety and anti-interference measures. To enhance the anti-interference capability of CAN bus nodes, the TX0 and RX0 of the CAN controller SJA1000 are not directly connected to the TXD and RXD of the CAN transceiver 82C250. Instead, they are connected to the 6N137 high-speed opto-isolator to achieve electrical isolation between the nodes on the bus [3]. The CANH and CANL pins of the 82C250 are connected to the CAN bus through resistors to protect the 82C250 from overcurrent. Two capacitors are connected in parallel between CANH and CANL and ground to filter out high-frequency interference and prevent electromagnetic radiation. 3.6 Detection System Design Figure 7 Schematic diagram of CAN bus detection system Due to the long transmission distance, fast transmission rate and strong anti-electromagnetic interference capability of CAN bus, it has become one of the most widely used fieldbuses in the world and has become an international standard (ISO-11898) [4]. This design connects various detection and control devices, control nodes, etc. through the bus to form a CAN bus communication system to facilitate intelligent distributed real-time detection and control. It has a very broad application prospect in the field of control systems. The composition principle of this system is shown in Figure 7. Furthermore, centralized management of all detection and control devices can be achieved through connections with a host computer and host nodes. Simultaneously, operating mode control information is transmitted to the controller, allowing for convenient control of the detection and control devices within the designated area via a PC. The program can be modified to expand system functionality based on actual conditions. 4. Conclusion The distributed safety detection and control system is simple in design, easy to install, stable in performance, reliable in operation, and highly practical. The system expands the area control range through interconnection between different devices. This system can be used in processing fields such as machinery, textiles, and food, effectively preventing accidental entry or misoperation by personnel on the production site, thereby effectively ensuring normal production and improving product quality. Through system function expansion, other industrial controls can be implemented, demonstrating broad application prospects. References: [1] Zhang Jinhong, Shen Tianjian, et al. Distributed fire alarm control system based on CAN bus [J]. Microcomputer Information. Vol. 16, No. 6, 2000, 26-27. [2] Hu Guangyong. Design and implementation of CAN bus node circuit [J]. Microcomputer Information. Vol. 22, No. 1-2, 2002, 1-2. [3] Ji Xiaojun, Wang Dongxing. Research on intelligent feeder terminal based on CAN bus [J]. Microcomputer Information. Vol. 22, No. 2-2, 2003, 112-113. [4] Rao Yuntao, Zou Jijun, Zheng Yongyun. Fieldbus CAN Principle and Application Technology [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2003, 11-85.
Read next

CATDOLL 115CM Mimi TPE

Height: 115cm Weight: 19.5kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22