WS2812B Wake-up lamp


This is a new project I’ve been working on: a small “smart lamp” that will create some programmable lighting patterns.
The main usage will be to help me wake up in the morning by beginning a light pattern before the alarm clock. It should be able to simulate some sort of sunrise, etc.

The board also has 2 external connectors, one that exposes a full USART port with hardware flow control. The other one exposes a SPI interface.
There is also an USB – USART interface created by a MCP2221 chip.

The chosen leds are the WS2812B ‘smart leds’ in a 4 pin 5050 case.
The are connected in series, in a 4×4 matrix covering a square of 50x50mm of the board area.

The main micro-controller is STM32F030C6T6 in a 7x7mm LQFP48 package.

The board is designed to work from 6 to 12V. The input voltage passes trough a 1A PTC re-settable fuse then it’s converted to the main 5V rail by a ADP2303ARDZ-5.0-R7 fixed buck regulator. The regulator is bypassed by 2x47uF and 1x100nF ceramic capacitors.
[singlepic id=85 w= h= float=none]

The main 5V rail splits to the led power bus and to the CPU power line via a 1N4148 diode.
The diode allows powering up only the 5V cpu rail from the back-up capacitor or usb-connector.
On the 5V cpu line there is a 2.54mm header for connecting an 1F back-up capacitor. There is also a sense wire that will tell the cpu when the main 5V supply is down.
The 3.3V rail is generated with a TPS79333DBVR LDO.
[singlepic id=79 w= h= float=none]

The 48 pin cpu does not have a separate RTC VBAT pin, so the software must detect when the main supply is off and switch to a low power state where only the RTC is active and generating periodic wake-up events for the main CPU ( to check that the 5V rail is back )

All unused cpu pins are brought out with 0.7mm vias to allow the user to connect to them using hook-up wire.
The same applies for the unused pins of the usb-serial converter.

The final design will use an ESP8266 WIFI module to create an user-interface.
It will be able to get network time ( no need for the RTC capacitor ), allow an user to configure wake-up time and light pattern, and maybe allow a mobile device to generate notifications ( bitmaps or small animations )
I will also add one or more buttons to reset notifications and enter initial configuration mode.

The USB-USART converter will be used to configure the ESP8266 module using the main CPU as a data bridge.

The PCB is quite simple. I’ve used a 1000x50mm board so it would be easy to place all required headers and easy to probe stuff.
It could be easily “folded” in 50x50mm by using a 4 layer board and choosing smaller parts and SMD connectors.

The DC-DC converter area is using planes instead of traces, to increase current capacity. Also, I’ve placed a lot of vias in that area, for the same reason. The solder mask is pulled back from some specific areas to allow the bottom pad of the buck converter to be soldered from the bottom side.

The entire lay-out is done in KiCad.
There is one major mistake: I forgot to remove copper around the 4 3mm mounting holes. This poses the risk of having the holes connected to board’s GND, and near the inductor there is a high chance of shorting the main 5V rail.
Another one is the USB-SERIAL power line – it should be powered up only by 5V usb, not by the RTC. It’s an easy bodge if needed: cut the 5V_USB line and add a diode if there is the need to power up the board from the 5V usb.
[singlepic id=77 w= h= float=none]
[singlepic id=78 w= h= float=none]

Here are some photos of the assembled board.
It’s still dirty with flux.
The blue wire is used for a temporary connection for the LED data line, to allow easy measuring of that signal.
There is no picture of the working board – the LED’s glare is so strong that my phone is not able to take a proper photo.
[singlepic id=80 w= h= float=none]
[singlepic id=81 w= h= float=none]
[singlepic id=82 w= h= float=none]
[singlepic id=83 w= h= float=none]
[singlepic id=84 w= h= float=none]

The schematic is available here: wakeUpLamp schematic
The KiCad files are available here: wakeUpLamp KiCad project

Comments are disabled