How to convert a 24-hour clock to 12-hour format?

I have a cheap clock I bough from China, but it doesn't support the 12-hour format. I thought perhaps I could add it with an Arduino Nano board I have lying around. Basically the sketch will need to read the PM LED indicator and the 4-digit 7-segment LED display to make the conversion from 24h to 12h. Does anyone have any ideas to accomplish that? If this could be done with a small sketch, what other boards could I use that are even cheaper?

I never saw a 24 hours clock with a AM/PM indicator. Can you show a picture ?

2 Likes

You could get a RTC (Real Time Clock) module, add that to your Arduino with a display and you have it. You may be able to use the clock case and display. If you can read the time as you indicate you can, simply test if the hours are greater then 12, subtract 12.

why???
Everything is much easier.
If the hours > 12 - it means PM, else - AM

@guix it also has a FM LED indicator, but the radio feature is missing. I was basically scammed.

And how are you going to change the method of displaying time on finished watches with the help of arduino? rewrite firmware?

@gilshultz I see. I was also thinking I could replace the board altogether, maybe to add some nice features like control the device via Google Home or Alexa, not sure if it can be done with the Arduino board I have though.

Why then this clock? it's easier to create everything from scratch on arduino

@b707 I hadn't thought about that, but you are right, to know whether it's AM or PM I just need to comprare the time with 12 as you said.

Maybe I'll have to disassembly the unit first to see if it uses some mass-produced chip that could be hacked to to that without the Arduino, or perhaps replace the stock board altogether.

I see your point. The clock has a rechargeable battery that lasts several hours even when using the unit as a Bluetooth speaker, that was basically the selling point for me, and the FM radio, but the radio feature is missing.

Maybe the best choice would be to replace the board with an Arduino to add some of the missing features.

@guix this is item I bought.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.