A low-power and low cost smart streetlight system based on Internet of Things technology

Street lighting, as the most essential and universal component of the urban lighting system, accounts for a large portion of public electricity usage. Therefore, improving street lamps working efficiency is vital for energy savings. This paper demonstrates the design of a smart street lighting system supported by the combination of NB-IoT and LoRa communication technology. By adopting an optimized street lamp control algorithm, the system can realize the automatic control of street lights according to the real-time traffic flow information. This system has been installed on Luyang Avenue, Lucheng City, Shanxi Province, China in May 2019. It managed to reduce the electricity consumption in this region significantly in June 2019, which was 18% lower than that in April 2019 and 19.7% lower than that in June 2018. By illustrating the unique advantages of this system in energy savings and cost reduction, this paper displays its potential for further application in the construction of smart cities on a large scale.

2004 to 2019.The long-term power supply required by street lamps results in about 35% of the electricity being dissipated every year [3].Therefore, in order to improve the energy utilization rate and reduce the waste of electricity in urban road lighting system, appropriate control methods must be taken to improve the work efficiency of street lamps and further promote the scientific management and green energy saving of urban lighting system [4].
Traditional street lamp control methods such as manual, induction, and timing control are low in intelligence and cannot meet the requires of modern urban construction.With the rapid development of communication and microelectronics technology, intelligent streetlight system with Internet of Things has gradually become the most potential research field [5][6][7][8][9][10], such as using wireless network technology like ZigBee to monitor the status of street lamps and to detect traffic flow and environment [11,12].
In terms of monitoring the working status of street lamps, Pilar Elejoste et al. [13] proposed a street lamp control system based on wireless communication in 2013, which could detect the flow of vehicle and the running condition of the street lamps.Fabio Leccese et al. [14,15] designed a street lighting system, which obtained with ZigBee to collect the parameter information of street lamps and verify the working state of the street lamps.Ulteriority, a traffic-aware street lighting scheme was proposed, which dynanically adjusted light brightness through detecting the presence of vehicles [16].In 2016, Francisco José et al. [17] proposed an intelligent street lamp management system based on wireless communication and DALI protocol, which could not only realize real-time monitoring of running state of the street lamps, but also developed a mobile device information and fault location application program SCADA.In terms of road environmental perception, Philip Tobianto Daely et al. [18] designed an intelligent streetlight system on account of Web integrated management in 2017, using intelligent LED street lamps with weather-sensing function.However, its complex system design and man-sized hardware circuit implementation made it not suitable for large-scale application.
In other aspects of street lamp control, many scholars have made great achievements in some research directions such as artificial intelligence, big data model optimization.Among them, as a new algorithm, Artificial Neural Network (ANN) is one of the heat spots of many scholars [19,20].Based on the analysis of the existing control methods of street lighting, the idea of "energy on demand" on account of ANN modeling method was put forward by S.Pizzuti et al. [21] in 2013.Soleda Decolar [22] proposed an intelligent streetlight control system in 2014, which based on adaptive behavior rules.The control equipment on the street lamp post could dynamically adapt to the presence of pedestrians and vehicles around it.Ulteriorly, Juan F. De Paz et al. [23] proposed an intelligent urban lighting control system in 2016, which integrated advanced technologies such as ANN, Expectation Maximization (EM) algorithm.In 2019, Prabu Mohandas et al. [24] also proposed an energy-saving intelligent street light system based on ANN, which reduced the power dissipation by 13.5%.Besides, [25] and [26] further used WSN technology to obtain road environment parameters.The algorithm implementation of the intelligent streetlight control system based on artificial intelligence technology is relatively complex, and the requirements for hardware circuit components are relatively high, which makes it not easy to large-scale field applications.
At present, although the pilot project of the intelligent street lamp has been established in some Chinese cities , it has not yet formed a scale and the most street lamp control strategies do not incorporate real-time traffic flow information [27].Therefore, on the basis of analyzing the existing technology, an intelligent streetlight system with low power consumption and low construction cost is designed in this paper.The proposed system adopted low-power hardware circuit components and communication technology and combined with a streamlined street lamp control strategy, which could intelligently adjust the lighting time of the street lamp according to the traffic flow.At the same time, the cloud server side could monitor the working state of street lamps in real time through Narrow Band Internet of Things (NB-IoT) so as to facilitate the timely handling of street lamps when they work failed, which realizes the intelligent management of urban streetlight under the premise of energy saving and environment protection.By analyzing the use of electricity consumption of the application area before and after the usage of proposed system, it has greatly improved the energy-saving effect of street lamps, where the electricity consumption in June 2019 was 18% lower than that in April 2019 and 19.7% lower than that in June 2018.
The rest of the paper is structured as follows.The overall structure design of the intelligent streetlight system and the functions of each module are introduced in Sect.2, the hardware circuit design of the motion detector unit and streetlight controller are briefly discussed in Sect.3, and Sect. 4 depicts the software design of the system.The practice application effect and analysis of this system are illustrated in Sect.5, and the conclusion is summarized in Sect.6.

