The Night the Robots Enforced Bedtime

Reading is wonderful.
Sleep is also wonderful.

Unfortunately, my kids recently decided that reading is apparently more wonderful than sleep, and bedtime at 8 PM slowly started turning into… 9:30… 10:00… “just one more chapter, Dad.”

So naturally, I did the only reasonable thing:

I built a robot to enforce bedtime.

The Problem

We have two dedicated reading lamps — one for each girl. The rule is simple:

  • Bedtime is 8 PM
  • Reading is allowed for a bit
  • But not until “midnight library goblin mode” is activated

One night I found both of them still reading at 10 PM.

Reading is great, but over-tired kids the next morning are not.

Midnight Library Goblin Mode sketch
Midnight Library Goblin Mode — documented in the engineering notebook.

The Solution: A Gentle Robotic Nudge

Instead of yelling, reminding, negotiating, or threatening…

I automated it.

Here’s what the system does:

  • At 9:00 PM (on school nights):
    • If the lamps are still on → they flash off and back on 3 tmes
    • A gentle, unmissable warning
  • Five minutes later:
    • The lamps fade off automatically

No yelling. No surprise darkness. Just the quiet understanding that the system has spoken.

The Hardware (Because of Course I Rebuilt the Lamps)

These didn’t start out as smart lamps.

They were just normal touch-controlled 12V DC bedside lamps — tap to turn on, brightness levels, even a built-in USB charging port. Totally fine for normal people.

But I couldn’t leave well enough alone.

So I:

  • Removed the stock controller
  • Designed a custom ESP8266 (ESP-12E) control PCB
  • Added a BSS138 MOSFET DC dimmer stage
  • Regulated power with an AMS1117-3.3
  • Kept physical input via a TTP223 capacitive touch sensor
  • And flashed everything with ESPHome

Same lamp on the outside.
Entirely new personality on the inside.

Lamp teardown and PCB design sketch
The original lamp, rebuilt from the inside out.

One Important Tradeoff: The USB Port

The original lamp had a built-in USB charging port. After the retrofit That USB port no longer functions.

Supporting a protected, current-limited 5V USB output properly was intentionally left out of scope to keep the board simple and safe.

If someone really wants USB back, the clean solution is:

  • Add a dedicated 12V → 5V buck converter
  • Remove the USB connector from the buck module itself if it has one.
  • Then solder the lamp’s original USB jack wiring to those pads

Example module: https://a.co/d/jlBtOT4

Salvaging Parts (Bonus Maker Credit)

A few important pieces from the original lamp get re-used:

  • The spring contact that connects the PCB to the outer plastic touch surface
  • Optionally:
    • The BSS138 MOSFET
    • The 22pF capacitor that decouples the touch spring
    • The reverse-polarity protection diode

It keeps parts count down and keeps e-waste out of the bin.

The Loophole (Immediately Discovered)

When I explained how the automation worked, my 10-year-old immediately asked:

“And it doesn’t turn back on after that… right?”

Which told me two things:

  1. I respect her engineering instincts immensely.
  2. I absolutely will need a lockout automation someday.

But for now, there is no enforcement automation. No lockout, no override, and no forced fade-back-off. Just the robot reminding them… and a whole lot of trust.

The Parenting Layer: Trust First

Before enabling any kind of hard enforcement, I asked:

“Can I trust you?”

She said yes. So right now, the system is running on pure honor system. No enforcement.

The lamps warn and they fade off, but if someone really wanted to turn it back on, they absolutely could.

But the lockout automation is absolutely sitting in my back pocket… waiting quietly… like a firmware update.

Weekend Freedom

The automation is disabled on Fridays and Saturdays.

On weekends they can:

  • Read as long as they want
  • Stay up late (but in bed)
  • Become full book-powered goblins

Structure during the week. Freedom on the weekend. No arguments. No negotiation. Just rules the robot keeps.

Bonus Feature: Gentle Morning Wake‑Up

A nice side effect of converting these into fully controllable smart lamps is that I can now automate how the girls wake up, too.

Instead of an abrupt alarm, the lamp can:

  • Start at the lowest dimming level in the morning
  • Then very slowly ramp up over about 10 minutes

It’s a much calmer way to wake up — honestly slightly better than an alarm clock, and the same way Steph and I have been waking up for a long time now.

Nighttime discipline and gentle mornings, powered by the same little robot.

The Code & Hardware Are Open

Because this project turned into something genuinely useful, I published:

  • ✅ The ESPHome firmware
  • ✅ The KiCad hardware design
  • ✅ The OSH Park PCB link
  • ✅ Full documentation

You can find everything here:

👉 https://github.com/Indemnity83/lamp-control

If you want to build one, modify one, or just laugh at the fact that I automated bedtime with custom PCBs… it’s all there.

Final Verdict

Peaceful bedtime after automation
Robots: enforcing bedtime politely since 2025.

I used:

  • Home Assistant
  • Two reading lamps
  • One 10-year-old security auditor
  • One honor system
  • And one very polite robot

To solve bedtime without yelling.

10/10 — would automate parenting again.

Reactions

Did this resonate?

Kyle's Picture

About Kyle

Kyle is an incessant tinkerer, always working on projects and exploring new technologies. When he’s not in the workshop or behind the computer, he’s enjoying time with his family or traveling.