Help for absolute novice - reprogramming melody on a cuckoo clock

Discussion in 'The Projects Forum' started by jenports, May 21, 2016.

  1. jenports

    Thread Starter New Member

    May 21, 2016

    I appreciate I am probably asking for help writing an essay in French when my knowledge extends as far as "bonjour", but I'm going to ask anyway (sorry).

    I've bought a novelty cuckoo-type clock:

    and I was wondering if it is possible to customise the tune that it plays on the hour? Well, possible for someone inexperienced like me to have a go? I've had a quick look inside and can see the separate components, including a circuit board with microchip. Bascially, there is a quartz clock movement and on the hour, a little melody plays and a motor moves a figurine. There is obviously already a speaker and also a light sensor that stops the melody playing overnight. So the hardware is in place and I don't really want to mess with the existing set up all that much. But is it possible, in theory, to just change the melody that plays by hooking it up to a PICkit?

    Is it naive to think that I can find a way to view the existing source code or hex file, figure out what part is the melody and change it? If I had to write the whole code myself then I guess I'm pushing it a bit but I would love to do it and am willing to invest time and money, so thought it was worth asking.
  2. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    Welcome to AAC!
    If the clock is a mass-produced one the code is likely in a one-time-programmable chip, and/or has been locked to prevent external read.
  3. jenports

    Thread Starter New Member

    May 21, 2016
    Hi Alec,

    Thanks for your fast response. Does a PICkit facilitate external reading (i.e., is using one how you would find out if it is locked)? I was thinking I could at least try to see if I can work with what I have, even though it sounds unlikely. If I can somehow locate the source code then I could look for a compatable chip to program and replace the one that's in there. I think?

    If the code required writing from scratch, would this be a reasonable project to research and work up to or are we talking quite advanced stuff? I'd love it to effectively be as simple as: when the clock movement is on the hour = turn this stuff on (in hex or whatever it needs to be). I can hook it up to the light sensor, clock movement, speaker and motor fairly easily but it's the whole circuit thing that's the sticking point. But you're all about circuits here, so I've come to the right place.
  4. Dodgydave

    AAC Fanatic!

    Jun 22, 2012
    Even if it was possible to read it, you can only get the hex file, that wont show you where to modify it.
  5. DNA Robotics


    Jun 13, 2014
    If those greeting cards that you can record a message or tune on are still available, you could put one of those in your clock. Disconnect their speaker and use their audio signal to trigger your greeting card circuit. Maybe with a comparator to trigger and a 555 timer to keep it going for the duration of your tune.
  6. KJ6EAD

    Senior Member

    Apr 30, 2011
    If your clock has a replaceable processor and it's associated memory and it's identifiable, there's a possibility of replacing their chip(s) with yours, but you'd be writing all of the code and only using their moving parts and audio amplifier/speaker. If they're using a COB, you'd probably need to build your own entire board to replace theirs. In either case, the second option is more likely to succeed since it requires less reverse engineering.

    Have you considered an Arduino? It's generally more accessible to beginners than a PIC.

    What inputs and outputs would you have to sense or control; hour indicator, light sensor, motor, LEDs, audio?

    Is the clock movement independent and sensed or driven by the processor which then needs a real-time-clock capability?

    These are the things you'd need to know and be prepared to control; not a trivial project for an "absolute novice".
    Last edited: May 22, 2016
  7. jenports

    Thread Starter New Member

    May 21, 2016
    Thank you all for your responses.

    I appreciate that, but if I were able to read it then with a bit of research and trial and error, I was hoping to identify the part that needs modifying and replace the chip.

    Good suggestion and I will bear it in mind if I can't get something to work with the existing hardware.

    KJ6EAD - these are the sorts of things I am thinking about but I don't know where to start. I recognise I would have to dedicate quite a lot of time to it and possibly end up building something from scratch. The inputs are the light sensor and some sort of hour indicator, the outputs are the motor and audio. The clock movement looks independent and sensed but I think I'm going to have to buy another clock before I start tinkering too much. The trouble is, I bought it on sale for £30 a few months ago and the only place I can find it now is on Amazon for over £100. I don't want to be left with no clock at all, but in that case perhaps it would spur me on to try and construct my own. I hope in a worst case scenario then I would be able to put back everything as it was.

    I will have a look into Arduino, I was hoping to use the existing parts but it is looking more likely I will need to write something myself, which I'm going to have to dedicate some serious time to. One last question (for now) - what is the best method to first of all see if I can read the programming on the existing chip? Would something like the Arduino Uno board be a good place to start and will there be an obvious way of telling if it's locked or can be read/edited/copied?
  8. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    To start, you would need to know the identity of the chip. What are the markings on it?
  9. Brevor

    Active Member

    Apr 9, 2011
    Or a good clear photo.