Musical Clock

Thread Starter

daneb23

Joined Nov 11, 2022
3
Newbie here, so please bear with me. I want to take an analog clock (with minute and hour hand) and have it play different sound snippets hourly. What would be the best (easiest, cheapest):
1) sensor and sensor placement;
2) 24 (hour) counter
3) Sound (mp3) decoder configuration?
Thank you!
 

Dave Lowther

Joined Sep 8, 2016
225
What would be the best (easiest, cheapest):
Does your hardware have to be battery powered or could it be powered from a mains power supply?
Do you have any experience with micro controllers?
My first reaction about how I'd do it myself, if I could power it from a power supply, would be to use an ESP32, get the time from the internet, no need to sense the clock hand positions assuming the analogue clock is showing the correct time. Use the ESP32 to play the mp3 files at the required time.
If the analogue clock is powered by one AA battery and you want to use the same battery to power your h/w then that's going to be more of a challenge.
 

Thread Starter

daneb23

Joined Nov 11, 2022
3
Thank you for the responses. I love the idea of the esp32, however I do want to somehow attach a sensor to the mechanism (or minute hand) in order to demonstrate the clock manually. The clock is for a project in a cnc class. It’s a wooden square with very basic mechanism powered by AA (see pic). I can add a 9v or whatever to power the circuit and speaker. The added functionality I’m wanting is and not a requirement for the project. I’m also taking a digital electronics class. I do have an UN0 R3 kit and 2560 R3 kit, but I’ve never actually used them.
FBE63285-7B09-4E81-990E-402B89B5A75F.jpeg
 

Dave Lowther

Joined Sep 8, 2016
225
I love the idea of the esp32, however I do want to somehow attach a sensor to the mechanism (or minute hand) <snip>I can add a 9v or whatever to power the circuit and speaker. <snip> I do have an UN0 R3 kit and 2560 R3 kit, but I’ve never actually used them.
I don't have any practical experience of sensing something like that. In your position I'd try sensing the minute hand in the 12 o'clock position. Maybe using something like this https://www.onsemi.com/pdf/datasheet/qre1113-d.pdf.
As you know, the Uno and 2560 don't come with built in internet connectivity. So it wouldn't be trivial to get the time from NTP (internet time service) using them. I don't know how accurate you would be able to make a 24 hour clock just using e.g. millis() with the Uno. It should be good enough though, in combination with knowing the minute hand is at the 12 o'clock position. I don't know if you want the sounds for each "o'clock" time to be specific to the hour, or whether just playing a different mp3 each hour would suffice. If you need to know the hour, and you will be able to connect to WiFi where you want to demo the clock, then I think an ESP32 would be easier than crafting your own 24 hour clock in software or adding a real time clock chip. Both of the latter would require you to have some way to set the time for your 24 hour clock.
 

MrSalts

Joined Apr 2, 2020
2,767
If you open the clock, you'll find a little coil and a mechanism that triggers the electromagnet once every second. You can count 3600 of them with a microcontroller or similar.
Or, you can use a retroreflective IR emitter/photodiode pair ( available as a single part) and place it behind out from the center, beyond the hour hand and near the minute hand. Drill a tiny hole and place it behind the clock face if you wish. Paint a small dot of white on the back of the minute hand to make sure it reflects the IR. Connect to a micro-amp comparitor input and a high resistance voltage divider (two resistors) on the second input. Connect the output to a resistor connected to + battery (in case you select an open collector style comparitor). Then connect the comparitor to your music maker's trigger.
 

Thread Starter

daneb23

Joined Nov 11, 2022
3
If you open the clock, you'll find a little coil and a mechanism that triggers the electromagnet once every second. You can count 3600 of them with a microcontroller or similar.
Or, you can use a retroreflective IR emitter/photodiode pair ( available as a single part) and place it behind out from the center, beyond the hour hand and near the minute hand. Drill a tiny hole and place it behind the clock face if you wish. Paint a small dot of white on the back of the minute hand to make sure it reflects the IR. Connect to a micro-amp comparitor input and a high resistance voltage divider (two resistors) on the second input. Connect the output to a resistor connected to + battery (in case you select an open collector style comparitor). Then connect the comparitor to your music maker's trigger.
I love the idea of the IR emitter. I found the MCP-6548 comparator on Amazon. Will that work? Ideally, the clock would play from 7am to midnight, then be quiet until the next morning. Thanks again.
 

MisterBill2

Joined Jan 23, 2018
18,508
The requirements stated in post #1 make it a bit of a challenge because of a different sound every hour, and being able to demonstrate it manually. That adds sensing the hour to the requirements. The simple way to sense hour hand position reliably and easily is with a coded reflective disk rotating with the hour hand, since it is on the bottom of the stack. Four bits binary will be needed, but they can be one in each quadrant, making assembly easier but figuring out the binary code more challenging. Then one more sensor to detect the minute hand straight up. For power saving it will be simple to only power the hour sense when the minute is straight up.
Of course, with the added sensors and the micro to decode them there will need to be external power, not just that AA battery in the clock.
 
Top