This project involves a system to monitor and control float switches using an ESP32. It displays the status of each switch on an SSD1306 OLED display and provides a web interface for remote monitoring and manual override. The system also includes a relay that is controlled based on the float switch states.
- Monitors multiple float switches.
- Real-time display of switch status on an SSD1306 OLED display.
- Web interface for remote status monitoring and control.
- Override mode for manual control of the switches.
- Relay control based on float switch states.
- Tracks the number of times each switch has been activated (tripped).
- Relay status indication through an LED (optional).
- ESP32 Development Board
- SSD1306 OLED Display
- Multiple Float Switches
- Relay Module
- LEDs for Relay Status Indication (optional)
- Breadboard and Jumper Wires
- Arduino IDE
- ESP32 Board Package for Arduino
- U8g2lib Library for OLED
- WiFi Library for ESP32
- ESPAsyncWebServer Library
- Assemble the hardware according to the provided schematic.
- Install the ESP32 Board Package in the Arduino IDE.
- Install the
U8g2liblibrary via the Arduino IDE Library Manager. - Flash the ESP32 with the provided code after updating the
credentials.hfile with your WiFi network details.
After powering up the ESP32:
- Access the web interface using the ESP32's IP address.
- Monitor the status of each float switch and the relay.
- Use the web interface to toggle individual switches or enable override mode.
- View the trip count for each switch, indicating how many times it has been activated.
/- GET: Main page showing float switch status./toggle?switch={id}- GET: Toggle the state of a switch (id is the switch number)./override- GET: Toggle override mode./getSwitchData- GET: Returns the current state of each switch./getTripCounts- GET: Returns the trip count for each switch./getRelayStatus- GET: Returns the current status of the relay./getGlobalStatus- GET: Returns the overall status based on float switches.
The OLED display presents the status of the float switches, relay state, and override mode, updating in real time.
- Verify WiFi credentials and router proximity.
- Check wiring if the OLED display or relay functionality is inconsistent.
- Reset the ESP32 if the web interface is unresponsive.
Contributions are welcome! Please fork the repository and submit a pull request with your changes for review.
This project is licensed under the MIT License - see the LICENSE.md file for details.