haruko
Posts: 2
Joined: Fri Jul 25, 2014 4:07 am

A special kind of Clock

Fri Jul 25, 2014 4:16 am

Hey all,

I'm new here, literally just signed up, hoping I am posting this in the right forum and that a Raspberry PI can do what I need it to.

I want to build a clock that runs digitally and uses LEDs to display the time in an Analogue manner. Bit different I know.

This does mean I need to have something capable of controlling 72 LEDs individually, could the mighty PI do this task? I saw there are expansion boards you can get, would they help? Or would they still not be enough?

If I can't do this with a PI do you know of any other way to control that many LEDs individually? :D

I'd love to use a PI because it seems like it would be a lot simpler than making something from scratch, I have some compentancy with electronics but not to the point where I could magic up a control circuit for a clock let alone program it. PI would be brilliant because I could get my clock to do all sorts of neat tricks and you know that would be cool!

Thanks for any help
:)

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: A special kind of Clock

Fri Jul 25, 2014 4:56 am

You could try Charlieplexing. 72 LEDs would require 9 GPIO pins.

Or you could buy 72 addressable LED modules and string them together on a common bus:
http://www.adafruit.com/products/1260

The advantage of the second method is that they are RGB LEDs so can display any colour.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: A special kind of Clock

Fri Jul 25, 2014 5:00 am

Don't forget, the Pi's clock is set from the network. It forgets the time when you turn it off.

If your Pi is not connected to the network then you need another time source, such as a GPS, or an RTC module (for example, a DS3231 or similar).

haruko
Posts: 2
Joined: Fri Jul 25, 2014 4:07 am

Re: A special kind of Clock

Fri Jul 25, 2014 7:54 am

Great Scott thank you for such a quick and useful reply I will investigate now, seems that a Raspberry PI will do what I need it too
Thanks so much :-)

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: A special kind of Clock

Fri Jul 25, 2014 10:26 am

You might like to look at this project that was here on the site recently (LED moon clock):
http://www.raspberrypi.org/lunar-phase-clock/

If you want 72 LEDs in one or two circles and only a few lit, then charlieplexing will probably do it.

PiGraham
Posts: 4019
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: A special kind of Clock

Fri Jul 25, 2014 10:54 am

ame wrote:You could try Charlieplexing. 72 LEDs would require 9 GPIO pins.

Or you could buy 72 addressable LED modules and string them together on a common bus:
http://www.adafruit.com/products/1260

The advantage of the second method is that they are RGB LEDs so can display any colour.
Good call on Chalieplexing.
Image

Watch out for tight clocking requirements on addressable LEDs. A Linux system can't drive many of those because it can't clock accurately enough.

Another option is to use shift registers (with clock inputs).

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: A special kind of Clock

Fri Jul 25, 2014 11:02 am

Out of interest another charlieplexed project is here:
http://www.picaxeforum.co.uk/entry.php? ... axe-orrery

This doesn't use the raspi - it uses a much smaller microcontroller - but shows some of the crazy :o stuff possible. There's a video link in one of the later comments.

Aydan
Posts: 731
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: A special kind of Clock

Fri Jul 25, 2014 11:21 am

ame wrote:You could try Charlieplexing. 72 LEDs would require 9 GPIO pins.

Or you could buy 72 addressable LED modules and string them together on a common bus:
http://www.adafruit.com/products/1260

The advantage of the second method is that they are RGB LEDs so can display any colour.
You could also use daisy-chained SPI shift registers.

Regards
Aydan

adamwatson
Posts: 12
Joined: Mon Jan 28, 2013 7:30 am

Re: A special kind of Clock

Fri Jul 25, 2014 11:56 am


bbodin
Posts: 70
Joined: Sat Jun 28, 2014 3:23 pm

Re: A special kind of Clock

Fri Jul 25, 2014 12:01 pm

Another solution is to use the SPI to drive two cascaded MAX7221 for controlling up to 128 individual LEDs.
Binh Bui

User avatar
joan
Posts: 14990
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: A special kind of Clock

Fri Jul 25, 2014 2:36 pm

Another option is to use virtual LEDs. Just paint a picture of each LED on a LCD screen. A lot less wiring but the software could remain pretty much the same.

User avatar
Burngate
Posts: 6328
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: A special kind of Clock

Fri Jul 25, 2014 5:22 pm

