So my wife keeps complaining that she’s finding herself in the dark all the time when she wants to wake up before me or get in bed after I’m already snoring away.
Had a few spare hours, so I had to make this little project –
I decided to have an automated PIR sensor connected to a short 5v LED light under the bed, which will not interrupt me shooting Zzzz.
Also, recently my Ikea Zigbee bulb decided to crap the bed, it’s only turning on but won’t connect to the network anymore.
That wouldn’t bother me as much, but it’s set to the brightest setting and there is no way to control it.
I have a circular led board that I’ve wanted to attach to my 3d printer printing head, but it’s too big. So here is my chance to make it useful.
So I’ve been sketching out and also had the idea to power this baby from a single source of power, as all the consumers will be 5V and the LEDs won’t be on for long on the same time anyway.
A spare board of D1 mini, PIR sensor and off we go.
Of course, everything will be connected to my smart home setup via ESP Home.
Stuff I’ve been using:
- x1 5V LED strip
- x1 5V LED Circle Ring board
- x1 D1 mini board
- x1 PIR sensor (AM312)
- Some wires
- USB to micro USB cable
- 2A 5V Power supply
- 3d printed case, you can find some models here
Here is the scheme:
Basically, I’ve connected the 5V USB output to the LEDs and the D1 mini board.
Connected all grounds. PIR sensor didn’t work on 3.3V, it did on 5V.
I’m using AM312 as it prevents most false-positives and cheap.
After printing a flimsy case, got some Velcro male sides and fixed those wires to my bed, as its outsides made out of fabric thick enough to be “sticky” with Velcro.
Time to handle the Ikea lamp. I’ve just took the lamp and the cap off, wiggle it around, and it fits like magic! Some cable management and we are done!
And here is the YAML for the ESP home:
Of course, I’ve used an automation to turn on and off the LED under the bed, after validating everything is working. I’ve used this blueprint as it was just what I need, though it’s simple enough writing this kind of automation, I’m a supper lazy ass.
I hope it will help someone that is trying to make a similar setup.