The overall architecture of the system
The intelligent street light system proposed in this paper combines the real-time vehicle information to carry out intelligent control of street light, ensuring the safety of travel while achieving the effect of energy saving.
Figure 1 shows the system structure, mainly composed of the set of lighting facilities, Streetlight Controllers (SLC), Motion Detector Units (MDU) and Cloud Server.
MDU monitors the traffic flow information based on the principle of Doppler velocimetry and combines the optimized streetlight control algorithm to calculate the street lamp controlling command.
MDU and SLC are the control core of the smart streetlight system, which communicate through the LoRa network.According to the requirements of the system for streetlight control, LoRa communication mode and civil band are selected to apply the characteristics of customization to streetlight control.
(1)Frequency point can be set: Multiple street lamps controlled by the same MDU can choose the same frequency point, and different frequency points can be selected for the MDU with a close distance, which can achieve the goal of complete delivery communication and avoid communication interference.
(2)Address can be set: Multiple street lights under the same MDU can choose different communication addresses.Through the difference of address, the MDU can continuously transmit different signals to multiple SLCs, and send the speed and time of lighting street lamps to the SLC respectively, so as to realize the control effect of the car to light up and the car to go off.The spacing between each street lamp is approximately 50 meters.According to the data transmission distance of LoRa communication, a MDU can communicate with about ten street lamps.The SLC receives the control demand which sent by MDU through LoRa network to executes the corresponding command to realize the control of the street lamps on and off.
Besides, the design goal of urban road building is to provide safe and stable street light control for our daily travel without human intervention.And for the proper operation of the system, the interaction between the system and human users is necessary.Therefore, the system uses NB-IoT to communicate with MDU.By designing intelligent street light cloud server software, some performance parameters of MDU are set and debug during installation, as well as monitoring whether MDU works normally and whether the voltage and current of street lamps are normal.In addition, the cloud server contains the dispatch module, when any exception is detected in the system, the damage information will be printed to the maintenance workers, so as to realize the effective management of the street lamps.
3 Hardware circuit design of the smart streetlight system

Principle of Doppler velocity measurement
The Doppler effect of electromagnetic wave points out that when the object and the electromagnetic wave source are in relative motion, the reflected electromagnetic wave frequency f r will change.The change between f r and the emitted wave frequency f s is the Doppler frequency f d .
When the target object is moving toward the emission source, due to the Doppler effect, the frequency of the electromagnetic wave signal returned from the target will be higher than the frequency of the emission signal.The calculation formula of Doppler frequency is as follows: where v is the velocity of moving object, c is the speed of light, and θ is the angle between the direction of movement of the object and the normal of the detection surface of the detector.It can be seen from the calculation formula that the Doppler frequency is proportional to the relative speed of the electromagnetic wave emitting source and the moving target.Therefore, when the Doppler frequency of the target is measured, the velocity of the target relative to the electromagnetic wave emission source can be obtained by using this calculation formula.

Dopplor Motion Detection Unit MDU6220
The X-band Doppler motion detector unit MDU6220 of SMS is used to detect the movement of vehicle.Figure 2 shows the structure of MDU6220.MDU6220 is an integrated microwave transmitter and receiver module.It contains a microwave transistor oscillator inside, which can provide a signal with stable frequency One signal is further filtered and fed into the transmitting antenna and the other signal is fed into the local oscillator input.When the transmitted signal encounters an object in the process of traveling, the signal reflected back will be collected by the receiving antenna and coupled with the Radio Frequency input of the balanced mixer.The coupled signal is compared with the transmitted signal to obtain the Doppler frequency, and the subsequent signal processing is performed on the Intermediate Frequency (IF) output of the module.It is worth noting that the balanced mixer configuration provides superior matching and lower conversion loss compared with single-ended mixers, which improves the sensitivity of MDU6220 and enhances its capture capability while reducing false detections.
The amplitude of the IF output signal is proportional to the volume of the measured object and its distance from the MDU6220, and the frequency is proportional to the speed of the detected target.In addition, the MDU6220 module can generate two orthogonal pulse signals to detect the direction of movement of the target object by detecting its forward or lag phase.By designing conditioning and screening circuits to process the IF output signal, the traveling direction and speed of the vehicles are judged, which lays the hardware foundation for the system software implementation.

Hardware circuit design of MDU
The hardware circuit design block diagram of the MDU is shown in Fig. 3.In order to reduce the power consumption of the MDU itself, the main control MCU adopts 32-bit chip STM32L151 based on the Cortex-M3 architecture of ST.The ultra-low power dissipation mode of the chip can achieve low depletion while also meeting the requires of design without reducing system performance.
The IF signal is counted by the MCU counter after low-pass filtering, programmable amplification and voltage discrimination.When the frequency of the measured signal is larger than the preset value, it is determined that a vehicle has entered the detection area.The vehicle information detected by MCU will generate streetlight control commands through an optimized streetlight algorithm.Then it is transmitted to the SLC through the LoRa network, which realizes the on and off control of the streetlight according to the received command.Moreover, the MDU is also equipped with NB-IoT module, through which the Cloud Server can monitor its working state.
The NB-IoT module here uses BC20 developed by Quectel, which has the characteristics of high performance and low power consumption, and supports China Mobile and other IoT platforms.The MQTT protocol is registered to the open cloud platform, and the data collected by MDU is transmitted to the Cloud Server.The stable data transfer process makes it convenient to use.
In addition, considering that other interference factors such as leaf fluttering caused by wind or running of small animals may lead to the misjudgment of MDU and lighting up street lamps, which will result in further power dissipation.The digital potentiometer and amplitude discrimination are used in the hardware circuit design to adjust the feedback resistance of the amplifier circuit to realize the programmable processing of the output signal of MDU.Only when the volume of the detected object is larger than a certain value can the counting system be triggered effectively.At the same time, the low-frequency disturbance is filtered through software, which avoids misjudgment caused by interference and makes the result more accurate.

Hardware circuit design of streetlight controller
The number of SLCs is much higher than that of MDU in practical applications.Therefore, the power consumption of the SLC itself has a great influence on the power consumption of the entire system.The MCU of the SLC uses STM32L151 microcontroller as well as MDU, which enables it to reduce power consumption while maintaining its processing speed.Figure 4 shows the hardware circuit design diagram of the Streetlight Controller.The command to control street lamps that the MDU transmits to the MCU of the SLC through LoRa module is the foundation to realize the control of street lamps.Besides, the SLC is equipped with sensors to detect the voltage and current of street lamp, which can be sent to MDU through the LoRa net, and then MDU upload to the Cloud side through NB-IoT network, so as to realize the real-time monitoring of the working state of the street lamps.

Communication between MDU and Streetlight Controller
The MDU and SLC are 50m to several kilometers apart in actual application.It would be complicated and expensive to use long distance wired connections.By comparing the wireless communication modes commonly used in streetlight control shown in Table 1, combined with the low-power design goal of the system, LoRa is selected to implement the communication between street lamps.
LoRa is a low-power Local Area Network (LAN) wireless communication technology introduced by Semtech in 2013.It can achieve the purpose of long-distance transmission under the condition of low power consumption, which make it wide use in many fields such as smart city, smart home and so on [28][29][30][31].
Therefore, the wireless serial port module E32(433T30S) from Chengdu YIBEST Electronic Technology Company is selected as the core part of LoRa communication in the system design.In addition to the realization of long-distance transmission under the condition of low power consumption, this part has strong anti-interference ability and suppression ability to the same frequency interference and various noises.At the same time, it can also realize the function of sending and receiving data by broadcasting.
As shown in the Fig. 5, one MDU and 1-n(n ≤ 10) SLCs constitute a Lora communication subsystem.The MDU and SLC communicate in Peer-to-Peer polling mode.The MDU is the master and the SLCs are the slave.The SLC under the control of the same MDU chooses the same frequency point and distinct communication address.Depending on this, the MDU can use the broadcast mode to send control demands to each Streetlight Controller through polling mode, so as to achieve the effect of turning on and off the street lamps in turn.The difference between this LoRa network and star topology is that the SLC does not actively transmit data to the MDU unless it receives control commands allowed by the MDU, which can effectively avoid data loss caused by multiple terminals simultaneously transmitting data to the master.

Communication between MDU and cloud server
NB-IoT is a low-power LAN based on authorized frequency band.It is widely used in smart cities, public utilities, logistics Fig. 5 The structure of communication network and other industries due to its excellent characteristics, such as wide coverage, low construction cost and no interference between equipment in the same base station [32].
Therefore, NB-IoT is adopted in this paper to implement the communication between Cloud Server and MDU.In order to ensure the accuracy of communication data transmission, each MDU and 1-10 SLCs constitute a LoRa communication subsystem.On urban roads without obstacles, the number of MDU-controlled SLCs can be appropriately increased to 15 or more.MDUs in different subsystems and Cloud Server form intelligent street light communication system through NB-IoT network.And China Mobile supports this NB-IoT system.On the one hand, it can monitor the working state of MDU to ensure the normal working of the whole system; on the other hand, the operating state of the street lamps can be uploaded to the Cloud Server by MDU through NB-IoT network.Once an error warning is found in the system, the fault information will be pushed to the maintenance workers via mobile phone, which can make sure they handle the abnormal street lamp in time.

Algorithm of street lamp controlling
As the core of system operation, the algorithm implementation of street lamp control is also the focus of system software design.Based on the effective detection distance of MDU to the vehicle, only the monitoring of one-way vehicles is considered in this system.The operation mode of the whole system is that the street lamps are not energized in the daytime.Light up half of the street lamps at night intervals while the other half are on or off depending on the traffic information of the road.This street light control mode is designed to save energy while preventing crime and ensuring travel safety.
Assuming that the irradiation distance of car headlights is d 0 , the irradiation range of each street lamp is d s , the distance between street lamps is d, and the length of the overlap area illuminated by two adjacent street lamps is d.When the farthest area illuminated by vehicle light reaches the repeat area between the steady street lamp n and the controlled street lamp n+1, the controlled street lamp n+1 turns on; When the farthest irradiation area of the vehicle light reaches the repeated irradiation area of the steady street lamp n+2 and the next controlled street lamp n+3, the controlled street lamp n+1 turns off.
Concrete streetlighting control algorithm for one Lora communication subsystem can be roughly divided into two situations to consider: when the moving object detection unit detects only one vehicle passing within a certain time (such as 30s) and when there are multiple vehicles passing at distinct speeds and distances.

Control of street lamps when there is only one car passing
As shown in Fig. 6, when the MDU detects only one vehicle passing by within 30s, the control demands are sent to the corresponding Streetlight Controller by LoRa to light the 1 − n street lamps after time v , where v is the speed of vehicle.Assuming that the speed of the vehicle is constant when passing the road section, the time interval T = 2d s − d v required for each Streetlight Controller from lighting to turning off the street lamp is also the same.

Control of street lamps with unequal speeds and distance of multiple vehicles
When more than one car entering at varying speeds and unequal distances in a short time is detected by the MDU, Fig. 7 shows the related algorithm flow.
When MDU detects that the first vehicle driving at speed v 1 , the time to sequentially turn on the 1 − n street lamps is set to , and all turn off after the time . When it is detected that the second vehicle is driving at speed v 2 at the moment, if v 1 > v 2 , the time to turn on the 1 − n street lamps in sequence is still t n , but turn off after the time T on the premise of judging that the second car can catch up with the first car in this Lora communication subsystem.If it is calculatede that the street lamp k(k < n) is the nearest lamp when catching up, 1 − k street lamps will still be turned on after t n , and the time to turn on k − n street lamps is reset to , but still turn off after T 1 .The MDU continues to detect whether there is a vehicle, and the value of the vehicle count variable Cnt is increased by one once a vehicle is monitored.The vehicle count variable Cnt will be cleared and a new round of detection will be restarted When the next vehicle is not detected within 30s.

