Internet Christmas Tree is a Hit
I’ve modified the fireplace blower controller to control the Christmas tree lights.
At first, I wanted to get the Christmas tree lights to flicker like a candle flame. However, at about the time I programmed in the random function my Particle Photon stopped responding. None of the googled “flashing red light” solutions worked on my Photon. Hmmm, I’ll have to investigate this after Christmas, because trying to get the Photon unbricked was turning into a real time suck.
So, in order to keep moving ahead, I down rev’ed to my Spark Core, which is the previous generation of the Particle Photon. I got it working just in the nick of time. I wanted to show off my IoT Christmas Tree to my nephews and the rest of the family during the Christmas Skype call. Indeed, everyone at the far end of my Skype connection has fun turning the Christmas tree on and off, and changing the flickering characteristics after I gave them my secret web page.
The circuit consists of a Spark Core or Particle Photon, a homebrew optocoupler and a less than $2 AC motor controller from eBay. The optocoupler consists of a green LED which shines on a Light Dependant Resistor (LDR). The LDR is soldered in parallel with the motor speed controller control. The LDR has a lot of capacitance, so it smooth out the pulse width modulation (PWM) output from the Photon. I got the GL5537 Photoresistor from eBay and I had a 10 mA green LED in my junk box. I butted the green LED up against the LDR and held them together with a couple of layers of heat shrink tubing. A resistor of 680 to 1.5K in series with the LED limits current. Comercial versions are made by Vactrol or Silonex. The transfer function is very linear when graphed on a log/log scale.
Hardware costs should be less than $25, most of which is for the Photon.