This project utilizes the ESP8266 WiFi module to control two relays based on user-defined time settings. It includes a web interface for configuring relay schedules and provides real-time status updates on an LCD screen.
- Set custom on/off schedules for two relays.
- Web-based configuration interface.
- Real-time status display on a 16x2 LCD.
- WiFi connectivity with automatic network creation if connection fails.
- ESP8266 board (e.g., NodeMCU)
- 16x2 I2C LCD
- Two-channel relay module
- Resistors, wires, and power supply
- Arduino IDE
- ESP8266 board support package
- LiquidCrystal_I2C library
- ArduinoJson library
- Install the required libraries in the Arduino IDE.
- Open the
uploaded_code.ino
file in the Arduino IDE. - Update the
arduino_secrets.h
file with your WiFi credentials. - Upload the code to your ESP8266 board.
- Connect to the WiFi network created by the ESP8266.
- Open a web browser and navigate to the IP address displayed on the LCD.
- Set the desired on/off schedules for relay 1 and relay 2.
- Click "Set Time" to apply the changes.
The LCD displays real-time information, including charging status and relay schedules.
To retrieve variable values via a GET request:
- Send a GET request to
http://[ESP_IP_ADDRESS]/get-values
. - The response will be a JSON object containing:
targetTimeRelay1
: Schedule for relay 1.targetTimeRelay2
: Schedule for relay 2.currentTime
: Current time in minutes.
Contributions are welcome! Feel free to open issues and submit pull requests.