Automatic emergency light for outages

Turns on a 12 V LED light from a battery the moment the mains disappears, dimmed at night and switched off after a timeout.

Smart home Board: ESP32-C3 SuperMini Level: ●●○ ⏱ 2–3 h

⛔ High risk

Mains 220–230 V can kill. Work with the power off, use certified isolated modules in an enclosure, fuse the line, and ask a qualified electrician if you are not sure.

A light that is already on when you reach for the switch

A mains detector tells the ESP32 that the power has gone, and a MOSFET turns on a 12 V LED strip or lamp from a battery in a fraction of a second. You do not need a microcontroller for the bare function, but with one you can fade it in, keep it dim at night so it does not blind you, and switch it off after thirty minutes to save the battery.

Details that matter

The ESP32 must be awake on its own supply, because a cold boot takes seconds and you want the light at once. Use a logic-level MOSFET with a gate resistor and check that it stays cool at your LED current. Put a fuse next to the battery, and keep the detector, which touches 230 V, in a closed enclosure with the correct clearances.

  • Place lights where you walk in the dark: the corridor, the stairs and the bathroom door.
  • Send a message when the light turns on; it is also an outage notifier.

Components

  • ESP32-C3 SuperMini
  • AC 220V optocoupler detection module
  • MOSFET driver module (IRF520/IRLZ44)
  • DC-DC buck converter (MP1584 / LM2596)
  • Inline fuse holder + fuses

What you need

Buy the parts kit · Estimated total: $9.00

ESP32-C3 SuperMini × 1
$2.50
Buy at AliExpress Buy at Amazon.com
AC 220V optocoupler detection module × 1
$2.00
Buy at AliExpress Buy at Amazon.com
MOSFET driver module (IRF520/IRLZ44) × 1
$1.50
Buy at AliExpress Buy at Amazon.com
DC-DC buck converter (MP1584 / LM2596) × 1
$1.50
Buy at AliExpress Buy at Amazon.com
Inline fuse holder + fuses × 1
$1.50
Buy at AliExpress Buy at Amazon.com
🇺🇦 Ukraine🌍 Other countries

Ukraine: we buy and sell these parts ourselves, order them on this site.

Some links are affiliate links: we may earn a commission at no extra cost to you.

Related ideas

Presence-based lighting with mmWave

A mmWave sensor notices even a person sitting still, a light sensor keeps the lamp off in daylight, and the light fades out after the room is really empty.

  • Board ESP32-C3 SuperMini
  • Level ●●○ Intermediate
  • Build time 2–3 h
Pick parts / kit
⚠ Caution

Batteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.

Car and generator starter battery watch

Wakes rarely, measures the 12 V battery at rest and warns before it is too flat to start the engine, with almost no drain of its own.

  • Board ESP32-C3 SuperMini
  • Level ●●○ Intermediate
  • Build time 1–2 h
Pick parts / kit
⚠ Caution

Switch only low-voltage loads yourself. For mains loads use a certified isolated module in a box or call an electrician.

Router and Starlink watchdog

Pings the internet and power-cycles the router or ONU through a relay when the connection hangs, with a Telegram notice.

  • Board ESP32-C3 SuperMini
  • Level ●○○ Beginner
  • Build time 1 h
Pick parts / kit

← All module ideas →

Comments

No comments yet. Share your experience or ask a question.

Comments are moderated.