Bedroom night lights - under the bed light strip with motion sensor and a side lamp using ESP Home

So my wife keeps complaining that she’s finding herself in the dark all the time when she want 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 of 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:

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 worked 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 it’s 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](hThis text will be hiddenttps:// as it was just what I need, though it’s simple enough writing this kind of an automation, I’m a supper lazy ass.

I hope it will help someone trying to make a similar setup.
Here is the original post, I’ll try to make it up to date if something will break with this setup.



How many lights can the 5v 2A wall charger power?