To help city councils or another government institutions my students have created a system that send different information about the public waste bins. This is a prototype.
This system send periodically information to ThingSpeak about:
- Temperature
- Humidity
- Level of trash
- Fire
- Quality of the air
In function of these values actions can be done. For example, if the trash is full or the quality of air is poor would be interesting to send the trash truck to pick the same. With Fire signal you can monitoring if the trash bin is burning and send the firemen.
Architecture of the solutionIn thingSpeak account is created. The most important is to assign the fields to use and the API key to write in the code configuration
The configuration of this channel is (Spanish):
5 fields are activated. These field are received from the our board.
Don´t forget to write down the API key for writting, becuase is necesary to configure the block to send to thingspeak
Firstable need to load the AT firmware. Is important because the library send different AT command to connect to the wifi. The speed is very important, because you need to configure in the inicialization block of ESP8266. I have attached the source code in Blockly and Arduino.
With this tool esp8266_flasher.exe, you need to load this firmware. ai-thinker-0.9.5.2-9600.bin. The firware is attached in the code to download
Writing at 0x0007ec00... (99 %)
Leaving...
Failed to leave Flash mode
I used the FTDI and this circuit to flash the ESP-01
This is a tool to create arduino code using graphical blocks. It is ready for MRT-duino board but you can change the configuration to works with other arduino boards. You can find information about the pins and ports of the board here.
My students do many projects using this tool because it allows them to learn computer thinking without getting into the knowledge of a specific programming language.
Information about the libraries to install depending of the sensor or actuator used in the project, click here.
My students do many projects using this tool because it allows them to learn computer thinking without getting into the knowledge of a specific programming language.
Information about the libraries to install depending of the sensor or actuator used in the project, click here.
In this case these libraries were used:
- DHT Adafruit : to use the DHT sensors
- Adafruit Unified sensor: to use the DHT sensors and other sensors
- IOT_ts: custom library to manage connectivity with ThingSpeak
More Pictures
DHT11
- Signal to Port 9. S pin of this port
- VCC to 5V. + pin of the any port
- Ground to GND. - pins of the any port
Ultrasonic
- Trigger to Port 2. S pin of this port
- Echo to Port 3. S pin of this port
- VCC to 5V. + pin of the any port
- Ground to GND. - pins of the any port
Air quality sensor
- Sensing pin to Port 10. S pin of this port
- VCC to 5V. + pin of the any port
- Ground to GND. - pins of the any port
Flame Sensor
- Sensing pin to Port 5. S pin of this port
- VCC to 5V. + pin of the any port
- Ground to GND. - pins of the any port
ESP8266-01 with adaptor
- Tx to Port 15. S pin of this port. Tx--Rx
- Rx to Port 16. S pin of this port Rx--Tx
- VCC to 5V. + pin of the any port
- Ground to GND. - pins of the any port
Comments