Back to the Circuit Board
One of the improvements to our new home has been to replace recessed lighting. In our home theater, there is a recessed area in the ceiling that had some old tube lights. We replaced those with WS2811 strips controlled by an Electrodragon controller. This looked great.
Next, we replaced the fluorescent recessed lights in the kitchen with warm white LED strips also controlled by the same Electrodragon controller.
We added additional recessed lights inside a glass cabinet to add to the effect. These have a great fade in and fade out effect when they’re turned on and off, which has a very modern feel.
We even used Home Assistant automation to make them turn on automatically using the motion sensor in our Ecobee. We don’t even think about the lights. They turn on when we walk into the kitchen and turn off when no motion has been detected. While this automation works pretty well, the Ecobee is far from the main cooking area. During a long cooking session, the lights tend to turn off while you’re in the middle of a dish. To rectify this, I wanted to add motion sensors to the boards. Unfortunately, these boards could not easily be hacked to handle input from some simple motion sensor components that work well with microcontrollers. I gave up after I fried two of them trying to hack them. So long, magic smoke; I know well the smell of failure.
The easiest course would have been to get a separate motion controller, mount it in the area, and configure a Home Assistant automation. But, this blog is not about ease! So, I revived some old Kicad schematics in an effort to design a board based on the ESP8266 that can control LEDs and receive input from the motion sensor.
The first version of the board failed to respond to the FTDI. In fact, the board quickly became uncomfortably hot to the touch when I supplied power! My initial suspicion was a problematic power supply. I was working with an LM2596 3.3V switching power supply to handle the large step down from the input power for the LEDs (24 VDC). I designed a second version of the board to use a 5V version of the switching regulator with a 3.3V AMS1117 linear regulator to try to provide a smoother power supply. Much to my chagrin, the result was the same.
I did a deep dive into my schematics and discovered the problem. When I dusted off those old Kicad schematics, the update introduced some abhorrent errors in the footprint for the ESP12 (my preferred ESP8266 variant). I decided it was time to roll up my sleeves and designed a much better board. After fixing erroneous footprints, converting many of my through-hole components to surface-mount components, and using both sides of the board for components to allow a significant decrease in the board size, I had version 3, which was a significant improvement.
A few weeks later, I finally had my new boards and new components ready to solder together! Imagine my disappointment when it didn’t work. But, at least there was a change! The ESP8266 was no longer getting hot, but my FTDI was! A little voltage checking revealed the board was getting no power even when supplied by an external 12 VDC source. A little schematics review revealed that I’d made one error in soldering, misreading the silkscreen for a catch diode, which was backwards. I flipped that diode under the close scrutiny of my daughter, and gave it another try. The board immediately connected and I was able to write a simple ESPHome program to test connectivity.
Next, I plan to 3D print a mount for the PSIR Motion Sensor and improve the kitchen automation.