Design of indoor intelligent lighting system based on ZigBee and STM32

Publisher:心若澄明Latest update time:2015-03-14 Keywords:ZigBee Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
In people's traditional consciousness, lighting systems are only for lighting purposes. The main control methods in traditional lighting systems are manual control and automatic control. Among them, the manual control method is simple and effective, but it is too dependent on manual operation, and the control is relatively decentralized and cannot be effectively managed; the automatic control method mainly uses clock elements, photoelectric elements or a combination of the two to control lighting equipment. This control method reduces the dependence on personnel and management is relatively simple.

For centralization, the automation of lighting control is realized, but the dimming control of the lighting system cannot be performed.

In addition, with the continuous improvement of living standards, people's demand for wireless, networked, intelligent and energy-saving daily life is becoming stronger and stronger. The above two traditional lighting control systems can no longer meet people's demand for daily life quality. Based on the above reasons, a design of indoor intelligent lighting system based on ZigBee and STM32 is proposed.

1 Overall system design

This system is mainly composed of terminal nodes, router nodes and coordinator nodes. The three nodes have their own responsibilities. The terminal node is mainly responsible for the transmission of messages and allows other nodes to access the network through it; the coordinator node is mainly responsible for the establishment, maintenance and management of the network, as well as the collection, processing and display of the entire network data information. Among the three nodes, the coordinator node is the core of the entire network. The overall design block diagram of the system is shown in Figure 1.

Design of indoor intelligent lighting system based on ZigBee and STM32

The main functions of this design are as follows:

(1) Use LED lamps with dimming modules, which can automatically adjust the light brightness through program control, and use the mutual compensation between indoor lights and natural light to keep the indoor illumination at an appropriate state;

(2) Using illumination collection nodes, indoor illumination can be collected and monitored in real time;

(3) Add power-off self-locking function (all lamps will be turned off when power comes back on in case of a sudden power outage);

(4) Add some scene modes, which can easily select the lighting environment when different indoor environments are needed (such as theater mode when watching TV with the family, study mode when reading and writing, etc.).

In addition to the above main functions, this design also reserves some peripheral interface circuits, and some corresponding sensors can be added to achieve more functions (such as adding gas sensors to prevent kitchen gas leaks, adding smoke sensors to prevent fires, etc.)

2 System Hardware Circuit Design

The system hardware circuit mainly consists of four parts: coordinator node circuit, system illumination acquisition node circuit, system LED dimming node circuit and system router node circuit.

2.1 System illumination node circuit design

The illumination acquisition node is composed of CC2530 and light illumination sensor (BH1750FVI). This node mainly collects indoor illumination in real time and sends it to the coordinator through the ZigBee module. The coordinator then integrates and processes the received illumination information, and then displays the indoor illumination information on the LCD in real time. According to the illumination information, it sends corresponding instructions to the LED lighting node to adjust the brightness of the LED light accordingly.

The BH1750FVI sensor is a photoelectric integrated sensor with the following main features: 1) It can output digital values ​​corresponding to brightness; 2) A wide input light range (equivalent to 1-65535lx); 3) Low current is achieved by reducing the power function; 4) No other peripheral components are required; 5) Weak dependence on light sources (incandescent lamps, fluorescent lamps, halogen lamps, white light LEDs, fluorescent lamps).

The hardware circuit diagram of the illumination node is shown in Figure 2.

Design of indoor intelligent lighting system based on ZigBee and STM32

2.2 System LED dimming node circuit design

The LED dimming node consists of CC2530 and a dimming module. The dimming module can adjust the brightness of the LED light in real time according to the instructions received by the ZigBee module. The purpose of dimming is to make the indoor natural light and LED light compensate each other so that the indoor illumination reaches a suitable state.

The dimming module of this node uses the LED constant current drive PWM dimming module. The hardware circuit diagram design of the LED dimming node is shown in Figure 3.

Design of indoor intelligent lighting system based on ZigBee and STM32

2.3 System Router Node Circuit Design

The router node is a CC2591 module extended on the CC2530 module. This module is a truly well-designed wireless transceiver module with PA+LNA. This node is mainly responsible for receiving terminal node information and forwarding it to the coordinator, or forwarding the coordinator's feedback information to the terminal node.

