Automating school's bell system with ESP8266
This project automates the ringing of school bells using an ESP8266 microcontroller. The system retrieves real-time from an NTP server, and users can update the bell ring times through a web interface. It's designed to be user-friendly, allowing teachers or administrators to change schedules as needed without technical knowledge.
- Real-time Clock Synchronization: Automatically syncs time using NTP to ensure accurate bell ringing.
- Web Interface: Accessible from any device connected to the same network, allowing users to update ring times easily.
- Multiple Bell Times: Supports up to 14 configurable ring times for different periods during the day.
- Relay Control: Operates a relay connected to the school bell, turning it on and off at the specified times.
- Fallback on Wi-Fi Failure: The system automatically restarts and reconnects in case of Wi-Fi connection failure.
- ESP8266 (NodeMCU)
- Relay Module
- NTP Server (pool.ntp.org) for real-time clock synchronization
- Web Server (via ESP8266WebServer library)
- Setup: The ESP8266 connects to the Wi-Fi network using the provided credentials. It synchronizes with the NTP server to get the current time.
- User Interface: A web interface is served at the ESP8266’s IP address. Users can access this via their phone or computer to view and update the ring times.
- Bell Ringing: At the specified times, the relay connected to the school bell is activated, ringing the bell for a set duration (default: 10 seconds).
- Custom Ring Times: Users can customize up to 14 ring times using the web interface.
- Current Time Display: The web interface dynamically updates and shows the current time.
- Connect the ESP8266: Ensure the ESP8266 is wired to a relay module controlling the school bell.
- Upload the Code: Flash the provided Arduino code onto the ESP8266 using the Arduino IDE.
- Configure Wi-Fi: Update the Wi-Fi credentials in the code (
ssid
andpassword
) before uploading. - Access the Web Interface:
- Once the ESP8266 is connected to Wi-Fi, open your browser and navigate to the ESP8266’s IP address (shown in the serial monitor).
- Use the web form to set the desired ring times.
- Time Synchronization: The system will automatically synchronize with the NTP server to get the current time.
- Relay Pin:
D1
(Connected to the relay controlling the school bell) - Seismometer Pin (Optional):
D2
(Reserved for future earthquake detection feature)
- ESP8266WiFi.h: For Wi-Fi connectivity.
- NTPClient.h: For time synchronization using the NTP protocol.
- WiFiUdp.h: To send and receive data over UDP.
- ESP8266WebServer.h: For setting up a web server on the ESP8266.
- Seismometer Integration: In future versions, a seismometer can be added for earthquake detection, triggering an emergency alarm.
- Mobile Optimization: Improve the web interface to be more mobile-responsive for easier control on smartphones.
- Holiday/Custom Schedule Support: Add an option to input custom schedules or holiday breaks.
- Wi-Fi Connection Issues:
- Ensure the Wi-Fi credentials are correct and that the ESP8266 is within range of the router.
- Check the serial monitor for connection status.
- Bell Not Ringing:
- Double-check the relay wiring.
- Make sure the relay pin (
D1
) is correctly connected and receiving signals from the ESP8266.
This project was developed as a school project to demonstrate practical skills in IoT, automation, and web-based control using the ESP8266.
This project is free to use and modify for educational purposes.
You can update any sections based on your actual project. This README gives a professional touch and will explain your project well to anyone evaluating it!