Skip to content

dr-harper/arduino-projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino Projects

A collection of ESP32 & ESP8266 projects — LED grids, smart night lights, an AI camera, and a wearable LED tie.

MIT Licence Platform Arduino LEDs

Every project runs a built-in web server with a mobile-friendly control panel — no app required, just connect and go.


Projects at a Glance

Project Hardware LEDs Highlights
Night Light ESP32-C3 55x SK6812 RGBW Time-based schedule, MQTT/Home Assistant, 10 effects
LED Grid ESP32-C3 Super Mini 16x16 WS2812B (256) Tetris, Snake, 17 effects, phone controls
LED Panel ESP32-C3 Super Mini 8x32 WS2812B (256) Clock display, games, 17 effects
LED Tie ESP8266 (Wemos D1 Mini) 70x WS2812B + OLED Wearable, scrolling text, 14 modes
AI Camera XIAO ESP32S3 Sense - On-device ML image classification
Carbon Intensity ESP8266 35x WS2812B Queries UK Carbon Intensity API, colour-maps to LEDs

Night Light

A children's night light that changes colour on a schedule — warm amber at bedtime, dim red for sleep, soft green for "OK to wake".

Hardware: ESP32-C3 + 55x SK6812 RGBW LEDs

Features
  • Scheduled colours — Up to 8 time slots, each with RGBW colour, brightness, and effect. Smooth crossfade transitions between slots.
  • 10 LED effects — Solid, Breathing, Soft Glow, Starry Twinkle, Rainbow, Candle Flicker, Sunrise, Christmas, Halloween, Birthday
  • Special dates — Configure up to 4 dates (birthdays, holidays) that automatically override the schedule with a themed effect
  • Home Assistant — Optional MQTT with auto-discovery. Full bidirectional sync: colour, brightness, effects, schedule slots, diagnostics
  • Thermal protection — Reads the ESP32-C3's internal temperature sensor; linearly dims LEDs above 65 C and cuts off at 80 C
  • Web UI — Mobile-first dark theme with dashboard, schedule editor, settings, and OTA firmware updates
  • AP mode controls — When no WiFi is configured, a standalone colour picker and effect selector runs alongside the captive portal
  • Reliability — Hardware watchdog, WiFi auto-reconnect, 64-bit uptime counter, login rate limiting
Home Assistant Entities
Entity Type Details
Light light RGBW colour, brightness, 10 effects
Active Slot sensor Current schedule slot name
Slot Override select "Auto" + all slot labels
NTP Status binary_sensor Time sync connectivity
WiFi RSSI sensor Signal strength (diagnostic)
Uptime sensor Duration in seconds (diagnostic)
Free Memory sensor Heap bytes (diagnostic)
Chip Temperature sensor Internal temp in C (diagnostic)
Special Date sensor Active date label

Access: http://nightlight.local | Default password: nightlight

Full changelog


LED Grid

A 16x16 pixel display that plays Tetris by itself, lets you play Snake from your phone, and doubles as a clock.

Hardware: ESP32-C3 Super Mini + 16x16 WS2812B matrix (256 LEDs)

17 Visual Effects
Effect Description
Tetris AI-driven pieces fall and stack (configurable skill/speed)
Rainbow Wave Rainbow ripple across the grid
Colour Wash Entire grid fades through hues
Diagonal Rainbow Rainbow bands on the diagonal
Rain Coloured drops falling down columns
Clock NTP-synced digital clock (12/24h, crossfade transitions)
Fire Heat-based fire simulation
Aurora Flowing green/purple northern lights
Lava Slow drifting metaball blobs
Candle Warm flickering candlelight
Twinkle Random twinkling starfield
Matrix Green falling code streams
Fireworks Particle launch and burst
Game of Life Conway's Life with colour
Plasma Sine-wave interference patterns
Spiral Rotating colour pinwheel
Valentine's Pulsing heart with sparkles
Snake AI or manual phone control
Games
  • Tetris — AI plays automatically with tuneable skill level and speed. Switch to manual mode and play on your phone with touch controls or keyboard arrows.
  • Snake — AI autopilot or manual control via WebSocket, played from the browser.

Both games use a live WebSocket connection for responsive phone controls.

Clock Features
  • 12 or 24-hour format
  • Crossfade digit transitions
  • 6 colour presets (warm white, cool white, amber, green, blue, red)
  • Orbiting second trail on the border
  • Minute position marker

Access: http://tetris.local | Default password: tetris

Detailed README


LED Panel

The LED Grid's wider sibling — an 8x32 panel that makes a great desk clock with scrolling effects.

