This is an old revision of the document!


Smart Street Light Control System

author Pascu Mihail-Eugen ACES 2021

1.Project Objective

The purpose of this application is to implement a system that makes the street lights more efficient than the conventional street lighting systems in the matter of energy conservation, reduction of maintenance costs, decrease of maintenance time and increase in the public safety.

2.Context of public lighting in Bucharest

The public lighting system in Bucharest is an important source of expenses for the Bucharest City Hall. 1)According to [3] in the last 5 years, the average cost of the public lighting was around 28.650.000RON. This increased cost is due to the fact that the system was not updated to the newer and more efficient lighting solutions. 73% of the bulbs that are used inside the lighting poles (the total numbers are around 90.000 poles and approximately 120.000 bulbs) are still incandescent bulbs which are less efficient and have a shorter life span than the bulbs with LEDs. The LED bulbs consume 75% less energy and have at least double life span, according to [4].
Because the civic spirit is not cultivated in our population and that no efficient maintenance system is in place for the street lighting system, issues are detected and reported after long periods of time. Also, because the issues are not fixed in short time, the public safety at night is at risk because of the possible street dangers (thieves, open sewer entry and others) can not be see without lighting.

3.Project Description

The system is composed of two main elements: a central hub and many pole controllers.

  • The central hub can be any device that can host a web server and acts as an AccessPoint. Its purposes are:
    • to collect diagnostic data from the light poles;
    • send configuration data (time interval for turning on the light, control commands, operation modes) to the poles via the WiFi connection;
    • host the web server that is the user interface of the system.
  • The pole controller will:
    • detect movement, using a PIR sensor, and tune the light intensity according to it (if movement is detected then the light intensity will be set to maximum, if not, it will be set to DIMMING_FACTOR2) * maximum intensity;
    • will control the light using different modes 3):
      • using the integrated environmental light intensity sensor (if it detects that is night, the lights will be turned on automatically);
      • using the time schedule interval that is provided by the central hub;
    • communicate to the adjacent pole nodes (for extending the sensing capabilities of the poles);
    • communicate with the central hub (for sending diagnostic data - burned bulb, missing adjacent node and others);
    • establish a mesh network with all other poles;
    • diagnostic the LED bulb: detect if there is a short on the bulb or if is and open circuit (missing or burned bulb);

4.Hardware Description

All the components that were used in this project are:

  • ESP32 Development board: at least two boards are needed (one for the central hub and at least one to control the pole light). In this project I made use of four boards, one central hub and three poles;
  • Light Dependent Resistor (LDR) or photoresistor: for each pole an LDR must be used. The purpose of this LDR is to detect the environmental light intensity, with the help of it, the pole detects if it is night or day time;
  • Passive InfraRed Sensor (PIR) sensor: for each pole an PIR sensor is used to detect movement around the pole. The PIR sensor was used because it have a detection range up to 10m and a detection angle of 45degrees in each direction starting from the center [9]. These properties are in concordance with the height of the usual street poles height which is varying from 5m to around 10m [10];
  • Light Emitting Diode (LED): For each pole is needed one LED. This simulates the bulb of the pole;
  • Resistors: there are used two types of resistor, both of them are needed for each present pole. The resistors are:
    • 10k Ohm Resistor: needed for reading the voltage present on LDR;
    • 15-330 Ohm Resistor: needed for current limiting the LED;

Regarding the electrical connections, the central hub has no external devices connected to it. The central hub is connected just to the PC via TTL-USB in order to communicate with the PC, to find out the IP address of the web server hosted on it. The electrical circuit for the poles is presented in the below image [5]:

In the pole schematic can be seen that one analog input (GPIO36) is used to read the value from the LDR, one analog input (GPIO 34) is used to get the voltage that the ESP32 provides to the Bulb (for diagnostic purpose), one digital input(GPIO13) is used to read the signal from the PIR movement detection sensor and one digital output(GPIO2) is used to control the bulb of the pole. The power supply issue was not taken into consideration for when the system will be installed in a pole. Currently the pole hardware is powered via USB cable. As a solution for this issue, a step-down power supply could be used to connect to the 220V network and convert to 5V, to power up the system.

5.Software Description

The system architecture can be found in the image below:

As can be seen, the poles and the central hub establish a mesh network making use of the library painlessMesh [6][7]. This handles the message transmission environment between the poles and the centralHub. Beside this part of code that handles the mesh, there is also the logic part for handling the poles functionalities. This part is making use of the FreeRTOS [8] concepts. It that was developed for this project is divided in two parts:Pole and CentralHub code. Each part was again divided in multiple files to improve the code readability, update and maintenance time in this way (<part> can be pole or centralHub):

  • <part>Code - file that contains the preprocessor directives (defines, includes), the new types defined for this project, the external used variables, the declaration of the functions and tasks that will be used and the definitions for the setup and loop functions;
  • globalParameters - no need for description;
  • meshFunction - contains the definitions of all the functions that are used in the mesh network communication, maintenance and event processors;
  • <part>Functions - contains the definitions of all the functions that handles the logic for the applications of the <part>;
  • tasks - contains the definitions for the tasks that are used to call cyclically the logic handling part of the code;

Pole Code:

  • LED controlled PWM
  • Analog read of the voltage that is provided to the LED for diagnosis purpose
  • Analog read of Photoresistor voltage to detect the light intensity

Central Hub:

  • code esp32
  • code web server

6.Issues and Solutions

Central hub connected to the Mesh but also provide connection as an AP to the web server. Solution, but not enough time. So workaround. Bulb state detection (burnt, not connected, turned off, turned on min, turned on max). The choice for the movement detection sensor.Delay after muvement detection. Power supply was not taken in consideration.

7.Conclusions

Improvements: geolocation (at least name of bulb with the location, or QR code on the pole); web server in parallel with the painless mesh and refresh info each minute;

8.Bibliography and Resources

1) CMIPB - A non official source of information was used, because the CMIPB - Company of Public Lighting Bucharest site is not available for official data.
2) Parameter that is configurable via the central hub
3) More modes could be added in next iteration steps
iothings/proiecte/2021/smartstreetlightcontrolsystem.1639950389.txt.gz · Last modified: 2021/12/19 23:46 by mihail_eugen.pascu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0