Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: Making a Cuckoo-Clock with Teensy

  1. #1

    Making a Cuckoo-Clock with Teensy

    Making a Cockoo-Clock with teensy.

    Hi, perhaps this is an idea for a project of some other people. At least I had some fun with it…

    A cockoo clock is a clock hanging at a wall. It has a small window which opens every full hour. A little bird comes out of the window and calls "Kuckuck". These clocks have a great tradition in the Blackforest in South Germany. I live some 150km from this region. When I saw such clocks at a tourist shop there some weeks ago, I thought this would be fun.
    Normally everything is done by mechanics which would be a very big task. But with microcontrollers everything is much simpler at least when you can reuse a lot of the work of others - many thanks to all!

    So the goal was to make a clock (shows time), which mechanicly opens a small window every full hour, shows a bird and lets the bird sing. And closes the window shutter again.

    I was very happy, when I discovered that you can buy rings with 12 multicolour Neopixels from adafruit. These give a nice display. I think this has more style than a digital text display and it is much simpler than a mechanical clock face.

    The bird normally moves with a linear movement on a kind of sled. This was simplified to circular movement. A small platform has the shutter of the window fixed to it and carries the bird. It is directly fixed to a rc-servo axle. So the swing of the servo opens the shutter and brings the bird forward at the same time.

    Of course the bird must sing at full hours, so you need a possibility to output sound, which is done using *.wav files together with the DAC of the teensy and with the sound library.

    Function Hardware Library Comment (The following lines should be a table)

    Time: Built-In Timer TimeLib

    Set time accurately: Receiver for time broadcast DCF77 (Pollin) DCF77 Library hat to be modified slightly because of different interrupts. Because of automatic time setting, no user buttons are needed.

    LED (13) for indication of reception
    LED blinks 3 times, if the last correct reception was within last hour
    2 times if it was within one day and
    1 time per signal (signal is copied to LED) if the reception was not yet correct or if it was longer ago than one day.

    Open/Close Shutter: show bird Rc-servo, high quality for low noise PWMservo
    The servo brings noise into the audio output. To minimise this, the pwm signal is shut down after movement (make pin input). In addition a RC filter of 47 Ohms and 470µF is used at the 5V supply of the LM386.

    Clock face: Adafruit Neopixel Ring, WS2812Serial Small addition to deal with 4 LEDs per pixel. See function "setPixel".
    The LEDs are very bright, so they are used only with 1/255 (White) and 10/255 (others) of their power.
    Red indicates hours.
    Green indicates minutes in steps of 5.
    Blue shows at 5 seconds intervals.
    White shows the 12 positions of the face constantly.

    Let bird sing: SD-card to hold wav- Files, See example WAV player There are nice WAV files on the internet. To convert them to 16bit, 44.1kHz you can use Audacity. So the bird is not allways a cockoo….
    DAC 12-bit
    Small amp with LM386 and small loud speaker The amp is as included in the datasheet of LM386.

    Multitasking TeensyThreads Simplifies programming a lot and is easy to use! There are 4 tasks:
    1. Check DCF77 reception and indicate its status
    2. Set the clock if new broadcast available
    3. Display the time
    4. Normal loop: Show bird and start to play WAV

    I took some time to consider, which controller would be best to use. (Original Arduino, Arduino with BASCOM, Arduino M0, Raspi, Parallax Propeller, Teensy 3.2, 3.5)
    I choose Teensy 3.5 mainly because of the audio library, the DAC and the SD-card, DCF77-library for Arduino. Fallback would have been the audio shield. With a raspi I would have used internet time with wlan instead of DCF77. Of course Teensy 3.5 needs only about 7% of its memory and you could solder a SD-card to 3.2….
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	20180722_154243.jpg 
Views:	78 
Size:	60.7 KB 
ID:	14880  
    Attached Files Attached Files

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Germany NRW
    Das ist ja mal ne witzige Idee

  3. #3
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Colmar, France

  4. #4
    Join Date
    Sep 2014
    South Dundas, Ontario, Canada
    Quote Originally Posted by Theremingenieur View Post
    I still have one of those clocks.

  5. #5
    ... tried to correct orientation of the image....

  6. #6
    Thanks to pjrc and the guys who have made all the libraries. I just want to say, that the clock works completely stable for some months now 7/24.
    😊 Christof

  7. #7
    Administrator Robin's Avatar
    Join Date
    Oct 2012
    PJRC Global Headquarters
    I would like to feature this project on our blog. Do you have any more pictures of it?

  8. #8
    Click image for larger version. 

Name:	IMG_20190705_072022-600x800.jpg 
Views:	19 
Size:	73.6 KB 
ID:	16915
    Click image for larger version. 

Name:	IMG_20190705_072301-600x800.jpg 
Views:	18 
Size:	76.8 KB 
ID:	16916

    Hi, perhaps this works?
    Best regards Christof

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts