- Home >> News >> Blog articles >> Internet of things
Zigbee Technology LED Controller Design
At present, my country is vigorously promoting the policy of replacing incandescent lamps with LED lamps, and it will be implemented within five years. This policy solves the problems of serious lighting power consumption and short service life. Problems such as high consumption, long construction period, and difficult post-maintenance still need to be solved. The wide application of Zigbee technology provides a solution to the current problems, and it is convenient and fast for family life and office buildings. Comprehensive management personnel to achieve efficient and safe purposes. This paper proposes a design scheme combining Zigbee wireless ad-hoc network technology and LED energy-saving lamps to realize the functions of continuous adjustment and remote control of the brightness of LED lamps, and introduces the software and hardware design system in detail.
1. Zigbee wireless technology
Zigbee technology is a wireless communication technology applied to various electronic devices within a short distance and at a low transmission data rate. It is developed based on a set of 802.15.4 wireless standards approved by IEEE, which determines that it can An application profile shared between different manufacturers. Zigbee-compatible products work in 2.4 GHz, a free and open frequency band common to the world. This frequency band provides 16 transmission channels, and each communication will independently select the cleanest channel with the least interference for data transmission. In terms of the network layer, star and mesh topologies can be used. According to the different functions of the nodes, they can be divided into the central coordinator Coordinator, the routing node Router and the terminal node FFD. In these three topological structures, it is not easy to realize the advanced characteristic function of Zigbee in the star network, that is, the routing function, and each Zigbee device can only communicate directly with PANC. The mesh network is the most complex, allowing routing, and the routing path is the best path automatically calculated, and after the network is established, if any device fails, the device in the network will recalculate the routing path so that it does not affect other network The device communicates normally. So this system uses a tree network structure, which is simple and easy to implement.
1.1 Advantages and characteristics of Zigbee
1) Low power consumption is the most advantageous place of Zigbee technology. In the communication state, the Zigbee terminal consumes about tens of milliwatts of power. In the power saving mode, the power consumption is only tens of μW, and a dry battery can work for nearly a year. 2) Reliability: The collision avoidance mechanism is adopted, and a dedicated time slot is reserved for communication services that require fixed bandwidth to avoid conflicts when sending data; the node modules have the function of automatic dynamic networking, and the transmitted information is distributed throughout the Zigbee The network is transmitted through automatic routing, thus ensuring the reliability of information transmission. 3) Large network capacity: On the same WPAN, there can be 65,536 ZigBee devices, which can transmit information through multiple hops, and have wireless network self-healing functions. 4) Large effective range: the effective range is between 10 and 75 m, if the preamplifier can reach the communication distance of 1 000 m. 5) Low cost: Zigbee data transmission rate is low, the protocol is simple and free of patent fees, so the cost is reduced.
1.2 Zigbee wireless networking principle
In the network layer, ZigBee defines three roles: the first is the central coordinator (Coordinator), responsible for establishing the network, and assigning the location of each node in the network; the second is the router (Router), mainly responsible for finding the network, establishing And repair the routing path of the data, and is responsible for forwarding the data, the router can communicate with the coordinator, can also communicate with the terminal node, and the routing can also communicate with each other; the third is the terminal node (FFD), you can only choose to join the existing The formed network can send and receive data information with the router, but cannot forward information, and does not have the routing function.
Working principle: Each terminal node or router in the system controls one lamp or multiple lamps respectively, and each node has a separate network address. The handheld control terminal sends commands to the coordinator through the wireless module, and the coordinator will receive the commands It is sent to each node through wireless transmission.
2. Hardware design of LED lamp controller
There are two ways to realize the dimming function: analog and pulse width modulation (PWM). When using analog dimming technology, the brightness of the screen can be reduced by 50% simply by reducing the current of the white LED to half of the maximum value. The disadvantage of this method is that the LED light color will move and an analog control signal is required, so this system uses PWM dimming technology. PWM dimming technology will provide full current to white LEDs, but will reduce the current load cycle to meet the dimming requirements. For example, to halve the brightness, only 50% of the load cycle needs to provide full current. The frequency of the PWM signal usually exceeds 100 Hz to ensure that the pulse current cannot be detected by the eyes. The maximum value of the PWM frequency depends on the start-up and response time of the power supply; in order to obtain maximum flexibility and make integration easier, the white LED driver A PWM frequency of up to 50 kHz should be acceptable.
The hardware system is composed of LED light driver module, LED power driver module and Zigbee wireless transmission module. The logical block diagram of the hardware circuit is shown in Figure 2. The LED lamp driving part adopts PT4207 driver chip. PT4207 is a high-voltage step-down LED driver control chip, which is used to drive one or more LED lights. Stable and reliable work within the range, and ensure the high performance of the system. At the same time, the built-in input voltage compensation function greatly improves the stability of LED current under different input voltages. PT4207 also has functions such as load short circuit protection, open circuit protection and over temperature protection. Its dedicated dimming pin can directly accept PWM pulse dimming, and add PWM signal to DIM pin. The low level of the PWM signal should be less than 0.35 V, and the high level should be between 2.5 and 5 V. In order to achieve a better dimming effect, the pulse frequency of the PWM signal should preferably be less than 1% of the minimum operating frequency.
The Zigbee wireless communication module mainly adopts CC2530. The CC2530 is a true System-on-Chip (SoC) solution for 2.4-GHz IEEE 802.15.4, ZigBee and RF4CE applications. It has extremely high receiving sensitivity and anti-interference performance, and can build a powerful network node with a very low total material cost. The CC2530 combines the excellent performance of a leading RF transceiver, an industry-standard enhanced 8051 CPU, in-system programmable flash memory, 8-KB RAM and many other powerful features. CC2530 has four different flash memory versions of 32/64/128/256KB, and this system uses 256KB flash memory. The CC2530 has different operating modes, making it especially suitable for systems requiring ultra-low power consumption, and the short transition time between operating modes further ensures low energy consumption.
This system changes the light brightness by changing the PWM output. Timer 1 of CC2530 is a 16-bit timer with timer/PWM function. It has a programmable frequency divider, a 16-bit period value, and five individually programmable counter/capture channels, each with a 16-bit compare value. A 16-bit capture register is also used to record the precise time when a start-of-frame delimiter is received/transmitted, or the precise time when the transmission ends, and a 16-bit output compare register can generate different strobe commands at specific times (start RX , start TX, etc.) to the wireless module. Each counter capture channel can be used as a PWM output or to capture the timing of input signal edges. Timer 2 is specially designed for protocols supporting IEEE802.15.4 MAC or other time slots in software. Timer 3 and Timer 4 are 8-bit timers with timer/counter/PWM functions.
3. Software design of LED light control system
The software development environment chooses IAR Embedded Workbench for MCS-51 7.51A as the IDE developed by Zigbee. On the basis of the TI Z Stack protocol stack, the application program code of the system is written, and the upper computer program is written with VC. Z Stack provides a rich debugging function debugging interface. System software mainly includes coordinator node program and router node program. The coordinator is the first-level node, responsible for building the network. After the network is set up, the node ID address will be assigned. The coordinator receives the command sent by the handheld control terminal, and sends the control command to the node to implement the corresponding control.
The following is extended to level 2, level 3 or even multiple levels. As long as the corresponding control can be implemented in the same network, the coordinator receives the command and sends the control command to the router or terminal node at the same time. If the command is sent directly to the router, the router will execute it. The corresponding command can also be sent to the terminal node through the router, and the terminal node executes the corresponding command.
The control terminal is a hand-held remote control. A wireless transceiver module is set in the remote control. When the network is established, the remote control is added to the network. The remote control will automatically identify the ID address of each node and realize control by sending commands to the node. It is possible to adjust the brightness of a single lamp, that is, to send a control command to a single node, or to form a local area network of some nodes and store it in the remote control, and to send commands to this local area network to realize the lighting control of all nodes in the local area network.
Summarize
The wireless control of lighting is realized through Zigbee technology, which solves the problems of complex wiring in the home intranet, poor scalability, high price, high power consumption, and blind spots in the communication range, and realizes wireless communication in family homes or offices. The system has the characteristics of low power consumption, low cost, convenient development, easy expansion, etc., and it is convenient for people to control it through a hand-held remote controller. Since the country vigorously promotes the use of LED energy-saving lighting, Zigbee wireless lighting control has a broad market, and can be further extended to smart homes for wireless control of household appliances, and even remote wireless control. Based on the various advantages of Zigbee technology, its development space in the Internet of Things will be very large, especially in school dormitories, teaching buildings, libraries or canteens.
The above is the development example of LED lighting controller introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. If you have LED lighting control program development needs, you can trust us. We represent a variety of single-chip microcomputers, voice chips, dual-mode Bluetooth ICs, and wifi chips. Brands include Songhan MCU, Yingguang MCU, Jerry Bluetooth, Ankai Bluetooth, Allwinner, and Realtek. Our technical services include: PCB design, microcontroller development, Bluetooth solutions, software and hardware custom development, APP development, small program development, WeChat official account development, etc. It can also undertake the design of intelligent electronic products, the development of living appliances, the research and development of beauty equipment, the application of Internet of things platform, the smart home control system, the development of TWS earphones, Bluetooth earphone speakers, the development of children's educational toys, the design of electronic education products, etc.
Proposal recommendation
- TOP