KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

First Pi Project - Multi-Timezone Clock

Sun Apr 15, 2018 1:51 am

Hello all,

I am looking for some guidance on my first Raspberry Pi project. What I am attempting to do is create a very large, multi-timezone clock using very large "7 segment" displays. These are not your typical LED displays. I am using some cheap clocks off of ebay (8.5" x 3") as purchasing large (>2") 7 segment LED's are quite expensive. I can get these clocks for about $15 each all day long. I will probably have to re-wire the display in them, I'm already prepared for that. If I cant use their SMD mounted LED's directly I will put in my own 5mm white LED's, but that's not my main issue.

This is my first real electronics project in some time. I'm no electrical engineer, but I have had military and college electronics courses. I have not done anything with a Pi before and my previous mbed project didnt exactly turn out as hoped.

I have a Model 1 B+ Pi which I hope is more than enough for this project.

Current thoughts:
I am not using the clocks in their consumer configuration because it is a pain in the ass to set them all, and nearly impossible to keep them in sync. I will black-out the AM/PM lights as this will be used in 24-hour mode only.

Since these clocks will all share the same minute info, I am hoping I can just tie those digits together across all 7 clocks. Not as flexible, but reduces the complexity (I think).

Some of these time zones do enjoy Daylight Savings Time (DST) so I have to factor that in for 3 of the displays. Might need a DST light to indicate if its in affect.

I am handy with Bash/Perl, not so much with Python. I can easily use the linux OS date commands to extract the data from the system clock. I am not sure how I get this info to the display.

The length of this clock will be nearly 7 feet when completed, so there will be some significant wire runs, which introduces resistance and interference. I plan to keep the pi in the middle of the clock.

Here is a pic of a single clock next to the Pi for scale:
IMG_0114.jpg
IMG_0114.jpg (117.12 KiB) Viewed 2122 times
Here are some measurements and labels on my display:
Clock.jpeg
Clock.jpeg (240.63 KiB) Viewed 2122 times
As you can imagine, searching for "clock" in an electronics forum brings back many unusable results. If you have seen a similar project or know of a project that has pieces that might be useful to me, I would appreciate a link.

If you have any ideas on how I should approach this, to be as simple and efficient as possible, I'd also love to hear about it. I am scouring SparkFun and Adafruit for ideas as well as looking through this forum.

I guess my first question is how much extra stuff will I need to drive all of these displays from the Pi? Is a serial driver the best way to go? Should I use something like a pair of MAX7219CNG chips to control all of the segments?

Kind regards,

-Ken

User avatar
neilgl
Posts: 648
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 15, 2018 5:08 pm

Take a look at this it may be useful

https://github.com/rm-hull/luma.led_matrix

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 15, 2018 9:08 pm

neilgl wrote:
Sun Apr 15, 2018 5:08 pm
Take a look at this it may be useful

https://github.com/rm-hull/luma.led_matrix
Thanks! That does look useful.

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 22, 2018 6:50 am

I'm off to the races!

Before I get carried away with modifying the cheap ebay clock, I decided I would purchase 3 of the 1.2" LED displays and backpacks from Adafruit to see if I could get the basics working first. It turned out to be pretty simple thanks to their libraries and sample code. Each display is controlled via I2C and the address is easily selectable using the solder pads on the backpack. I have all 3 connected and I am running a separate display test program on all 3 simultaneously.
IMG_0121.jpg
IMG_0121.jpg (219.38 KiB) Viewed 2045 times
So that all works and I am confident I can add 4 more using the same process.

This brings up a question of power. I am reading in the forums that there is about 200mA to play with on the +5v pin of the Pi. I dont think that will be sufficient for all of my displays once they are all connected. How can I provide additional power without roasting the Pi?

I bought a nice bench power supply and tried to provide +5v to the displays directly while leaving the I2C connections on the Pi, but that didnt work at all (I didnt think it would, but I'm not sure why). Probably lucky I didnt fry anything.

Also, is there an alternate power input on the Pi other than the USB port? If I wanted to power it from my bench supply, should I just get a USB/Banana plug cable, or is there a header on the board that doesnt bypass all the circuit protection?

User avatar
rpdom
Posts: 14757
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 22, 2018 9:52 am

KenK73 wrote:
Sun Apr 22, 2018 6:50 am
This brings up a question of power. I am reading in the forums that there is about 200mA to play with on the +5v pin of the Pi.
I think that related to the original Pi 1B which needed about 500mA to run and was fused at 700mA.

It depends which Pi you have. The Pi 3 series are fused at around 2500mA. About 1200mA of that is allowed for USB and other peripherals on the 5V supply.
I bought a nice bench power supply and tried to provide +5v to the displays directly while leaving the I2C connections on the Pi, but that didnt work at all (I didnt think it would, but I'm not sure why). Probably lucky I didnt fry anything.
Did you make sure to connect the ground of the PSU and a ground on the Pi together?

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 22, 2018 4:11 pm

rpdom wrote:
Sun Apr 22, 2018 9:52 am
I think that related to the original Pi 1B which needed about 500mA to run and was fused at 700mA.

It depends which Pi you have. The Pi 3 series are fused at around 2500mA. About 1200mA of that is allowed for USB and other peripherals on the 5V supply.
I have the Model B+, which according to the FAQ:

The Raspberry Pi B+ and 2 Model B can supply 600mA/1.2A to downstream USB peripherals, switchable by a firmware setting.

But I am not sure if that USB port and the +5v header pin have the same limit. I would like to replace this with a Pi Zero once I get ready to mount things in a more permanent housing.
Did you make sure to connect the ground of the PSU and a ground on the Pi together?
Why would I do something intelligent like that? :? I was pretty sure that needed to happen to get everything at the same potential, but I wasnt sure if I needed some kind of protection between the Pi power source and my bench supply, like a diode or fuse or something. Is it as simple as just a jumper?

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 22, 2018 4:17 pm

Also, I now have clocks in MST, PST, and Zulu!
IMG_0122.jpg
IMG_0122.jpg (178.72 KiB) Viewed 1987 times

User avatar
rpdom
Posts: 14757
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 22, 2018 4:26 pm

KenK73 wrote:
Sun Apr 22, 2018 4:11 pm
I have the Model B+
That should be capable of providing up to 1200mA total to the USB an GPIO 5V pins combined. I believe the firmware defaults to the 1200mA setting on the USB now.

The Pi Zero has no fuses or limits. All the 5V connections are directly connected to each other. The main limit is what the tracks on the circuit board can handle safely, and we don't know that value.
Did you make sure to connect the ground of the PSU and a ground on the Pi together?
Why would I do something intelligent like that? :? I was pretty sure that needed to happen to get everything at the same potential, but I wasnt sure if I needed some kind of protection between the Pi power source and my bench supply, like a diode or fuse or something. Is it as simple as just a jumper?
Unless the circuits are completely isolated from each other, at least one ground on each side of the circuit will need to be directly connected to the other side to make a proper circuit. Otherwise it's like trying to light an LED by connecting one end to a battery and leaving the other end disconnected. The 0v connections should be at the same level on all points of the circuit to allow current to flow.

User avatar
karrika
Posts: 1057
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 22, 2018 4:40 pm

Are you going to leave the LED's visible as they are or do you plan to use some decorative front plate?

You already seem to master the technical details.

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 22, 2018 5:46 pm

karrika wrote:
Sun Apr 22, 2018 4:40 pm
Are you going to leave the LED's visible as they are or do you plan to use some decorative front plate?
The end state will have this all mounted in a wooden framed housing and probably a smoked piece of acrylic in front of the displays. The impetus for this little project was my boss bemoaning the price of one of these commercial clocks. I think they are upwards of $1800. This one will be under $250! Today I will add in the battery backed RTC and I am thinking about adding an atomic clock sync circuit so no network is needed.
You already seem to master the technical details.
I can't take much credit. Adafruit's blogs, videos, and libraries made it pretty stinking simple. Their example clock script was the cherry on top.

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 22, 2018 6:26 pm

rpdom wrote:
Sun Apr 22, 2018 4:26 pm

That should be capable of providing up to 1200mA total to the USB an GPIO 5V pins combined. I believe the firmware defaults to the 1200mA setting on the USB now.

The Pi Zero has no fuses or limits. All the 5V connections are directly connected to each other. The main limit is what the tracks on the circuit board can handle safely, and we don't know that value.
Ok, that's good to know. I'll check my B+ and verify the current limit setting.
Unless the circuits are completely isolated from each other, at least one ground on each side of the circuit will need to be directly connected to the other side to make a proper circuit. Otherwise it's like trying to light an LED by connecting one end to a battery and leaving the other end disconnected. The 0v connections should be at the same level on all points of the circuit to allow current to flow.
I made the missing connection from my Pi GND to my bench supply GND and, as they say, voila!
IMG_0123.jpg
IMG_0123.jpg (150.88 KiB) Viewed 1944 times
Looks like with 3 displays it bounces around just under 90mA.

Thanks for all your help! :D

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 29, 2018 4:30 am

Now I have all 7 displays connected to my I2C bus and displaying the time for each selected timezone. In addition I have the RTC clock keeping the system clock up to date. Yay!
IMG_0126.jpg
IMG_0126.jpg (197.96 KiB) Viewed 1893 times
But now I have questions about power again. All of my displays are connected in parallel and if I take a voltage reading, its about 4.6 vDC at each display. If I crank up the input voltage to about 5.5 vDC then I can get them closer to the expected 5v and there is a noticeable improvement in brightness. I connected the Pi to this source as well, and if I take a reading at the 5v pins it is also reading lower than 5v until I crank up the supply. Current usage for the entire kit is roughly 500mA.

If I want to keep the Pi and the Displays happy with a more nominal voltage, how do I go about squeezing that out of a typical 5v wall wart adapter when I pull this off the bench?

On another note, the 1.2" displays are kind of flickery. Is that normal? I get that their in a matrix and the driver is cycling them on/off many times a second, but should I be able to discern the slight flicker? It's not my python because the displays latch the last value after the script is terminated and they still flicker. It doesnt seem to be a current issue because there is still 500mA on the wire to spare. Even when I do bump up the supply voltage to 5v the flicker is there. The LEDs are brighter, but still seem to flicker the same amount. It's not a terrible amount, just wondering if having them in parallel is causing my issue. Not sure I can tell without an oscope.

User avatar
karrika
Posts: 1057
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: First Pi Project - Multi-Timezone Clock

Sun Apr 29, 2018 9:08 am

If you connect the display in a matrix and switch the segments on/off they are bound to flicker. Search for the frequency in the driver and try to change that to see if you can increase it.

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sun May 06, 2018 9:47 pm

Here's a little update on my progress so far for anyone interested.

The 7 displays are mounted to a 48" piece of Poplar that is painted black. I made custom cables to connect the backpacks to a breakout board which is where I attach them to the Pi Zero W and also connect the DS3231 RTC. The Python script that does all the magic is working fine, but I think it can be shortened up a bit. I am posting that code to the programming forum for some guidance.

I replaced the 8GB SD card with a 4GB card and installed Raspbian Stretch Lite. There's just too much crap on a base install that is wasting space, plus I had a 4GB card laying around. I added the script to the /etc/rc.local so the clock starts on boot. There are just a couple more things to do:

1. Case - I'm thinking something like a long thin-ish shadow box with a magnetically attached front cover (smoked acrylic).
2. Reset button - Just in case.
3. Make the OS read-only so no chance of SD card corruption
4. Disable a bunch of crap in Raspbian Lite that I do not need.
5. Setup the WiFi in ad-hoc mode so if someone needs to get in and fix it, they dont need an AP near by. I think I will have the WiFi shut off automatically 10 minutes after each boot up.

And I might have screwed up by only having 7 clocks... I may need an eighth. Luckily it's going to be cake to add it electrically/programatically.
IMG_0132.jpg
IMG_0132.jpg (117.82 KiB) Viewed 1838 times

User avatar
neilgl
Posts: 648
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: First Pi Project - Multi-Timezone Clock

Mon May 07, 2018 7:59 am

It is looking good.

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sat May 12, 2018 6:52 am

I believe I have completed the electrical component of this project.
Clock - 1.jpg
Clock - 1.jpg (237.64 KiB) Viewed 1762 times
Clock - 2.jpg
Clock - 2.jpg (193.66 KiB) Viewed 1762 times
Clock - 3.jpg
Clock - 3.jpg (208.49 KiB) Viewed 1762 times

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sat May 12, 2018 6:53 am

Clock - 4.jpg
Clock - 4.jpg (207.36 KiB) Viewed 1761 times
Clock - 5.jpg
Clock - 5.jpg (185.93 KiB) Viewed 1761 times
Clock - 6.jpg
Clock - 6.jpg (210.8 KiB) Viewed 1761 times

User avatar
DougieLawson
Posts: 35561
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: First Pi Project - Multi-Timezone Clock

Sat May 12, 2018 8:32 am

What an exceedingly lovely project. Well done. The next step is to do it with Nixie tubes.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sat May 12, 2018 7:23 pm

Thanks!
The next step is to do it with Nixie tubes.
:lol:

KenK73
Posts: 23
Joined: Sun Mar 18, 2018 6:32 pm

Re: First Pi Project - Multi-Timezone Clock

Sun Jun 10, 2018 7:04 pm

Here is the finished (more or less) product!
TZClock.jpg
TZClock.jpg (201.76 KiB) Viewed 1560 times

bloggerstomper
Posts: 1
Joined: Wed Jun 05, 2019 11:58 am

Re: First Pi Project - Multi-Timezone Clock

Wed Jun 05, 2019 12:03 pm

Hi!

This is incredibly amazing and exactly what I wanted to create.
Since I have very little experience I was wondering if you could explain the steps in a bit more detail, or maybe point me to some resources so I could figure out how to make this on my own.

I appreciate any help, thank you very much!!

Return to “Beginners”