Software development
The embedded program of STM32L151 microcontroller is written by using IAR embedded software development tool with high compiling efficiency to realize the detection of moving objects and the control of street lamps.
On the IAR development platform, the STM32Lxx HAL library was used to complete the embedded programming design of MDU and Streetlight Controller.The main functional modules of the program are: hardware initialization module, frequency measurement module, and communication protocol realization module.Among them, the first module includes the initialization of timer, system interrupt and USART serial port and frequency point setting of LoRa module etc.The frequency measurement module is realized by the counter of the CPU, which realizes the pulse counting in time unit through ETR function.The communication protocol implementation module of the Streetlight Controller receives and parses the LoRa serial port packet, so as to control the lights on and off of street lamps.

Field application
The system has been installed on-site on Luyang Avenue, Lucheng City, Shanxi Province in China.After more than a year field testing, as well as continuous improvement, it has been able to implement the expected results.The field application diagram of SLC and MDU are shown in Figs. 8, 9.
MDU is installed towards the direction of the oncoming vehicle.The installation angle and internal parameter settings of each MDU are adjustable, which enables it to accurately capture vehicles in four lanes on one side and ensures the precision of control.Adopting an interval control methos, each MDU controls 10 SLC under normal circumstances (it can be adjusted appropriately according to specific road con-   2, and Fig. 10 shows the total electricity consumption.By analysing the data in Table 2, the results in terms of reduction of electricity consumption is stated in Table 3.It can be calculated that the electricity consumption in June 2019 was 18% lower than that in April 2019 and 19.7% lower than that in June 2018 after the intelligent streetlight system was put into use in Luyang Avenue, which significantly reduced the electricity consumption.
Besides, when MDU and SLC work normally, the average power consumption measured are 9.18mA@∼220V and 10.20mA@∼220V respectively.Compared with Ref [14], Ref [22], Ref [23], Ref [24] and Ref [33], as shown in Table 4, the proposed streetlight system can well meets the design goal of low power while significantly reduced the elctricity consumption.
In addition, in order to test the function of reporting faulty street lamp information to the cloud server, the power supply lines of a street lamp is artificially disconnected while the system working normally.The smart streetlight cloud server can detect the abnormal variations of the street lamp working status, and then send the information of the street lamp to the maintenance worker to handle the abnormal street lamp in time, which achieves effective management of street lamps and furtherly improves the intelligent level of urban street lamp management.

Conclusion
An intelligent streetlight system based on Internet of Things technology is put forward in this paper.Based on the hard-ware circuit of MDU and SLC designed by low power consumption microcontroller STM32L151, the proposed system adopted low-power communication technology of LoRa and NB-IoT, which implemented the intelligent control of cities under the premise of low power consumption and construction cost.In addition, the working voltage and current information of street lamps can be monitored through NB-IoT, which can effectively improve the timeliness of street lamp maintenance and management.Practical application results show that the system can achieve 80% energy saving for a single controlled lamp and about 20% overall energy saving on the premise of meeting travel stipulates, i.e. lights when the vehicle comes and goes out when the vehicle is away.Its good energy-saving effect, excellent fault detection, low power consumption and cost characteristics beneficially enable it to be applied to the construction of urban road facilities on a large scale which makes it have favourable economic and social benefits.

Fig. 3
Fig. 3 Hardware circuit design of MDU

Fig. 4
Fig. 4 Hardware circuit design of Streetlight Controller

Table 1
Wireless commuunication modes commonly used in streetlight

Table 2
Luyang avenue electricity consumption Statistics (Unit: Chi-The street lamps of Luyang Avenue are controlled by four distribution boxes.The electricity consumption data of the four distribution boxes of Luyang avenue in 2018 and 2019 are shown in Table

Table 3
Electricity cost comparison

Table 4
The performance comparison of the proposed system and sim- -: Average power is not mentioned in this literature