NeoPixel Clock With Alarm

558

3

10

Introduction: NeoPixel Clock With Alarm

Hi guys,

get up early in the morning is sometimes hard. Especially when it is cloudy, raining or winter outside. Since I made my own a clock with alarm, getting up is much more enjoyable for me. :)

I used precise RTC module for controls the time and alarm. Two NeoPixel rings displays time ( btw. are you also fascinated by LED lights? ). A MP3 module controls audio output. And the setting is via bluetooth.

In this instructable I was a little inspired by the project NeoClock.

Step 1: Components

RTC module

As I wrote, I used precize RTC module from Sparkfun - the DeadOn RTC. The module is perfect for clocks, calendars, or any other time-keeping project. Communication between a microcontroller and RTC module is achieved using a four-wire SPI interface. When it's not powered via a primary source, the chip can be set to run on a backup battery. Sparkfun have written an Arduino library for the module, which takes care of all of the SPI communication. Sparkfun have written also DeadOn RTC Breakout Hookup Guide.


Serial MP3 Player

There are several modules on the market. I used Open-smart Serial MP3 module with speaker output. There are 3W amplifier on the desk.

There is also a TF card socket on board, so you can plug a micro SD card that stores audio files in MP3 or WAV format. I used a 8GB Kingston microSD card.

I used on-board speaker interface to connect external 8 ohm speaker. You can control the module by sending commands via UART TTL serial port, such as switch songs, change the volume and play mode and so on.

I wrote my own, very simple library to control start and stop the songs.


Bluetooth HC-06 module

I used this HC-06 bluetooth module for sending data from my phone to the clock. It adopts Bluetooth 2.0 standard. I used the bluetooth module for setting time, alarm, song, brightness, ... It works perfectly! It is not a problem to send data at a distance of several meters from the clock. There are no buttons and switches on the clock.

I installed Arduino bluetooth controller on my android phone. I connect to the module and enter commands through the terminal.

For example:

  • sa0600 - set alarm on 6:00
  • st1845 - set time on 18:45
  • sb80 - set brightness to 80
  • ps3 - play song number 3


Controller

I used the Arduino Nano model because is small and it works with a Mini-B USB cable. I used a terminal to fit controller and LM7805 voltage regulator, but this is not necessary.


NeoPixel rings

I used two NeoPixel Rings. Larger ring with 60 LEDs to display minutes and seconds. And smaller ring with 24 LEDs to display hours. I bought both rings on Aliexpress.

I received the larger ring damaged because it was fragile and it probably broke during rough transportation. :(

There is a very useful NeoPixel library for controlling LED ring from Adafruit.

Step 2: Box

I created the box on my CNC machine. I milled precise grooves on the front for two rings. I filled both grooves with epoxy resin. After hardening, the epoxy resin is sandable and polishable.

I used the head of a beetle as decoration, which I found dead in the forest in the summer. I also poured it into epoxy resin.

I milled a lion on the back side and painted it with gold.

Step 3: Wiring

The wiring is very simple and basically it is just to connect the module to the controller. I plugged in the power switch and DC Jack Socket.

I used small screws and hot melt glue gun to hold the modules in box.

Step 4: Coding

I placed all the code with all the necessary libraries and module documentation on the Github.

Be the First to Share

    Recommendations

    • Microcontroller Contest

      Microcontroller Contest
    • Automation Contest

      Automation Contest
    • Make it Glow Contest

      Make it Glow Contest

    10 Comments

    0
    Hero drent
    Hero drent

    Question 2 months ago on Step 4

    M, i like your clock idea. I already have it working using your ino file. I used a rts hc-05 instead of a hc-06 and it is working fine. But is there a possible way of using a 12 led ring for the hours and just step one led ahead every hour. Can you help me out with the software? Thank you very much. with the very best wishes. Hero Drent

    0
    Hero drent
    Hero drent

    Reply 2 months ago

    tom, thank you. but i do know nothing about programming c++.. The only thing i can image is to change %12 into %24. And of course use a 12 led ring instead a 24 led ring and change the 24 in 12 in the ino file. Maybe i have a little bit of stupidity but i am trying to learn something new. And at my age of 75 years young it is not always very easy . But i hope you will help me out.
    With the very best wishes. hero Drent

    0
    _Kibo
    _Kibo

    Reply 2 months ago

    Hi Hero.

    Ok, I write you yesterday. What is your problem? Do you only need exchange the 24ring to 12?

    0
    _Kibo
    _Kibo

    Reply 2 months ago

    Hi Hero
    1) I assume you have the Arduino IDE installed on your PC.

    2) I assume you have installed all the necessary libraries in your IDE:
    <SPI.h>
    <SparkFunDS3234RTC.h>
    <Adafruit_NeoPixel.h>
    <SoftwareSerial.h>
    <NeoPixelClock.h>
    <OSMp3.h>

    3)
    Change 24 to 12 on the line:
    https://github.com/Kibo/Neoclock/blob/master/src/N...

    5)
    Run your code, maybe it will work. If not continue:

    4)
    Comment the line:
    // hour = map(hour%12 , 0, 11, 0, 23);
    https://github.com/Kibo/Neoclock/blob/master/libs/NeoPixelClock/NeoPixelClock.cpp#L26


    6) Run your code, maybe it will work. If it does not work, correct the specified line.

    Good luck.

    0
    Hero drent
    Hero drent

    Reply 2 months ago

    tom, thank you very much. blocking out line 26 did the job. It will be apresent for my youngest grantdaugther. She will be 18 in february. She is very much in the korean popmusic at the moment. That's why the signs. See the including picture. with the very best wishes Hero

    eigenbouw klok voor annika.jpg
    0
    Hero drent
    Hero drent

    Reply 2 months ago

    tom. sorry but i was too enthousiastic. blocking line 26 did not do the job completely. the pm hours were ok but the am hours stayed dead. so i unblocked line 26 again and changed 23 in line 26 into 11 and the whole thing is working completely ok. thanks for the help. with the very best wishes. hero

    0
    _Kibo
    _Kibo

    Reply 2 months ago

    Hi Hero
    1) print the value of "hour" and look at this in console.
    https://github.com/Kibo/Neoclock/blob/master/libs/...
    void NeoPixelClock::update(uint8_t hour, uint8_t minute, uint8_t second){
    //hour = map(hour%12 , 0, 11, 0, 23);
    Serial.println(hour);

    2) Then corect the value of property "hour". Try:
    hour = hour%12;

    but, here is your job. You need to get 0 - 11.




    0
    Hero drent
    Hero drent

    Reply 2 months ago

    Tom, yes i only want to use a12 led ring for the 12 hours and keep all the other functionality. With the verg best wishes, Hero Drent