WiFi-Controlled Nightlight with Wireless Charging!
This is a wireless nightlight that I designed for my children to use at night that would allow me to remotely control the brightness. It can also be used during the day with some funky light patterns. The main drivers were to have something which I could control the brightness/pattern etc but also that my boys wouldn't be able to play with once bedtime come. This is why I made it with no physical buttons or ports at all.
It allows the boys to control it from their tablets during the day and have fun but come nighttime I can enable the night time mode which goes white full brightness and gradually declines for 30 minutes to a low light which it stays at until the battery runs out or it's turned off.
Oh and I put wireless charging in because it's cool! :-)
Step 1: Check Out the Video!In the video, I explain the light and show it in action as well as the code and what to modify if you would like to check it out.
Step 2: What You'll Need3D-printed case: https://www.thingiverse.com/thing:3063300
The electronic parts used were:
NeoPixels: https://ebay.to/2wn663w
Lithium DC-DC: https://ebay.to/2w90laq
Wireless charger receiver: https://ebay.to/2w7W6fw
Wemos D1 mini: https://ebay.to/2OZWeo5
Small switch: https://ebay.to/2LhihVe
Small piece of perf board
Protected 18650 cell - it's important that it is a protected cell as the lithium charger module has no low current protection built-in.
Step 3: The 3D PrintI designed the case in Fusion 360, which is available here: https://www.thingiverse.com/thing:3063300
I printed the case on my Prusa Mk3. The tolerances worked out really well but it may depend on your printer. If required, you can always scale things down slightly.
I couldn't resist dropping the wireless charged receiver in for a test print mid print, was rather happy when it fitted first time!
I started assembly by installing the NeoPixel strip around the outside, I ended up with an extra LED as I started from the end rather than the begining but I should have only required 14 NeoPixels in my design, but ended up with one on the inside, just adds to the light though. :-)
I then installed the wireless charging module.
Make sure to trim the ferrite sheet which should have come with the wireless charger, place it on top of the coil and it will stop interference with the electronics.
Next, wire we need to wire up the DC to DC lithium board. On the board there shall be a Bat + and Bat - connection which you need to wire up to the 18650 cell holder.
Then, wire up the IN+ and IN- connections on the board to the output from the wireless charger receiver.
Next, you shall need to wire up the capacitor onto a small piece of perf board.
I found it easier to wire the legs through and then back up through the perf board to make a section where we can solder along to make large points to solder onto as we shall need to connect a few things to each leg of the capacitor. Place the resistor on the perf board, too.
Next solder all the connections and solder on the red and black wires to the corresponding legs on the capacitor( the negative side has a stripe on the capacitor) as shown. Also, solder on the resistor ready.
Now we have to do the last connections and solder on two wires from the VOUT+ and VOUT- to the corresponding legs on the capacitor putting the switch in line with the + wire, the switch shall have two connections so it's directly inline and connected to the + terminals only as shown
The next connection is to connect the NeoPixel signal wire to one side of the resistor then connect the other end to the D2 pin on the Wemos D1 mini.
Finally, connect direcly to the 5v and negative connections on the Wemos D1 mini to the connections on the capacitor. This is why we made tracks of sorts as we have soldered three wires onto each leg.
The board shall be fully soldered now and ready for programming.
Step 5: Programming and CodingThe code for the project is available at https://github.com/chickey/NightLight
Download the code and make any changes necessary, at the minimum you shall need to input your SSID and password. I would recommend looking at the serial monitor at this point and it shall show you the IP address which the board has gotten once you've flashed the code.
Next disconnect the Wemos from your computer and install the 18650 in the holder and place the top on the light and fire you your browser and navigate to the IP we recorded earlier and you should be presented with the following.
That's it your now finished enjoy :-)
Big thanks to Brian Lough who's code I used as a base for the web interface.
https://github.com/witnessmenow/ESP8266-IR-Remote-Example
Step 6: Conclusions and ImprovementsI am using the ws2812fx library which has a lot more visualisations of which I've only used a small sample, the list could be expanded with the other options available. Also, there are some great frameworks and examples out there for fancy interfaces so I may look into making it look a little more swish. :-)
I plan to increase the battery size as it shall be limited with a single 18650. I have various spare lithium cells but they are unprotected cells so I have some protection circuits on the way so that I can use one of these higher capacity cells.
Comments