Summary
I needed a lamp that doesn't glare into my eyes or onto the projection screen, while still putting some light on the table for my snacks. Lamp is 15cm tall, using RGB+CCD LED Strip, connected to my smart home via Wifi/MQTT, powered with 4x 18650 Li-Ion battery.
Change lamp color by publishing a message with content similar to "0,0,0,0,0". It's red, green, blue, warmwhite, coldwhite. Values are 0..255. If any of the R,G,B values are >0, WW and CW are reset to 0 to avoid overcurrent situations and weird colors.
All parts should be easy to print with little to no supports. Do use PETG though. PLA will make a brittle lamp.
BOM:
- print each part once
- 4x 10cm LED Strip https://www.led-konzept.de/RGBCCT-LED-Streifen-24V-197W-m-RGB-CCT
- 4x 10cm Aluminium profile https://www.led-konzept.de/LED-Alu-Profil-FLEX-mini
- 4x 18650 Battery holder https://www.amazon.de/gp/product/B075TZF7NN/
- 1x XT60 plug (male)
- 1x JST-XH balance plug (female), 2S (3 pin)
- 1x 24V Step-Up converter https://www.amazon.de/gp/product/B079H3YD8V/
- 1x 3.3V Step-Down converter https://www.amazon.de/Pololu-Step-Down-Regulator-Efficiency-2842/dp/B07KHPQLZT/
- 1x ESP8266 ESP-12 Barebone https://www.amazon.de/TECNOIOT-ESP-12F-ESP8266-Upgrade-Expansion/dp/B07WR96QDG/
- 5x IRLIZ 44N mosfets
- 5x 10kOhm resistors for the mosfet gates
- 5x 1kOhm resistors for the barebone ESP
- 1x 100nF ceramic capacitor for the barebone ESP
- 1x 22kOhm resistor for battery measurement
- 1x 2.2kOhm resistor for battery measurement
- 4x M3x16 screws
- 4x M3 nuts
- thin insulated wire (like 0.1mm PU-coated transformer wire / enamel wire) for the LEDs
- regular insulated wire for the rest of the wiring
- generic glue for fixing parts together like the plugs
...and a USB serial interface for programming the ESP.
Post-Printing
Mechanical
After printing, glue aluminium profiles into "LED Halter" and insert M3 nuts into the underside of "Lampenfuß Deckel". Solder wires to XT60 and JST-XH connectors (or buy connectors with wire or extension cords with those connectors and cut to length) and glue them into their sockets in "Lampenfuß".
Solder enamel wire to one of the 10cm LED strips at one end and guide them through the port into the arm. Glue LED strip in place with wire going into the arm. Glue other 3 LED strips in place. Connect them in each corner with all 6 wires.
Carefully push the "Arm" into the "LED Halter" and "Lampenfuß Deckel" without pinching the enamel wire.
Now comes the easy part: solder the electronics and you're done.
Electrical
No, I do not have a circuit diagram. It is "basic barebone ESP8266 wiring" plus 5 mosfets with series resistors plus two switching regulators. If this is too difficult for you, maybe choose a simpler project first.
As you can see from the pictures, I did free ratsnest soldering. Not pretty, but works with no PCB and fits into the tight spaces in this lamp.
Some explanation on what to connect where:
Connect 5x 1kOhm resistors to ESP8266 for basic functionality (there are lots of tutorials on the internet). Connect 100nF Capacitor between Vcc and GND of ESP8266 for basic spike protection. Connect battery holders in a 2S2P configuration, attach XT60 and JST-XH accordingly. Connect both voltage regulators to + and - of the 2S battery pack.
The 3.3V regulator powers the ESP, the step-up is adjusted to 24V and powers the LED (connect Vout+ to +24V on the LED strip). Both regulators share a common GND with the battery and the ESP.
The mosfets get a 10kOhm series resistor at the gate, connected to pins 4,5,12,13,14 of the ESP. Those will be used for PWM. Source goes to common ground, drain to each individual LED channel (the remaining enamel wires).
2.2kOhm and 22kOhm resistor form a voltage divider to get the 2S battery pack voltage down to a range the ESP's ADC can measure.
Software (the *.ino file)
In Arduino IDE, add the Library PubSubClient for MQTT and the ESP8266 package (https://arduino.esp8266.com/stable/package_esp8266com_index.json). For flashing, use "Generic ESP8266 Module", flash mode "DIO", reset method "no dtr".
You may want to change the topics used (mine begin with "smarthome/") to match your configuration. The subscribed topics (where the lamp is controlled with) are in "loop()". The published topic (where the battery status is reported) is in "timer60sFunc()".
You will need to change the Wifi and MQTT Broker settings at the beginning of the sketch to match your network.
Tags
Model Source
