Lighting Up a Christmas Village
by BradenSunwold in Circuits > Electronics
239 Views, 2 Favorites, 0 Comments
Lighting Up a Christmas Village
This year, my wife and I began a new Christmas tradition and started our own Christmas village. We bought a set of mini lamp posts for the scene and I could not reframe from turning it into another electronics project...
In my defense the lamp posts were hollow, practically begging me to put an LED inside. I promised my wife it would be a quick and simple project. One PCB, some 3D prints, lots of magnets and a month of work later, here we are.
This project started innocent and simple. But I had other plans. I mean I couldn't just have exposed wires and loose batteries everywhere, right? And how hard could it be to design a little circuit to flicker the LEDs? And wouldn't it be cool if the lamp post used a magnetic connector to attach to the 3D printed base? It was time to start over engineering!
Checkout my YouTube channel to see the full build and final result!!
Huge thanks to PCBWay for sponsoring the 3D prints and PCBs to make this project possible! As always, they worked with me to ensure my boards and prints were made exactly as I needed and I received them within a week! Check them out for all your manufacturing needs!
Enclosures and Magnets
Earlier this year, I got my hands on some recycled vapes and harvested the batteries. This was the perfect chance to put them to good use. I wanted to design an enclosure that would hide the battery and electronics while keeping a low profile that could be buried in fake snow. I also needed easy access for charging batteries and maintenance.
I've been itching to play with some magnetic connectors and decided it would be really cool if the lamp posts magnetically attached to the 3D printed base. So when the magnetic connector snaps on to the base, it completes the circuit and the LED turns on. I found a two pin magnetic connector that was small enough to fit inside the lamp post base.
I used OnShape to CAD up all my 3D prints for this project. I created an adapter piece to fit inside the lamp post base with a cut out for the magnetic connector. Then I mocked up a base enclosure that would hold the battery, electronics and mating connector. Last, I made a cutout for a three position switch. I wanted one switch setting to enable LED flickering, one for constant on and one for off.
I also tried to use magnets to hold the lid onto the enclosure but I messed up the CAD and they didn't fit. So instead I turned to my trusty hot glue gun.
Now on to my favorite part, the electronics design.
Flicker Circuit
Again, huge thanks to PCBWay for sponsoring this project!
Once I decided to light up these lamps, I quickly started wondering how I could make them flicker like a real gas lamp. I had a few requirements. I wanted this to be a fully analog solution, so no microcontrollers. I also needed this to be small enough to fit in a low profile housing. And last, I didn't want the flickering of the LED to be distracting, I wanted it to be subtle and not just look like blinking. Flickering is the goal.
My initial googling lead me to this circuit for inspiration, LED Candle Flicker Effect. It was the exact effect I wanted and I even had some Schmitt trigger ICs laying around. Unfortunately, my Schmitt Triggers had too wide of hysteresis which meant the capacitors were charging / discharging right in the voltage range that would not toggle the Schmitt trigger output. But this circuit did point me in the right direction toward relaxation oscillators. Relaxation oscillators are basically just oscillators but with a capacitor thrown on the output so it appears more like a triangle wave than a square wave. This was perfect for my application because I wanted the LED to fade in and out, not turn straight on and off.
I also had some 555 timers laying around that seemed perfect for this. I cascaded three timers, all set at different frequencies. I tied each of these outputs to separate low pass filters with random RC constants. Finally, I summed all of these filter outputs into a BJT that would control the current through an LED. I played around with all the timer frequencies and low pass filter cutoffs until I got an LED output that looked quasi-random.
It was time to breadboard. Many jumpers and some value tweaking later... it actually worked! But one thing was bothering me. The LED was flickering but turning all the way off at some points. It was giving more Halloween than Christmas. I wanted to see if I could control the "aggressiveness" of the flicker. I biased the BJT through R2 for this. Increasing R2 caused a much more "aggressive" flicker where the LED would turn completely off at some points. You can see the LED current drops down near 0 at some points with a value of 20K ohm. Decreasing R2 made the LED not flicker as hard. You can see the LED current only drops down to ~28mA with a value of 5K ohm. I liked this effect much better.
Final Assembly
With values tweaked and PCBs soldered, it was time for the final assembly. You know what that means... time for hot glue!
I soldered the magnetic connector onto a warm tone LED and the mating side onto the PCB input. I glued the LED into the lamp base adapter print and glued the LED inside the lamp. Next I wired up the three way switch and glued everything onto the base enclosure.
The final effect looks fantastic and I can't wait to keep adding to this every year! Thanks for reading!