Welcome to the Smart Tank Monitoring System repository! This project utilizes an ESP8266 microcontroller to monitor water levels in a tank and sends data to ThingSpeak, an IoT platform, for real-time tracking. The following information will guide you through the project details and code.
-
File:
SmartTank.ino
This Arduino sketch monitors water levels using an ultrasonic sensor, controls LEDs based on the water level, and sends the data to ThingSpeak for remote monitoring.
- ESP8266 Microcontroller
- Ultrasonic Sensor (HC-SR04)
- LEDs (Red and Green)
- Resistors
- Jumpers and Breadboard
-
WiFi Connection:
- Replace
ssid
andpass
with your WiFi network credentials.
- Replace
-
ThingSpeak:
- Replace
ch_no
with your ThingSpeak channel number. - Replace
write_api
with your ThingSpeak write API key.
- Replace
-
Ultrasonic Sensor:
trigPin1
- Trigger pin connected to D1.echoPin1
- Echo pin connected to D2.
-
LEDs:
redled
- Red LED connected to D3.grnled
- Green LED connected to D4.
-
Setup:
- Connect the hardware components based on the provided pin configuration.
- Upload the code to your ESP8266 using the Arduino IDE.
-
Monitor:
- Power up the system.
- The ultrasonic sensor measures water level.
- LEDs indicate the water status (red for low, green for normal).
-
ThingSpeak Integration:
- Data is sent to ThingSpeak every 10 seconds.
- Monitor the tank's water level remotely using the ThingSpeak channel.
- The system checks water levels and sends updates to ThingSpeak periodically.
- Adjust the threshold (
if (distance1 <= 5)
) based on your tank configuration. - LEDs provide a quick visual indication of water status.
Feel free to contribute to the project by improving the code, enhancing functionality, or adding features. Create a pull request with your changes.
If you encounter issues or have questions, please open an issue on GitHub.
Happy tank monitoring! 🚰📊