Design of video intercom system based on single chip microcomputer and Lonworks

Publisher:technology1Latest update time:2010-01-09 Source: 安防科技Keywords:Lonworks Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
With the emergence of intelligent residential areas, traditional doorbells are no longer suitable for modern families. People hope to understand the situation of visitors in a new way, while ensuring their own safety and reducing unnecessary troubles. Therefore, various doorbells have quietly entered thousands of households.

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.

Keywords:Lonworks Reference address:Design of video intercom system based on single chip microcomputer and Lonworks

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

Application of LonWorks Fieldbus Technology in Train Monitoring System
1. Introduction With the continuous development of science and technology and its wide application in various industries, more and more evidence proves that the unification of technical standards in a certain industry or a wider field is becoming more and more important, and has become an extremely importan
[Security Electronics]
Application of LonWorks Fieldbus Technology in Train Monitoring System
In-system programming technology based on LonWorks
introduction 在系统编程ISP(In System Programming)是指在用户设计的目标系统或印刷电路板上为重新配置逻辑,或实现新的功能而对器件进行编程或反复编程。 随着EDA工具的普及和ISP器件的日益成熟,ISP技术也得到了越来越广泛的应用。ISP技术的应用使得硬件设计软件化,其显著优势体现在:简化生产流程;利用同一硬件结构实现多种系统功能,使之成多功能硬件;在不特殊电路板资源的情况下进行电路板级测试;边界扫描测试;通过Modem和ISP编程接口实现对系统的远程维护和升级。 对ISP器件的编程可通过PC机进行,利用1条编程电路(或称下载电缆)将准确定时的编程信号提供
[Industrial Control]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号