Microcontroller projects

The Neo Clock

last updated: 04/01/20

Introduction

I had a rest of a Neopixel stripe laying around (144 RGB LEDs/m), and one hour has 60 minutes, and Christmas on the doorstep :). So here is the neo clock.

Features:

neo lock front neo lock back

I had to manipulate the sound a little bit (to much noise), so the ticks are not sounding real. The sound would be better if I haven't forgotten the sound holes for the speaker in the housing :).

Hardware

3D prints

The pieces are designed with FreeCAD and can be customized (e.g. clock text, supplementary holes for the speaker). A little support is needed for the stand and the housing. The cover is printed in 2 colors. One extruder is enough. The print is stopped at 1 mm and continued after changing the filament as described on http://weigu.lu/other_projects/3d_printing/index.html.

lamp lamp lamp

The files can be downloaded at the end of the page or on thingiverse.

The stripe (60 LEDs) has a length off about 411 mm that gives a radius of 65,4 mm for our internal cylinder. We need no supplementary power supply because normally there are only 3 LEDs lit (3*20 mA).

Microcontroller, Stripe, RTC and Light sensor

The microcontroller is a Wemos/Lolin D1 mini pro.

The RTC connected via I²C is a Max 3231. I used a breakout board similar to this one and desoldered the power LED (too bright).

An I²C Light sensor from Adafruit (TSL2561) helps to adjust the brightness of the LED's.

The LED stripe uses 144 WS2812B LEDs/m (bought on aliexpress).

The two I²C boards are connected to SDA (4) and SCL (5) and powered with 3.3 V. I added an 100 µF Elco to 3.3 V. The stripe is powered with 5 V. I added an 1000 µF Elco to 5 V. Both Elco's are optional. The stripe data line is connected to pin 14 with a 100 Ω resistor in series. A piezo speaker is connected to pin 13.

neo lock hardware neo lock hardware neo lock hardware

neo lock hardware

Software

The software gets the time over NTP and set's the RTC once a day. The light sensor is used to set the brightness of the neopixel. With the help of the speaker it is possible to play songs, to let the clock tick every second or to use the clock as alarm clock. More infos on that code can be found ob http://weigu.lu/microcontroller/tips_tricks/audio_tips_tricks/index.html.

After programming the clock, I got a watchdog hardware (cause 4) resets 1-2 times per hour. More infos on watchdog resets: http://weigu.lu/microcontroller/tips_tricks/watchdog_tips_tricks/index.html. After a lot of research I found that the Adafruit Neopixel library was the culprit. I changed to the FastLED library and there were no more problems.

Downloads