In an open field, the transmission distance of CC2530 can reach 100m, but in an indoor environment, due to the obstruction of walls, there is a path loss problem, and the actual transmission distance is greatly shortened. If only a routing node composed of CC2530 is placed in the middle of the room, it is likely to cause data transmission errors or even data loss. Therefore, when actually designing the circuit, the router node adopts the combination of CC2591+CC2530. CC2591 is a 2.4GHz RF front-end chip, which can increase the transmission power through PA, thereby extending the communication distance. The chip can also improve the sensitivity of the receiver through LNA. The above two points can well ensure the integrity of the data transmission of the system. The CC2591+CC2530 hardware circuit is shown in Figure 4.

Design of indoor intelligent lighting system based on ZigBee and STM32

2.4 System Coordinator Node Circuit Design

The coordinator node is composed of STM32F107, CC2530, 12864LCD, matrix keyboard, DS18B20 and DS1302 modules. This node is the core of the entire system, mainly responsible for the establishment and maintenance of the network, the addition and deletion of control terminal nodes, and the processing and display of the entire system information. Among them, STM32F107 is a new STM32 interconnected microcontroller launched by STMicroelectronics. This chip integrates various high-performance industrial standard interfaces, and different models of STM32 products have perfect compatibility in pins and software, which can adapt to a variety of applications. In addition, the chip can also be embedded in the μC/GUI system, has an independent 32-bit instruction bus and data bus, and fully supports 32-bit Thumb-2 and 16-bit Thumb instructions.

The matrix keyboard circuit uses a 2×4 matrix keyboard for clock time adjustment and selection of different scenario modes; the display circuit uses a 12864 LCD, which can display 4 lines of information, with 16 characters per line, fully meeting the requirements of displaying illumination, time and temperature.

The schematic diagram of the hardware circuit of the coordinator node is shown in Figure 5.

Design of indoor intelligent lighting system based on ZigBee and STM32

3 Software design

The software part is mainly responsible for programming the hardware circuit of the entire system. The terminal node program mainly completes the collection, upload and control of information. The coordinator node program is used to realize the establishment, maintenance and management of the entire network, as well as the collection, processing and display of corresponding data. 3.1 Coordinator node software design

The coordinator node first determines whether there is data transmission. If so, it selects a channel to establish a network, scans and reads data, and packages and sends data. Since power consumption is mainly concentrated in the wireless data transmission and reception stage, it is placed in a sleep state before receiving a wake-up command from a clock signal, in order to extend the battery life and reduce power consumption. The program flow chart is shown in Figure 6.

Design of indoor intelligent lighting system based on ZigBee and STM32

3.2 Terminal Node Software Design

The software design of terminal node data collection includes two parts, namely, the single-chip CC2530 driver design and the sensor data transmission and reception program design. First, the module is initialized, and then the timer is started. The channel is scanned at regular intervals to see if there is a network application instruction. If so, first determine which sensor port to start, and then send a data collection request to the port. After the collection is completed, the single-chip microcomputer is put into sleep mode, and the collected data is sent to CC2530 for further processing. The program flow chart is shown in Figure 7.

Design of indoor intelligent lighting system based on ZigBee and STM32

3.3 Router Node Software Design

In the program, the device type is set as a network routing node. In the ZigBee protocol stack, you only need to change the application layer event processing function so that it calls the program to send the received information after receiving it.

4 System Debugging

In order to test the function of the system, the dormitory was selected as the experimental site. Three lighting nodes and one illumination acquisition node were placed in each of the three bedrooms of the dormitory, and then the function of the system was tested. Through the test, the system can accurately realize the wireless control function. The illumination node can accurately collect the light illumination information of the environment, the ZigBee module can normally transmit data to each other, and the PWM dimmer module can accurately adjust the brightness of the LED lights. In addition, various scene modes, such as indoor temperature and clock information, can work normally according to the predetermined indicators.

5 Conclusion

This wireless intelligent lighting system can not only be used for fully automatic control of indoor lighting, but also can be adjusted manually according to different needs, which can save energy and make the indoor illumination reach the best state suitable for human activities. This system has the characteristics of small size, low power consumption, strong function and flexible expansion. In addition, this system can be used not only in home but also in various occasions such as school classrooms, company office areas, conference rooms and KTV. It only needs to adjust the corresponding modules and programs when using it. This system has broad application prospects in the field of intelligent lighting control.

Keywords:ZigBee Reference address:Design of indoor intelligent lighting system based on ZigBee and STM32

Previous article:Discussion on circuit design issues related to LED lightning protection
Next article:Design and implementation of solar LED street lamp based on 51

Latest Power Management Articles
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号