Single controller with RTC to multiple clocks

Hi all

I am thinking of doing a project where i want to place 4 or more clocks around my house and have them always showing the same time from a Mega2560 (with DS3231)

The distances between the clocks to the Mega varies from 5 meters to 30 meters (it's not a large house, just the cables needs to be routed around the rooms).

I'm thinking of using 4 pcs of 7-Segment Display - 6.5" (7-Segment Display - 6.5" (Red) - COM-08530 - SparkFun Electronics) for each room, ideally powered through the CAT6 UTP network cables that I plan to use. Not a major concern if it cannot be powered remotely - i can always use a AC-DC power adapter to drive this if needed)

I don't need alarms etc, just a clock to show time - does anyone have experience doing this ? My main concern is whether the signal from the DS3231 is strong enough when it reaches the end of the cable where the 7 segment displays are located.

Am i on the right track or there are better ways to do this ?

Personally, I would not want cables all over the place. If you have a wlan, then a nicer option is to use, say, ESP8266 devices and get the time from the internet (Google Arduino NTP clock). If you use a timezone library, you never have to adjust these (for Daylight Saving Time) and they will all be synchronised with each other.
You are buying nice and expensive displays, so it is worth putting some resources into the clock part to make that clean and robust. With a 4/6 digit display, you can even scroll the date across it periodically.

@ 6v6gt - I had thoughts of using wireless to do this but ideally if i can deliver power to the LED segments via the network cables, it would "save" a AC outlet in my rooms

Honestly, i've not decided whether should i go for the 6.5 inch versions - 3 inches would probably suffice :grinning:

I notice you put "save" in quotes, wisely implying that it is a relative term. Perhaps a some double adapters would be helpful, and even save you from doing something you will later regret.

What you are trying to do is make a "master clock" system.

It seems your main problem is: how should the "master clock" communicate with the "slave clocks"?

I don't really have any advice for you, I'm just posting this so you will know what words to google.

I have used 433Mhz TX/RX modules for this.

Also interesting: how exact has this sync to be. 4-digit clocks implies HH:MM so not even displaying seconds.
Is a few seconds off acceptable for this? Or do you need it down to a few milliseconds?

Then the power. 20 mA per segment, so up to 140 mA per segment, 560 mA total. That's a lot for a CAT5 cable, and you'll run into serious transmission losses on the longer wires (expect in the tune of 5Ω for 60 meters of wire - or 10Ω including the return, that'd be a 5.6V drop if all segments are on - so less segments on will make them shine quite a bit brighter).

Hence putting an accurate RTC in every clock instead might make sense. :slight_smile:

Or an ESP8266 and get time over NTP - that's probably the most accurate (and easiest to get them in sync).

Hi all

Thanks for all the replies - my first choice would be to use wires where possible since i have the network cables built in already and i'm trying to learn more about wired communication protocols.

The generic idea was to have :

a. RTC at Mega to update the 7 segment LEDs via network cables.

  1. I did some searching and it seems that i2c is probably the best way to go if i wanted to use the network cables - apparently there's a i2c range extender (Extend the reach of your i2c sensor simply and inexpensively - Hackster.io)

Thinking deeper, it might be worthwhile to have a RTC at each slave clock as well if the master fails for any reason. So the time updates would look something like -

Mega requests time from Master RTC
Master RTC sends time to Mega
Mega sends updated time via i2c (P82B715P) to Slave 1 (P82B715P)
Slave 1 updates own RTC and updates 7 segment display

Does this make any sense ?

b. Power supply at Mega to supply power to the 7 segment LEDs via network cables
Now, i must admit, i'm not very good at power supplies so go easy on me please. , would it be possible to have a DC-DC boost converter (Step up) at the Mega side and DC-DC buck converter (Step down) for the power pins required to power the 7 segment display + RTC + P82B715P ?

If you would use a step-up converter, you'd increase the current in wires proportionally.
You need 12V and 560 mA, so 6.72W

Now it gets tricky as you have a non-negligible input impedance 10Ω, so the increased current means increased voltage drop, and you have to increase the current some more until you have enough current to produce the desired 12V.
Maximum power used by the LEDs (when all are lit): P = Vout * Iout = 12 * 0.56 = 6.72 W.

So for the regulator:
Vout * Iout = 0.9 * Vin * Iin = 6.72

Voltage drop due to wire resistance: Vwire = 10 * Iin

This gives the regulator input voltage:
Vin = 12 - Vwire = 12 - 10 * Iin

Substitute that in the formula above:
0.9 * (12 - 10 * Iin) * Iin = 6.72

This is a quadratic equation:
9 * Iin2 - 10.8 * Iin + 6.72 = 0

Which interestingly has no real solutions for Iin. That implies the wire resistance is too high to make this work at all, without boosting the voltage at the supply side - but then the voltage at the display side still varies depending on the actual current drawn.
Of course the current I mentioned is worst case (all segments lit, but that should be your design consideration. Your actual wire resistance may also be less (or more) depending on the actual wire used and the actual length of the wires.

Now you want to connect multiple clocks to the same set of wires - this would multiply the current on the wires based on the number of clocks you have. To a certain extent you may be able to bundle wires, but that's just a small offset, and not likely you can supply enough power to the clocks.

Sending low voltage power over cat5/6 is not very efficient, as already pointed out. It's more efficient to transmit power over distances at high voltage. You already have wires all over the house that do that.

I favour the suggestion already given by several forum members above. Use esp8266 and NTP time. I recommend Wemos Mini. Even the Lite version will be fine for this.
s-l225 (7).jpg
Driving large displays is one of your next design concerns. Especially colours other than red. Even 3" red displays will probably have a forward voltage of 6V+, because each segment will have 3 LEDs in series (except the decimal points, so be careful if you plan to use those). Do you have a circuit in mind for this? Max7219 and ht16k33 chips won't drive large displays without extra circuitry that will probably mean they are not the simplest approach. The ideal chip would be saa1064 but they are rare and expensive these days, especially in DIP form
s-l225 (8).jpg
(although you can buy the surface mount version on an adaptor).
s-l300 (9).jpg

s-l300 (9).jpg

s-l225 (7).jpg

s-l225 (8).jpg

@PaulRB

I'll probably try the wireless approach sometime in the near future but right now i want to learn more about i2c and how it works for a future project

Thanks for point me to the saa1064, i'll do some reading into that chip see how it works.

i did more seaching and found this DIY 6 digit LED Large Screen

Size is just right, has RTC, takes external power. Only downside is the time i've to spend soldering the LEDs individually. :frowning:

If i choose the wireless route, i would need :
4 x DIY clock
4 x AC-DC PSU (for clock)
4 x Esp8266
1 x Wifi board for Mega

If i persist in the wired route, i would need :
4 x DIY clock
4 x AC-DC PSU (for clock)
8 x i2c range extender (4 tx, 4 rx, assuming RTC on clock is i2c capable)
1 x Mega

Just thinking out loud, if i have a RTC at each clock, i could remotely program each clock to have a different alarm timing right ? Now if i can program the whole thing to do something like - Kids wake up for school at 0600hrs , Remind helper to pick up kids at 1300hrs, countdown to what time to leave the house etc, etc . LOL i'm going way too complicated right now!

I2C is not intended for long cable runs. I don't doubt that a range extender exists somewhere, but even with that I don't think it's really going to be reliable over 20-30M distances. Someone may have had success, but there's a good chance you may not.

Both options come with:

4 x AC-DC PSU (for clock)

Don't bother with trying to communicate over wires when you have WiFi available. NTC is also going to be more accurate than you can ever get when manually trying to set time, and then trying to communicate that to the various clocks.
The ESP8266 can be reprogrammed OTA making updates super easy.

@wvmarle - I hear you about the wireless part but it's a learning journey for me - my background is in network communications specifically wired/wireless LAN so i'm pretty comfortable setting up a Ethernet network be it wired or wireless but it does not give me much insight to the protocols i'm trying to learn i.e i2c, SPI, RS232/422/485 etc

In my pursuit for knowledge, i started to understand that i2c wasn't designed for long distance (more than 5 meters), RS485 is a probably a better candidate but i do not need the extreme range that 485 offers, so i'm curious about how far can i drive a i2c signal across say a cheap CAT5e F/UTP cable compared to a CAT6a F/UTP or even a CAT7a S/FTP cable.

Besides, before wireless - what was the solution ?

gp2700:
RS485 is a probably a better candidate but i do not need the extreme range that 485 offers

That is some strange logic. Wouldn't the fact that it is better outweigh the debatable disadvantage that it is much better than what you need? It's not like the cost is sky high.

Before wireless, things were a pain. RS232 or 20mA current loop was common for such things.

Using "better" CAT cable won't help you much in an application that it was not designed for. Why create a huge headache for yourself when there are many straightforward methods as have been put forth in this thread?

oops my bad, i've not really looked at the cost of using RS485. Unfortunately i'm also not very sure how to send and receive signals from Arduino to remote clock using RS485. - will do some reading tonight

Unfortunately, you're also right about the higher category cables - most of the spec sheets that i looked at for the varies types of UTP or F/UTP cables are generally less than 330pF/100m, so if i'm going to be using the P82B715P (limit of 400pF/100m), it should, in theory be workable at 100 meters regardless for category. The only difference i can see is really the wire gauge.

If i choose the wireless route, i would need :
4 x DIY clock
4 x AC-DC PSU (for clock)
4 x Esp8266
1 x Wifi board for Mega

You won't need the WiFi board for the Mega. Or the Mega. Save that for your next project.

What you may need, unfortunately, is more regulators. The display may need 7.5V, 9V or 12V. The Wemos can take a Max of 5.5V. So you will need a 5V regulator for each clock that can accept your power supply's voltage.

it does not give me much insight to the protocols i'm trying to learn i.e i2c, SPI, RS232/422/485 etc

You should be learning that i2c, SPI, Rs232 are not appropriate for this project. Rs485 maybe, but WiFi will be easier & cheaper.

If you insist on using the wires, RS485 is the most suitable protocol. It's designed for long distances. RS232 can do a fair distance, while I2C and SPI are primarily meant for on-PCB use or for connecting PCBs over short wires. That the maximum range is way more than what you need should be a plus for choosing this protocol.

The MAX485 chips (or, if you use a WeMOS, the MAX3485 chips) you need to interface with an Arduino are cheap. You need one on each side.

When it comes to regulators: the NodeMCU boards can actually operate directly off 12V, but I've had overheating problems when using the WiFi for regular communication (the regulator is not really up to the job). So you have to minimise WiFi communication, then you should be able to get away with this. Better ventilation may also help, mine were seriously enclosed.