From simple door-calling tools to multifunctional and integrated electrical appliances, users' standards are getting higher and higher. Intercom systems have become an important guarantee for modern multifunctional and efficient modern residences. The building intercom system that emerged with it has also been constantly updated with the construction and development of urban residential communities. From the initial ordinary unit door intercom to visual unit door intercom, and then to network management, the intelligent building intercom system has become a comprehensive system with strong compatibility. It can be said that the intelligent building intercom system is not only a convenient electric door system for residents and visitors, but also an indispensable and effective means of community property management and security management, and an indispensable facility for modern residential communities.
1 Lonworks Bus Technology
Most general video intercom systems are composed of single-chip microcomputers and RS-485 buses. Although the cost is low, they are limited by the RS-485 bus. Without a relay, the communication distance cannot be too far and the communication rate cannot be too high. The use of relays will increase the cost and increase the difficulty of design, development, construction and maintenance. If a simple Lonworks bus is used, the network's compatibility with other bus devices will be reduced, increasing development costs and design difficulties. The author uses video intercom technology based on single-chip microcomputers and Lonworks, which can not only overcome the above shortcomings, but also better play the advantages of both. The entire system consists of a door unit host and an indoor video extension, which are regarded as different communication nodes on the network. In ordinary communication networks, the protocols used for node-to-node access are different, but for the communication of devices in the Lonworks network, only a network standard language called LonTalk is needed. The LonTalk protocol consists of various underlying protocols that allow different devices on the network to communicate intelligently with each other.
The LonTalk protocol, also known as the ANSI/EIA709.1 control network standard, provides a series of communication services that enable applications in devices to send and receive messages with other devices on the network without knowing the network topology or the network name, address, or functions of other devices. The LonTalk protocol can selectively provide end-to-end message confirmation, message confirmation, and priority sending to provide a specified limited number of transaction processing times. Support for network management services enables remote network management tools to interact with other devices through the network, including reconfiguration of network addresses and parameters, downloading applications, reporting network problems, and starting/stopping/resetting device applications. The Lonworks system can communicate on any physical medium, including power lines, twisted pair, wireless (RF), infrared (IR), coaxial cable, and optical fiber.
At the same time, LonTalk supports hardware collision detection on the communication medium. LonTalk can automatically cancel the message that is colliding and resend it. If there is no collision detection, when a collision occurs, the message will be resent only when a response or reply is received. Lonworks uses the priority band prediction p-persistent CSMA algorithm to implement collision detection. Experiments show that when 36 nodes are interconnected and the ordinary p-persistent algorithm is used, when the message to be transmitted per second reaches 500 to 1,000 packets, the collision rate increases from 10% to 54%; while the predicted p-persistent CSMA algorithm has a very low collision rate when the number of packets is less than 500, and the collision rate is stable at 10% when the number of packets is 500 to 1,000. In the MAC layer of the network, in order to improve the response time of emergency events, an optional priority mechanism must be provided to allow users to assign a specific priority time slice (priority slot) to each node that needs priority. During the transmission process, the priority data message will be sent within the time slice. The priority time slice can be divided into any registration between 0 and 127, and the low-priority nodes need to wait for a longer time. This time slice is added before the p-probability time slice (that is, before the random waiting time of the node). Non-priority nodes must wait until the priority time slice is completed and then wait for the P-probability time slice to send. In this way, the nodes added with priority have a faster response time, thereby improving the utilization of the network.
In the design of smart communities, the use of the Lonworks bus can integrate numerous control lines and communication lines onto cheap twisted pair cables, which not only saves development and construction costs, but also facilitates network planning and management.
2 System structure design
For the entire campus, a star-shaped hierarchical network is used; for larger cell communication systems, a domain management method can be used. The campus network structure is shown in Figure 1.
Figure 1 Campus network structure diagram
All nodes are composed of AT89S52 single-chip microcomputer system and neuron chip TMPN3150B1AF as core modules, plus FTT-10A transceiver and corresponding peripheral circuits. Neuron chip has 11 I/O ports, and 34 different interfaces can be flexibly configured by software. The strong real-time control capability of single-chip microcomputer ensures the real-time transmission of data. The whole system is composed of multiple sub-networks, and sub-networks are expanded through Lonworks routers. Each node communicates through the Lonworks bus, and is connected to each other by twisted pair cables. The communication rate is 78 kb/s. The video and audio analog signals of the video intercom system are transmitted through the video and audio bus. The scheme adopts a 2-level bus design to realize the function of multiple calls in the same system at the same time. At the same time, a network data manager and a data server are set up to realize the information sharing between the real-time control network and the computer network.
3 Node Hardware Design
The node hardware design is realized through the joint control of single chip microcomputer and Lonworks. The node hardware schematic diagram is shown in Figure 2.
Figure 2 Node hardware schematic
(1) CPU. The CPU of the node uses industrial-grade AT89S52 and TMPN3150B1AF of Neuron Chip family. The 3150 chip does not have program storage space, so it needs to be connected to external RAM to store system images including LonTalk protocol, Neuron C library functions and task scheduler, and application images including user application code generated by Neuron C compiler and other specific application parameters. The 3150 chip has 11 application I/O pins, which can be configured in various ways and provide flexible I/O functions with minimal external expansion circuits. It can be set to 34 optional working modes through software. In this system, it is set to mode 2, that is, bit output, to control the video and audio switch composed of relays.
(2) Transceiver: Echelon's FTT-10A is selected, with a communication rate of 78 kb/s, transformer isolation coupling and a Manchester encoder, supporting a variety of network topologies.
(3) Program memory: Winbond's W27C512-45 can be used to directly download application images using LonMaker, and its large capacity also facilitates future function expansion.
By combining the single-chip microcomputer with Lonworks technology, it is not only compatible with traditional indoor monitoring equipment, but also improves the communication efficiency and transmission rate of the network, simplifies the entire system, reduces the possibility of hardware errors, improves the reliability of the system, and greatly reduces the workload of hardware design.
In terms of workflow, on the one hand, when abnormal situations occur indoors, such as smoke exceeding normal concentrations and doors and windows being opened abnormally, the corresponding monitoring signals collected by the monitoring equipment will be sent to the indoor visual extension, and after being judged and processed by the 51 chip, sent to the neuron chip, sent to the Lonworks network through the transceiver, and transmitted to the management center for corresponding display and alarm, so as to facilitate the community management personnel to take corresponding countermeasures in time; on the other hand, if a visitor sends a request to the indoor through the unit host, the CCD camera on the host is activated, and the corresponding video switching relay is energized, and the visitor image is transmitted to the display of the indoor visual extension in real time, which is convenient for the household owner to identify. When the household owner opens the electromagnetic lock connected to the host at the door, the video connection is cut off, and the line resources are released for other visitors to use.
4 Node Software Design
4.1 Lonworks Part
The programming language of Neuron chip is Neuron C, which is derived from ANSI C and has been deleted and supplemented. For example, Neuron C drives the execution of tasks by the occurrence of events; Neuron chip provides two types of software timers: milliseconds and seconds.
The main program flow is shown in Figure 3. Its main tasks are as follows: first, define the I/O object and software timer and set the initial value of the variable, determine whether there is an "unlock" signal, and start the timer to start timing. When the timer expires, the Neuron chip accepts a new timing task.
Figure 3 Main program flow chart
The neuron chip is the core of Lonworks technology. It is a single-chip system with multiple processors, read-write/read-only memory (RAM/ROM), and communication and I/O interfaces. The read-only memory contains an operating system, LonTalk protocol, and I/O function library. Neuron C is a programming language based on ANSI C and designed for neuron chips. It extends ANSI C to directly support firmware routines of Neuron chips. Neuron C language includes an internal multi-tasking scheduler, a Run-Time function library, and adopts an event-driven programming structure. The software functions of the entire node are completed by several event drivers.
For a single node, software design includes tasks such as initialization, reading input data, updating network variables, timing control, and performing output control operations.
For the campus network, the bus control is handed over to the management center. If other nodes need to occupy the bus, they need to send a request to the management center and wait for the management center to send a request response command. When the node bus access program is completed, the management center will issue a bus release command to terminate the node's occupation of the bus to facilitate other nodes' access to the bus.
4.2 MCU Part
The CPU of the microcontroller uses the industrial-grade AT89S52 chip produced by ATMEL. This chip is the industrial version of AT89C51, which has the characteristics of strong anti-interference ability and low price. The basic functions that the microcontroller system software needs to implement are as follows:
(1) Standby function. Normally (when there is no control operation), the indoor video extension and the unit host are in standby mode, and the power of the RF module, the unit host camera and the indoor video extension display screen are all turned off.
(2) Monitoring signal acquisition function. The indoor visual extension is not only a node connecting the unit host, but also the center for signal acquisition at each monitoring point indoors. When door magnets, window magnets, indoor infrared, smoke sensors, and emergency signals are sent, they will first be sent to the indoor visual extension, where they will be judged and preliminarily processed by the AT89S52, and then transferred to the TMPN3150B1AF chip to be sent to the Lonworks communication network and transmitted to the management center for display and processing.
(3) Unlocking function. Through the indoor visual extension, the electromagnetic lock installed on the unit door and connected to the unit host can be controlled to open. The control software is written in assembly language and is divided into two parts: the indoor visual extension and the unit host. It consists of processing and switching of different system states.
5 Conclusion
The use of a visual monitoring system based on single-chip microcomputer and Lonworks technology not only eliminates the need to design dedicated monitoring equipment for the Lonworks network, but also improves the utilization rate of the communication network, simplifies network design, reduces development and production costs, and makes visual monitoring more user-friendly.
Previous article:Automatic parking fee management system based on single chip microcomputer control
Next article:Brushless DC fan motor 180 degree sine wave control
Recommended ReadingLatest update time:2024-11-16 19:57
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- ST's sensors can be purchased at the STM32 Tmall official flagship store
- "Dating in Spring" + "Just Strolling"
- How to build a Keil project using the LPC8xx ROM?
- C2000 CLA FAQ: Architecture and Configuration
- New infrared temperature measurement thermal imager is coming! AutoNavi holds a press conference in Beijing!
- Divide an assembly file into several assembly files. Compile prompt variable is not defined
- RF amplifier performance test
- What kind of feedback is introduced in the following circuit?
- What is the significance of connecting two capacitors in series?
- Storage time of different surface treatment processes for circuit boards