Pages: [1]   Go Down
Author Topic: Shift register and 7 segment led confusion  (Read 1107 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all. I'm fairly new to the arduino and electronics. I have gone through all the projects that came with the kit and understand it all. However I am now wanting to drive a 7 segment led using a shift register.

One of the projects that came with the kit was driving 8 LEDs with a shift register which I understood as you drove the positive lead of the led high when you want it on. However with the 7 segment led I have, it has the positive as the common to the device (ie all LEDs) and you need connect the LED segments you want to light up to the negative. how can I do this with the shift register? You don't simply drive the pin low do you?

Or can I not use a shift regIster for this?

Many thanks
Logged

United States (Texas)
Offline Offline
God Member
*****
Karma: 3
Posts: 525
Arduino socks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you hook up the common to +5 and write it low to turn it on, high to turn it on. it is that simple smiley. be sure to use current limiting resistors on the shift register outputs!
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 76
Posts: 7305
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

write it low to turn it on, high to turn it on. it is that simple smiley

It would be simpler if you wire the common to 5V, wire one led in series with a resistor, say 220Ohm, and the end of the resistor to one shifter register output pin. You write high to turn it off and low to turn it on. That's why I don't like common anode stuff, high is off, low is on, one additional layer of understanding for newbies.

Be a little more helpful to the newbies, check what you submit!
Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27427
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Be sure to check the current rating of the shift register as well.
A part like the 74HC595 is only good for 6mA, while a functionally equivalent TPIC6B595 is good for 150mA.
Lots of variety out there, read the data sheets and size your current limit resistors accordingly.
Check the 7-segment display - it may have a lower max current rating as well.
As  you wire it up, try and create a standard for yourself as well, such as:
   A
F    B
  G
E    C
   D   and decimal point.
In the bits you shift out:
Bit 0 (LSB) = A
1 = B
2 = C
3 = D
4 = E
5 = F
6 = G
7 (MSB)  = decimal point

This will help in debugging your code later too.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 76
Posts: 7305
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf

This is the one I use. The current per output is <25mA, good enough for most LEDs.
Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27427
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, remember current limit resistors tho.
I'm looking at pages 9-10-11-12 where it shows VOL of 0.33max fovr VCC = 4.5V & IOL of 6mA.
I guess for LEDs we're not so interested in getting all way down there, just need at least down to 2.5V so the LED will turn on.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for all the help guys. That seems pretty clear now. Going to get this little project out the way then move on to something a little more ambitious.... Rgb led matrix look out!

Thank again.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27427
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/forum/index.php?topic=52981
Take a look here then too.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: