Sometimes when you start a project, you have a plan, and everything works out just as in the plan. Other times, you come up with quasi plan, encounter feature creep, run up against dead ends, almost loose interest, and then end up with something barely operational that looks very little like your original idea.

The “Plan”

I acquired a significant stack of white LED boards. The first question I asked myself was what kind of project can I do with these boards? I should have stopped right there, it seems like when I do a project because I have a bunch of something, it doesn't seem to turn out well. One of the first things that came to mind was my guest bathroom. It has no windows and you have to walk in about 1 meter (3 feet) to get at the light switch. The light switch is not easily in view while walking in. It tends to confuse people and I have to turn on the light for them.

The original plan was to make a theater style light and sound system. One of the first “experiences” the system would do was a simulated rain storm. The LED boards would go above the crown molding and could act as general lighting and also lightning. There would be an ESP8266 above the crown molding and also a Raspberry Pi in the closet. The Pi would detect if any one was entering the bathroom, control the video projector, and the audio. Speakers in the closet would be attached to the Pi, a sub-woofer in the closet would act as thunder and a small, cheap projector would show simulated rain hitting the floor or the wall.

What was actually done:

The crown molding and other molding was put up in the bathroom. The LED lights were installed and a Passive Infrared sensor detects when someone enters the bathroom and turns off 3 minutes after the last motion is detected. The only thing the ESP8266 does is a 400mS ramp up time for the LED's and a 400mS ramp down when the LED's turn off. (An instant on and off would annoy me)

None of the raspberry pi things in the closet were started.

Figure: The LED boards on the crown molding

Controller board details:

The controller above the crown molding is a custom PCB from OSH Park. The PCB has a NodeMCU 0.9 (which is an ESP8266 based board), ten MOSFET controlled outputs, and runs at 24V. The 3.3V is generated by a small switcher that almost fits onto a TO-220 footprint. The NodeMCU has PWM outputs on some of the I/O pins. These PWM's are sync'd to each other other. From past experience, having the PWM switching at the same time can cause a massive amount of electrical noise. So, the 74VHC14's were added in to allow some delay to be added to the PWM outputs. Only 7 of the 10 possible outputs were used. I had assumed the NodeMCU 0.9 and NodeMCU 1.0 board had the same footprint, they do not. The version 1.0 is more narrow than version 0.9.

Figure: The wifi PWM controller after reflow (no through hole parts populated yet)

Two, 24V, 2.5A were used to power the controller above the crown molding. Space up there is rather limited. A single, large, 24V, 5A power supply would have been visible above the crown molding. The PCB was designed so that up to four, 24V power supplies could have been used. A WS2812 (addressable RGB LED, also called Neopixels) output was added but not used.

Figure: The built up controller with the NodeMCU 0.9 board installed

One of the biggest feature creep items on this project was the software. The ESP-8266 arduino add on was used as the development system. For various reasons, the ESP 8266 was running in stand alone access point mode. I was not able to get Over The Air (OTA) updates operational. The final software has 7 sliders on the browser that can control the intensity of each of the outputs. The PWM is running at 170 Hz.

The Passive Infra Red sensor:

This PIR sensor was ordered from eBay. It was mounted above the door going into the bathroom. I wanted the sensor to trip when someone walked in the bathroom, but not trigger when someone walked by the bathroom.

The sensor seemed...

Read more »