Hardware: ESP32-C3 Super Mini + 8x32 WS2812B panel (256 LEDs)

Features
  • Same 17-effect library as the LED Grid, tuned for the 32x8 aspect ratio
  • Clock effect with 4x6 pixel font for improved legibility
  • Playable Tetris and Snake via phone controls
  • Column-major serpentine LED mapping with 180-degree rotation (panel mounted upside-down in its case)
  • OTA firmware updates via the web UI

Access: http://ledpanel.local | Default password: ledpanel


LED Tie

A wearable LED tie built for a work event. Features a "flirt mode" and an "avoidant mode" activated by holding the button.

Hardware: ESP8266 (Wemos D1 Mini) + 70x WS2812B LEDs + SSD1306 OLED display + button

Features
  • 14 LED animation modes with auto-cycle
  • Customisable scrolling phrases stored in EEPROM
  • OLED display for mode names and status
  • Physical button: single press cycles modes, 2s hold activates flirt mode, 3s hold activates avoidant mode
  • WiFi AP with web UI for live control and phrase editing
  • Configurable brightness levels via double-tap

AI Camera

An ESP32-S3 camera that captures images and classifies them on-device using MobileNet — no cloud required.

Hardware: Seeed Studio XIAO ESP32S3 Sense + OV2640 camera + 8MB PSRAM

Features
  • On-device image classification (MobileNet V1 via TensorFlow Lite Micro)
  • PSRAM ring buffer storing up to 10 captured images
  • Live camera stream and still capture via web UI
  • Manual tagging and classification correction
  • Button-triggered capture with LED feedback

Setup: Before compiling, generate the ML model:

cd ai_camera/tools && python3 generate_model.py

Access: http://aicamera.local | Default password: aicamera


Carbon Intensity LEDs

A WiFi-connected LED strip that visualises UK grid carbon intensity in real time — the first project in this collection and the one that kicked it all off.

Hardware: ESP8266 + 35x WS2812B LEDs

Features
  • Queries the UK Carbon Intensity API over HTTPS
  • Maps intensity level to LED colour: green (very low), lime (low), yellow (moderate), orange (high), red (very high)
  • WiFiManager captive portal for WiFi setup
  • Purple flash on boot, rainbow sweep on successful connection
  • Polls every 30 seconds with a 1-minute loop delay
Libraries
  • FastLED, WiFiManager (tzapu), ArduinoJson, ESP8266HTTPClient

Getting Started

Prerequisites

  • Arduino CLI or the Arduino IDE
  • ESP32 board support package (esp32 by Espressif)
  • ESP8266 board support package (for led_tie and carbon_intensity only)

Libraries

Install via the Arduino Library Manager or arduino-cli lib install:

Library Used by
Adafruit NeoPixel All projects
WiFiManager (tzapu) All projects
PubSubClient night_light, led_grid
ArduinoJson led_grid, led_panel, carbon_intensity
WebSockets led_grid, led_panel
Adafruit SSD1306 led_tie
Adafruit GFX led_tie

Initial Setup

Every project follows the same pattern:

  1. Flash the firmware via USB (first time) or OTA (subsequent updates)
  2. Connect to the setup AP — the device creates a WiFi network (e.g. "NightLight-Setup")
  3. Configure WiFi — the captive portal opens automatically on your phone
  4. Open the web UI — access http://<hostname>.local from any device on your network

All default passwords can be changed via the Settings page in each device's web UI.

Flashing

First flash (USB)

Connect the ESP32 via a data-capable USB cable. If the port isn't detected, hold the BOOT button while plugging in.

arduino-cli upload \
  --fqbn esp32:esp32:nologo_esp32c3_super_mini \
  --port /dev/cu.usbmodem101 \
  --input-dir build/esp32.esp32.nologo_esp32c3_super_mini/
OTA updates (WiFi)

Once the device is on your network, use the build script for wireless updates:

# Set your device password (required for OTA upload)
export LED_GRID_PASS="your-device-password"
export LED_PANEL_PASS="your-device-password"

# Optionally override the default hostname/IP
export LED_GRID_IP="192.168.1.25"

# From the project directory:
./build.sh                       # Compile only
./build.sh --upload              # Compile + OTA upload (mDNS)
./build.sh --upload 192.168.1.x  # Compile + OTA upload (IP)

The build script compresses HTML pages, compiles the firmware, and uploads via the device's web UI.

Licence

This project is licensed under the MIT Licence — see LICENSE for details.

About

ESP32 & ESP8266 Arduino projects — LED grids, night lights, AI camera, wearable LED tie

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors