We want to build a smart street βοΈ light system that includes the following criteria:
- The system will turn on the street lights at a moderate level (to save electricity β‘οΈ)
- The light will be more bright π when there is a vehicle on the road or when it rains.
- The system also takes context information such as temperature and humidity on the road and uploads it to the cloud system.
- Light poles π communicate with each other wirelessly.
- We also use solar energy in day to reduce consumption capacity. π±
I used a Arduino UNO to read enviroment infomation. The information include: light, rain, humidity and temperature of street. (I must to use UNO because ESP8266 can't read many analog signa).
All infomation from UNO was transmit to ESP8266 by custom TX-RX (D5,D6) ESP8266 will reciept information in Json form. Thus I'll use that information and signal from Motion sensor to turn the light in condition.
The last, all information sended on broker acrossding MQTT method.
All child circuit subcriber the topic on broker. So they can know messenge of Master. Similar to ESP8266 on Master they will read motion signal and turn the light in codition. (Mission of child is only control the light and don't send anything else)
In this project, I used MQTT method to communicate between devices and device to server. Broker i was use is HiveMQ.
All my code in code folder include: Uno, Node, Child and demo.py
- Uno and Node is code of Master curcuit.
- Child for Child circuit.
- Demo.py is application
- First one, You need to clone my repo.
https://github.com/RC-Sho0/Smart-street-light-control-system--IoT.git
- Push source code for each circuit. Attention βοΈ: In Node.ino and Child.ino you need to replace
const char* ssid = {Your WIFI};
const char* password = "Your WIFI password";
-
Connect the wires as shown on the diagram.
-
Plug power and run application
streamlit run demo.py
Code by Sho0
Hope you guys can refer to this project