This project uses an ESP8266 microcontroller to measure water level with an ultrasonic sensor and display the result on an OLED display. It also provides a GET endpoint to retrieve this information over Wi-Fi.
- ESP8266 microcontroller (NodeMCU)
- Ultrasonic sensor (JSN-SR04T)
- OLED display (0.91" 128x32, I2C interface)
-
Ultrasonic Sensor:
- Trigger Pin: D6
- Echo Pin: D5
-
OLED Display (I2C):
- SDA Pin: D1
- SCL Pin: D2
-
Power source for ESP8266
The code uses arduino_secrets.h
file to store Wi-Fi SSID and password. Use arduino_secrets.h.example
template to create the file with your own SSID and password.
-
Once the code is uploaded, the ESP8266 will connect to the configured Wi-Fi network.
-
The OLED display will show the measured distance, Wi-Fi status, and signal strength.
-
You can access the data remotely by making a GET request to the following endpoint: http://destovka.local/get_level