This project is an IoT-based water flow meter that monitors and tracks water usage in real time. It measures the flow rate of water and calculates the total volume used, displaying the data on an OLED screen. The data is also sent to a cloud server (ThingSpeak) for remote monitoring and analysis.
- Real-time measurement of water flow rate and total volume.
- Display of current flow rate and cumulative water usage on an OLED screen.
- Sends data to the ThingSpeak cloud platform for remote monitoring.
- Low-cost and efficient solution for monitoring water consumption.
- ESP8266 WiFi Module
- Water Flow Sensor
- OLED Display (128x64)
- Resistors and Wires
- Breadboard
- Power Supply
ESP8266WiFi.h
: For Wi-Fi connectivity.Adafruit_GFX.h
andAdafruit_SSD1306.h
: For controlling the OLED display.
-
ESP8266 to Water Flow Sensor:
- Sensor Signal Pin -> GPIO2
- Sensor Power (VCC) -> 5V
- Sensor Ground (GND) -> GND
-
ESP8266 to OLED Display:
- OLED SCL -> D1 (GPIO5)
- OLED SDA -> D2 (GPIO4)
- OLED VCC -> 3.3V
- OLED GND -> GND
- Install Arduino IDE: Ensure you have the latest Arduino IDE installed.
- Install Required Libraries: Install the following libraries via Arduino Library Manager:
- Adafruit GFX Library
- Adafruit SSD1306 Library
- ThingSpeak Setup:
- Create a ThingSpeak account.
- Create a new channel and note down the Write API Key.
- Replace the placeholders for
ssid
andpass
with your Wi-Fi credentials. - Replace the
apiKey
with the Write API Key from your ThingSpeak channel.
- The water flow sensor generates pulses based on the flow of water.
- The ESP8266 reads the pulses and calculates the flow rate using a calibration factor.
- The calculated flow rate and total volume are displayed on the OLED screen.
- The data is periodically sent to the ThingSpeak server for remote monitoring.
- Interrupts: Used to count the pulses from the flow sensor.
- Wi-Fi Connection: The ESP8266 connects to the Wi-Fi network for internet access.
- ThingSpeak Integration: Sends flow rate and total volume data to the cloud.
- OLED Display: Displays the flow rate (L/min) and total volume (L) locally.
Flow rate: 2.5L/min
Output Liquid Quantity: 1500mL / 1.5L
Water Flow Meter
R: 2.5 L/M
V: 1.5 L
- Assemble the circuit as per the connections mentioned above.
- Upload the provided code to the ESP8266 using the Arduino IDE.
- Open the serial monitor to verify data output.
- Monitor water flow data on the OLED display and ThingSpeak dashboard.
-
No Wi-Fi Connection:
- Ensure correct SSID and password.
- Check if the Wi-Fi network is active.
-
Incorrect Flow Readings:
- Adjust the calibration factor to match your flow sensor specifications.
-
Data Not Sent to ThingSpeak:
- Verify the Write API Key.
- Check internet connectivity.
- Mihir Patil
- Sanat Pareek
- Akash Bharti
This project is open-source and available under the MIT License.