limpygnome
Posts: 5
Joined: Fri Dec 28, 2012 10:44 am

40 LEDs using a single pin

Fri Dec 28, 2012 10:52 am

Would it be possible to power 40 LEDs off a single pin using five shift-registers and 220 Ohm resistors between each LED and the shift registers? Would this cause damage in the long-run?

I am currently building a clock that will be online 24/7 (as an alarm clock, display clock and partial room automation); currently the clock will power:
> An 8-channel relay
> An MCP3008 ADC, with a: temperature, light and ultrasonic sensor attached.

...however I am not sure if adding an additional 40 LEDs would be possible or cause damage.

Thanks!

User avatar
bugsy_malone 666
Posts: 289
Joined: Mon Dec 17, 2012 10:50 pm
Location: Basingstoke UK

Re: 40 LEDs using a single pin

Fri Dec 28, 2012 12:52 pm

You might be ok, I have seen shift registers used in a massive display before, I think you would need to look a t a different power supply to power both LEDs and Pi.

When we had a display at work that consisted of an LED matrix (8x5 modules but lots of them to display txt) I stripped the units down and they had fairly sizeable 5v PSU's on them but it worked out hundreds of LEDs they were powering plus a module that held the data (these were being scrapped so I kept the bits.)

theres some info here: http://arduino.cc/en/Tutorial/ShiftOut about connecting shift registers to drive sets of LEDs. I have seen 512 LEDs driven by shift registers and an Arduino before, but theres no way the arduino has the oompth to power that many on its own.

So basically I think you'd be ok with your plans, but you would have to design it in such a way as to have a PSU and a common 5v rail to power everything off of.

I'm not 100% but hopefully that is a pointer in the right direction. :)

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12023
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: 40 LEDs using a single pin

Fri Dec 28, 2012 1:03 pm

Single pin no, you need several pins, at least a clock pin and a data pin, but quite probably you will need a "parallel load" pin too.

limpygnome
Posts: 5
Joined: Fri Dec 28, 2012 10:44 am

Re: 40 LEDs using a single pin

Fri Dec 28, 2012 1:10 pm

Since I'll have a power supply of 240v / with a 13 amp fuse going to my relay, is there a way I can use that power for my Pi and the LEDs? How would I connect that to both of them safely? I assume I would only need to change the voltage? How would you recommend I also do that? :D


Also the shift registers do work, my only concern is the power supply - especially over a long period of time :D.

Thanks!

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12023
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: 40 LEDs using a single pin

Fri Dec 28, 2012 1:17 pm

I wouldn't recommend using the same supply that you also use for relay(s), relays can cause some nasty spikes on the power, still if you insist, you can use a cigar plug converter with an USB output.

limpygnome
Posts: 5
Joined: Fri Dec 28, 2012 10:44 am

Re: 40 LEDs using a single pin

Fri Dec 28, 2012 2:11 pm

I was thinking of making my own power supply:
Image

...with 10v electrolytic capacitors and the following voltage regulator:
http://www.maplin.co.uk/1a-positive-fix ... tors-46475

Would this circuit work? I would of-course, if this did work, replace the LED with the Raspberry Pi (I could modify a USB adapter) and build a similar second circuit for the LED matrix.

Thanks again! :D

User avatar
BirchJD
Posts: 156
Joined: Tue Nov 13, 2012 7:43 pm

Re: 40 LEDs using a single pin

Fri Dec 28, 2012 2:46 pm

Do not connect a 7805 regulator to mains. You would need a transformer to bring the voltage down to something like 9V and a bridge rectifier. The circuit is not correct at all and unsafe if this is the regulator you are planning to use.
http://www.newsdownload.co.uk/

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: 40 LEDs using a single pin

Fri Dec 28, 2012 2:51 pm

limpygnome wrote:I was thinking of making my own power supply:
Simple answer DONT Your diagram is so wrong and DANGEROUS
...with 10v electrolytic capacitors and the following voltage regulator:
http://www.maplin.co.uk/1a-positive-fix ... tors-46475

Would this circuit work? I would of-course, if this did work, replace the LED with the Raspberry Pi (I could modify a USB adapter) and build a similar second circuit for the LED matrix.

Thanks again! :D
At this stage BUY a SAFE power supply, unless you have a good idea of how to wire mains and build power supplies, dont for your own safety.

You need to do a lot of research on power supplies, yes people can build their own, but you need some knowledge or a defined kit of parts and safe cirucit first
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

limpygnome
Posts: 5
Joined: Fri Dec 28, 2012 10:44 am

Re: 40 LEDs using a single pin

Fri Dec 28, 2012 2:59 pm

Thanks!

User avatar
ReadiesCards
Posts: 40
Joined: Sun May 13, 2012 5:22 am

ultrasonics in the bedroom

Sat Dec 29, 2012 7:11 am

Would love to know why you need an ultrasonic sensor in the bedroom?

Are you
- detecting burglars in the room and going to flash a big led matrix saying 'get out'?
- listening for bats and using a relay to fire a fishing net to catch them?
- seeing if your pets come in wanting feeding and opening a pet food supply automatically?

Most interested please do tell
Paul

davorin
Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

Re: 40 LEDs using a single pin

Sun Dec 30, 2012 12:48 pm

By "single pin" I assume to transfer the data to the LEDs.

To my knowledge there is no shift register just working with one pin.
But there was a solution once used by Apple called desktop bus.

Older MACs had small microcontrollers from GE (later they went to Microchip)
which used just one data/clock line. The data was encoded as a sort of pulse width modulation with a fixed period time.

Just remembering this as I programmed Microchip controllers to be used as a desktop bus periphal.
So find a big enough PIC with enough LED ports ;-)

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

Re: ultrasonics in the bedroom

Mon Dec 31, 2012 11:30 am

ReadiesCards wrote:Would love to know why you need an ultrasonic sensor in the bedroom?

Are you
- detecting burglars in the room and going to flash a big led matrix saying 'get out'?
- listening for bats and using a relay to fire a fishing net to catch them?
- seeing if your pets come in wanting feeding and opening a pet food supply automatically?

Most interested please do tell
Paul
My guess is he's building a nightlight, so the LEDs automatically come on when you tumble out of bed in the dark winter mornings. (I did one myself years ago, not pi-based but just simple electronics and an IR proximity sensor.)

Lonewolff
Posts: 144
Joined: Fri Dec 28, 2012 11:13 pm

Re: 40 LEDs using a single pin

Mon Jan 07, 2013 11:12 am

limpygnome wrote:Image
BANG! :lol:
Loving my peice of the Pi

Return to “Other projects”