Welcome to the demo of Resident community management. Resident community management aims at providing services such as intelligent street lighting, intelligent trash collection and gas monitoring (home) in a residential area.
In this project, all the sensors and actuators are integrated with Wiznet Wizwiki W7500. The collected sensor data is transferred serially (UART) to NodeMCU (ESP82366). The NodeMCU is connected with the Ubidots (IOT Platform). To transmit the data from NodeMCU to Ubidots we are using MQTT protocol. We can use HTTP protocol also but MQTT protocol is light weighted protocol and it has three level of service (QoS).
In intelligent trash collection, we have sensors such as PIR sensor, Ultrasonic sensor and a servo motor. The PIR(Passive Infrared) sensor detects the person approaching the waste bin. When a motion is detected by the PIR sensor then the ultrasonic sensor checks whether the waste bin is full or not by measuring the depth of the waste bin. This reading is send to the Ubidots (IoT platform) through NodeMCU and is displayed in the Dashboard for an authorized person. If the bin is not full (above threshold value – more space) the lid of the waste bin will be opened by the servo motor for a given time so the person can put the garbage into the bin and then it closes automatically. If the waste bin is full (less space) then the bin won’t open. For authorities to remove the waste from the bin they can open and close the bin manually (Switches).
Every house in the resident community will have the gas sensor to detect the gas leak. The sensor (MQ 5) has high sensitivity to LPG and natural gas. The gas sensor continuously monitors the house. This reading is sent to the Ubidots (IoT platform) through NodeMCU and is displayed in the authorized person’s Dashboard. If a gas leak is detected (value crosses the threshold) an SMS will be sent to the authorized person and an indicator displays it in the Ubidots dashboard.
The intelligent street lighting consists of LDR which continuously monitors the light intensity and sends it to Ubidots (IoT platform) through NodeMCU and is displayed in the Dashboard for an authorized person. When the light intensity is less than a threshold value the street lights will be switched on automatically. Also, it switches off the light when the light intensity is above the threshold value.
Hardware connection Diagram:
Steps to work on Ubidots IOT development Platform:
- Create an account (https://app.ubidots.com)
- Create device
3. Device created
4. Add Variable
5. Widget creation – Go to Dashboard
6. Widget created
7. Event Creation based on the device response
Work on Node MCU(esp8266):
Download the “ubidots-mqtt-esp” library from:
MQTT library for connecting to Ubidots using MQTT protocol and an ESP8266 chip.
- Go to the Arduino IDE, click on Files -> Preferences and enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas
- Open Boards Manager from Tools -> Board menu and install esp8266 platform (and don’t forget to select your ESP8266 board from Tools > Board menu after installation)
- Download this library as .zip
- Now, click on Sketch -> Include Library -> Add .ZIP Library
- Select the ZIP file that you have just downloaded and then “Accept” or “Choose”
- Go to Sketch/Program -> Include Library -> Library Manager and install the PubSubClient library
- Close the Arduino IDE and open it again.
- If you are using windows, please install the appropriate driver for your ESP board (CH340G if you are using a LoLin board or CP2102 if you are using an AMICA board.
Note: add the token from your Ubidots account
- Go to Ubidots account
- Go to API credentials
- Copy the default token and add it in your project
Work on wiznet w7500:
- For the first time, the user should create the online mbed account (https://os.mbed.com/)
- got to the right corner and select the device WIZwiki-w7500p Import the program using the below link https://os.mbed.com/users/Albinarackal/code/SmartAgri-WIZ750SR/
- Compile the code
- save the bin file and load the bin file to the device