A feature-rich, web-controlled Diwali light automation system with 32 stunning patterns, scheduling, and EEPROM persistence.
- Overview
- Features
- Hardware Requirements
- Circuit Diagram
- Software Requirements
- Installation
- Configuration
- Web Interface
- Pattern Library
- Usage
- Troubleshooting
- Contributing
- License
This project transforms Diwali decoration into intelligent, automated light show using an ESP32 microcontroller. currently Controls 13 jhalar lights (7 Pink + 6 White {customisable}) plus 2 rope lights (Pink and White) through an interactive web interface accessible from any device on your local network.
Ideal for:
- π Home Diwali decorations
- π Festival celebrations
- π Party lighting
- π’ Commercial decorations
- π¨ Creative lighting projects
- Responsive web interface - Control from any device.
- Real-time status updates - Live monitoring of WiFi, mode, and current pattern
- Wave Chase - Smooth left-to-right chasing lights
- Alternate Flash - Bold color switching
- Mirror Converge - Lights meet in the middle
- Color Breathing - Smooth color transitions
- Random Sparkle - Twinkling star effect
- Firecracker Burst - Explosive bursts with falling sparks
- Diya Wave - Traditional diya lighting effect
- Lightning Storm - Random intense flashes
- Shimmer Curtain - Elegant shimmering effect
- And 23 more stunning patterns!
- Manual Override - Instant control over automatic scheduling
- Pattern Jump - Switch to any pattern instantly
- Next/Previous - Navigate patterns easily
- Individual Pattern Control - Enable/disable indiv pattern
- Duration Adjustment - Customize timing (5-60s per pattern)
- Automatic time-based control - Set start and end times
- Crossing midnight support - Perfect for evening to late night shows
- NTP time synchronization - Accurate timekeeping via internet
- EEPROM saving - All settings survive power loss
- Instant restore - Returns to last saved state on restart
- No reconfiguration needed - Set it once, works forever
- WiFi connectivity - Connect to your home network
- Fallback AP mode - Creates its own hotspot if WiFi fails
- Auto-reconnect - Keeps trying to reconnect every 30 seconds
- Offline operation - Works without WiFi using saved settings
| Component | Quantity | Specification |
|---|---|---|
| ESP32 Development Board | 1 | Any ESP32 variant |
| 16-Channel Relay Module | 1 | 5V or 12V, Active LOW |
| Pink Jhalar Lights | 7 | 220V AC |
| White Jhalar Lights | 6 | 220V AC |
| White Rope Light (WTOP) | 1 | 220V AC |
| Pink Rope Light (PTOP) | 1 | 220V AC |
| Power Supply | 1 | 5V 2A for ESP32 |
| Jumper Wires | As needed | Male-to-Female |
Pink Jhalar Lights (7):
GPIO 13 β Pink 1
GPIO 14 β Pink 2
GPIO 26 β Pink 3
GPIO 33 β Pink 4
GPIO 5 β Pink 5
GPIO 19 β Pink 6
GPIO 15 β Pink 7
White Jhalar Lights (6):
GPIO 12 β White 1
GPIO 27 β White 2
GPIO 25 β White 3
GPIO 32 β White 4
GPIO 18 β White 5
GPIO 21 β White 6
Rope Lights:
GPIO 2 β White Rope Light (WTOP)
GPIO 4 β Pink Rope Light (PTOP)
-
ESP32 to Relay Module:
- Connect ESP32 GND -> Relay GND
- Connect ESP32 5V -> Relay VCC
- Connect GPIO pins -> respective relay IN pins (as per pin mapping)
-
Relay Module to Lights:
- Connect AC Live wire through relay COM and NO(normally open) pins
- Each indv light connects to one relay channel
- All lights share common Neutral
-
Power Supply:
- Power ESP32 with 5V USB or dedicated 5V regulator
β οΈ WARNING: Working with 220V AC is dangerous. If you're not experienced with AC voltage, please hire a qualified electrician.
- Arduino IDE
- ESP32 Board package
libraries are included with ESP32 board package:
- WiFi.h
- WebServer.h
- EEPROM.h
- time.h
Edit these lines in the code:
const char* ssid = ""; // WiFi name
const char* password = ""; // WiFi passwordThe system comes with these defaults:
| Setting | Default Value |
|---|---|
| Start Time | 6:00 PM (18:00) |
| End Time | 1:00 AM (01:00) |
| Pattern Duration | 15-20 seconds |
| All Patterns | Enabled |
| Mode | Automatic |
To change default schedule, edit loadDefaultSettings() function:
settings.startHour = 18; // 6:00 PM
settings.startMinute = 0;
settings.endHour = 1; // 1:00 AM
settings.endMinute = 0;If WiFi connection fails, ESP32 creates its own hotspot:
| Setting | Value |
|---|---|
| SSID | Diwali_Lights_Setup |
| Password | diwali2024 |
| IP Address | 192.168.4.1 |
If WiFi Connected:
- Check Serial Monitor for IP address (e.g.,
192.168.1.100) - Open browser and go to:
http://192.168.1.100
If WiFi Failed (AP Mode):
- Connect to WiFi hotspot "Diwali_Lights_Setup"
- Password:
diwali2025 - Open browser and go to:
http://192.168.4.1
- WiFi Status: Connected/Offline
- Mode: Auto/Manual
- Current Pattern: which pattern is running
- All Lights ON: Turn all lights on
- All Lights OFF: Turn all lights off
- Manual Override: Toggle Auto and Manual mode
- Save Settings: Save changes to EEPROM
- Start Time: Set when lights turn on
- End Time: Set when lights turn off
- safe crossing midnight (e.g., 6 PM to 1 AM)
- Jump to Pattern: Dropdown to select any pattern
- Next Pattern: Skip to next enabled pattern
- Previous Pattern: Go back to previous pattern
For each pattern:
- Toggle Switch: Enable/disable pattern
- Duration Input: Set duration (5-60 seconds)
- Changes save automatically
1. Wave Chase
- Smooth left-to-right wave motion
- Ping-pong effect with rope flash
- Perfect for elegant flow
2. Double Chase
- Two waves moving in opposite directions
- Color-synchronized rope lights
- Dynamic and engaging
3. Snake Chase
- Moving segment of 3 lights
- Creates slithering effect
- Keeps rope lights on for base
4. Alternate Flash
- Bold pink and white switching
- Strong color contrast
- High visual impact
5. Firecracker Burst
- Random explosive bursts
- Falling spark effect
- Perfect for celebrations
6. Lightning Storm
- Random intense flashes
- Thunder effect with all lights
- Dramatic and exciting
7. Mirror Converge
- Lights meet in middle from both ends
- Rope pulses when converged
- Elegant symmetry
8. Symmetrical Pulse
- Center-out pulsing effect
- Breathing motion
- Calm and rhythmic
9. Rangoli Bloom
- Blooms from center like rangoli
- Breathing at full bloom
10. Color Breathing
- Smooth pink to white transitions
- Breathing effect
11. Diya Wave
- Lights accumulate like lighting diyas
- Gentle flickering when all lit
12. Color Tide
- Waves crossing in opposite directions
- Complementary rope effects
13. Random Sparkle
- Twinkling lights effect
- Keeps rope on for base
14. Random Glow
- Lights turn on randomly one by one
- Builds to full brightness
15. Shimmer Curtain
- All lights on with random shimmer gaps
- high ON time
16. Heartbeat Pulse
- Double pulse rhythm
- Simulates heartbeat
17. Heartbeat of House
- Gradual fade in/out
- Living, breathing effect
18. Festival March
- Moving groups of 3 lights
- Drum beat flashes
- Marching & band effect
19. Festival Grand
- Combination of multiple effects
- Flash β Wave β Sparkle sequence
20. Rising Cascade
- Lights fill up gradually
- Peak flash celebration
21. Cascading Waterfall
- Falling water effect
- Overlapping cascades
- Upload code to ESP32
- Power on the system
- Open Serial Monitor to find IP address
- Access web interface via browser
- Verify all lights work using "All Lights ON"
- Test patterns one by one
- Customize durations and enabled patterns
- Save settings using "Save Settings" button
Symptoms: Can't access web page after upload
Solutions:
- Check Serial Monitor for IP address
- Ensure phone/computer is on same WiFi network
- Try pinging the IP address
- If WiFi failed, look for "Diwali_Lights_Setup" hotspot
- Connect to hotspot and try
http://192.168.4.1
Symptoms: Web interface works but lights don't respond
Solutions:
- Check relay connections to ESP32
- Verify AC power to lights
- Test with "All Lights ON" button
- Check if Manual Override is ON
- Verify schedule times are correct
- Ensure patterns are enabled
Symptoms: Web interface becomes inaccessible randomly
Solutions:
- Move ESP32 closer to WiFi router
- Check WiFi signal strength
- check for WiFi interference
- ESP32 auto-reconnects every 30 seconds
- Lights continue working with saved settings during disconnection
Symptoms: Settings revert after restart
Solutions:
- Wait for "Settings saved!" confirmation
- Don't power off immediately after saving
- Check EEPROM initialization in Serial Monitor
- Re-upload code if EEPROM is corrupted
Symptoms: Interface takes time to respond
Solutions:
- Improve WiFi signal strength
- Reduce distance to ESP32
- Close other tabs/apps using network
- Clear browser cache
Safety Rules:
-
β Always disconnect power before working on circuits
-
β Use proper insulated enclosure for relays and ESP32
-
β Use proper gauge wires for AC loads
-
Don't overload relay channels
-
Install in dry, protected location
-
Use proper 5V power supply (2A minimum)
-
Use optocoupler-based relay modules
Contributions are welcome!
This project isnt licensed xD
If this project helped you, please consider giving it a β!
- Initial release
- 32 lighting patterns
- Web interface
- EEPROM persistence
- WiFi fallback AP mode
- Manual override
- Schedule system
May your celebrations be bright and joyful! πͺβ¨
Shubh Deepavali!
Made with β€οΈ for the Festival of Lights
β Star this repo if you found it helpful!


