MuTech RoboticsLearning Hub
Kids OK with adultArduino NanoLevel 2/3

Smart Bathroom Light

Motion lights switch off while you shower. This one uses motion AND a door sensor, so it stays on until the door opens again.

Sign in to save
Smart Bathroom Light
Kids OK, with an adult

DIY project. Children must build this only with an adult (16+ years) beside them at all times. Not suitable for children under 8 years.

12V LED strip only. Keep the Nano, MOSFET and adapter outside the wet area. Never wire 230V mains in a bathroom yourself.

Strictly follow the description given with this video.

Video

The video link will be added here soon.

How it works

  1. Door closed + motion seen = OCCUPIED, so the light stays on even if you stand still.
  2. The door opening ends the occupied state; the light fades off.
  3. At night the LDR reading switches the light to a soft 20% warm glow.
  4. A logic-level MOSFET dims the 12V strip with PWM from D9.

Parts you need

  • Arduino Nano₹345× 1Buy
  • PIR motion sensor× 1Buy
  • Reed switch module + magnet (door)× 1Buy
  • LDR module₹52× 1Buy
  • Logic-level MOSFET module× 1Buy
  • 12V warm-white LED strip (1 m)× 1Buy
  • 12V 2A adapter× 1Buy
Kit for this projectPrice on request
Get the kit

Wiring

PIROUTNanoD2D3A05VGNDD9VINDoor reedDOLDRAOAll sensor VCCAll sensor GNDMOSFETSIGGNDIN+IN−OUT+ / OUT−12V railGND railStrip+ / −Adapter+12V
PowerGroundSignal
#FromConnect to
1 SignalPIR OUTNano D2
2 SignalDoor reed DONano D3
3 SignalLDR AONano A0
4 PowerAll sensor VCCNano 5V
5 GroundAll sensor GNDNano GND
6 SignalMOSFET SIGNano D9 (PWM)
7 GroundMOSFET GNDNano GND
8 PowerMOSFET IN+12V rail
9 GroundMOSFET IN−GND rail
10 PowerMOSFET OUT+ / OUT−Strip + / −
11 PowerAdapter +12V12V rail
12 PowerNano VIN12V rail
13 GroundNano GNDGND rail
A wiring step from the video
A wiring step from the video

3D print files

  • pir_ceiling_dome.stlPETG · 0.2 mm · 20% · no supports · ~1 h 40 minDownload
  • door_reed_clips.stlPETG · 0.2 mm · 30% · no supports · ~35 minDownload

Code

The tested Arduino / ESP32 code for this project will be posted here, ready to copy.

Learn the idea behind it