joan wrote:Another option is to use virtual LEDs. Just paint a picture of each LED on a LCD screen. A lot less wiring but the software could remain pretty much the same.
How about having some sort of pointer, attached to a motor, so that it could point at the LED that should be on?

In fact, have several pointers, moving at different rates. Maybe even concentric.

User avatar
joan
Posts: 14990
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: A special kind of Clock

Fri Jul 25, 2014 6:10 pm

Burngate wrote:
joan wrote:Another option is to use virtual LEDs. Just paint a picture of each LED on a LCD screen. A lot less wiring but the software could remain pretty much the same.
How about having some sort of pointer, attached to a motor, so that it could point at the LED that should be on?

In fact, have several pointers, moving at different rates. Maybe even concentric.
Perhaps just one pointer but two motors. One motor could control the vertical and the other the horizontal. You'd need to pulse the pointer to only illuminate the LEDs in the proper sequence.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: A special kind of Clock

Fri Jul 25, 2014 10:55 pm

joan wrote:
Burngate wrote:
joan wrote:Another option is to use virtual LEDs. Just paint a picture of each LED on a LCD screen. A lot less wiring but the software could remain pretty much the same.
How about having some sort of pointer, attached to a motor, so that it could point at the LED that should be on?

In fact, have several pointers, moving at different rates. Maybe even concentric.
Perhaps just one pointer but two motors. One motor could control the vertical and the other the horizontal. You'd need to pulse the pointer to only illuminate the LEDs in the proper sequence.
Whoosh!

Duane Degn
Posts: 55
Joined: Thu Jul 10, 2014 6:30 am
Location: Idaho, USA

Re: A special kind of Clock

Sat Jul 26, 2014 1:55 am

Can you tell us more about what you want the clock to do?

So far, it sounds like an inexpensive microcontroller would be enough for this project. Of course, if you already know how to use the Raspberry Pi, then it would make sense to use what you already know how to use.

A Raspberry Pi would offer an advantage over a microcontroller if you wanted to communicate with the clock over ethernet or WiFi. Another advantage the R Pi would offer is the ability to display video If you wanted to use some sort of video display with your project.

How bright do you want the LEDs? Will it be used outside in the daylight? Do you want to be able to control the overall brightness of the LEDs? Do you want to be able to control the individual brightness of each LED?

Besides the brain for the clock (R Pi or microcontroller) depending on your answers to the above questions, you may want to use additional chips to assisting controlling the LEDs.

What sort of input device do you want to use to set the time? As has already been suggested, you could have the time set by using some sort of connection to your network (or internet). There's also the option of using a GPS module to set the time. There are special radio devices to receive the time.

If you don't have a way to automatically set the time each time the clock is turned on, you will probably want some sort of real time clock (RTC). RTC often come with some sort of battery or super capacitor to keep the RTC powered between uses. I've used this one which seems to work fine. All RTC modules are not the same. Some are more accurate than others (the more accurate ones generally cost a bit more than the less accurate ones). A RTC should work fine with either the Pi or a microcontroller.

I'm a sucker for LEDs. I have a bunch of LED projects and I've made a playlist on YouTube of a few of these projects. (None YET with the Raspberry Pi.)

Some of the individually addressable LEDs like the WS2812 (aka NeoPixels) may be difficult to control directly with the Raspberry Pi. I'm not aware of any software available which would allow the Raspberry Pi to control NeoPixels.

User avatar
joan
Posts: 14990
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: A special kind of Clock

Sat Jul 26, 2014 6:14 am

ame wrote:
joan wrote:
Burngate wrote:How about having some sort of pointer, attached to a motor, so that it could point at the LED that should be on?

In fact, have several pointers, moving at different rates. Maybe even concentric.
Perhaps just one pointer but two motors. One motor could control the vertical and the other the horizontal. You'd need to pulse the pointer to only illuminate the LEDs in the proper sequence.
Whoosh!
Ditto.

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: A special kind of Clock

Sat Jul 26, 2014 6:03 pm

I'm half-way through a similar-sounding thing, controlling 72 leds (24xRGB) with 4 ws2803 chips connected straight to the pi. I have a working schematic and some useful links I'll post later, plus maybe a vid to prove it works.

edit:

the schematic (relevant part bottom-left) http://imgur.com/8TSkQlU

the vid: https://www.youtube.com/watch?v=jmUGMb7_Pzc

This is using a library from adafruit, which I can't find the link for at the moment...
note: I may or may not know what I'm talking about...

Return to “General discussion”