Pages: [1] 2 3 4   Go Down
Author Topic: not understanding 7 segment multiplexing  (Read 3967 times)
0 Members and 1 Guest are viewing this topic.
Ft. Worth, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

to cut cost, I'd like to control a 12 volt 4 digit 7 segment array using a Mini. But I don't understand what I need for a high side driver. I've read that I need to drive a PNP using an NPN, are there any better ways? This has to fit in a 2" x 2" x 1" enclosure. I keep seeing shift register come up as a high side switch, but I don't see how that is possible?

What about using FETs?
« Last Edit: January 07, 2012, 07:42:24 am by magnethead794 » Logged

KF5RVR

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 514
Posts: 31543
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I've read that I need to drive a PNP using an NPN, are there any better ways?
No.
Quote
I keep seeing shift register come up as a high side switch, but I don't see how that is possible?
No it is not unless the shift register is running at 12V which most can't. Anyway they can't supply the current.

Quote
What about using FETs?
Same problem as with transistors, you need a p-channel FET for the power and a n-channel FET (or NPN transistor) to switch it.
Logged

The Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

there are 2 different 7 segment displays:
one with a common anode or one with a common cathode.

  • with the common anode you connect the (1 or 2) anodes with the +12V and the other 8 cathodes via an normal NPN-transistor (eg: 2n2222) to the GND.
  • with the common cathode you connect the (1 or 2) cathodes with the GND and the other 8 anodes via an PNP-transistor to the +12V.

I would go for the first option and control the NPN-transistors via 4 shift regs
Logged

Ft. Worth, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

there are 2 different 7 segment displays:
one with a common anode or one with a common cathode.

  • with the common anode you connect the (1 or 2) anodes with the +12V and the other 8 cathodes via an normal NPN-transistor (eg: 2n2222) to the GND.
  • with the common cathode you connect the (1 or 2) cathodes with the GND and the other 8 anodes via an PNP-transistor to the +12V.

I would go for the first option and control the NPN-transistors via 4 shift regs

Mine goes either way. I'm setting it up as common anode per digit.

A thought I had, since darlington's are cheap and I'm already using one, can I use another to drive the PNP source driver?

cut the pins on the socket on the output side, and only use pins 1, 3, 6, and 6. Use the pads that would be under 2 and 7 as a +12 rail (each shared by 2 PNP's), and output drives on pins 0, 4, 5, and com. That's the easiest way I can save space aesthetically on a 30-stripe board. -> http://i1105.photobucket.com/albums/h355/magnethead494/dial_board_R2-5_board.jpg

The board is 3" x 1.2" and will be attached to a wall of the 5x2.5x2 enclosure the RJ-45 jack will be next to it. The heatsink and 5,12 volt regulators will be attached to the opposite wall. I'll be pulling 1 watt through the 5 volt regulator (7 volt suppression @ 150ma) and 3 watts through the 12 volt regulator (12 volt supression max [24V input] @ 250ma). 5 volt reg will simoply attach to plastic enclosure, 12 V will be on heatsink. The mini will be attached to the right wall (not sure how yet, has no mounting provision [may switch to nano?]).
Logged

KF5RVR

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

To drive the common anodes, check out the UDN2981a, see http://www.rapidonline.com/pdf/82-2202.pdf. This contains 8 high side drivers each capable of switching up to 50v from a 5v control signal. The only snag is that the voltage drop in them is almost 2v, whereas a good PNP transistor would only drop around 0.2v.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Ft. Worth, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To drive the common anodes, check out the UDN2981a, see http://www.rapidonline.com/pdf/82-2202.pdf. This contains 8 high side drivers each capable of switching up to 50v from a 5v control signal. The only snag is that the voltage drop in them is almost 2v, whereas a good PNP transistor would only drop around 0.2v.

The darlingtons are a 1.2 volt drop, and that is a 1.8 volt drop, net 3 volt drop. So I'd have 9 volts going to an LED board rated for 12 volts (220 ohm resistors, 5 led's in series).

Spec'd at 8.7 volts @ 15mA, 220 ohm resistor, 12Vin
10.8 volts is 9.5mA
9 volts is 1.5mA

So that wouldn't quite work. And Mouser doesn't carry them, either.

Would it work, driving the PNP's with a darlington (only collector is avaliable, common emitter)?

Ultimately I need a Sziklai pair. Supposedly these are marketed as hex buffers?
« Last Edit: January 08, 2012, 12:38:12 am by magnethead794 » Logged

KF5RVR

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
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

How about driving 4 TPIC6B595 shift registers via SPI interface, one for each digit?
Yeah, its not multiplexing, but its easy write the digits, they handle 12 volts, don't need high side drivers.
They handle 150mA per segment. 84 cents at Avnet.
https://avnetexpress.avnet.com/store/em/EMController/Counter-Shift-Register/Texas-Instruments/TPIC6B595N/_/R-1750249/A-1750249/An-0?action=part&catalogId=500201&langId=-1&storeId=500201&listIndex=-1

Or use a 6D595, 100mA/segment for 57 cents.
https://avnetexpress.avnet.com/store/em/EMController/Counter-Shift-Register/STMicroelectronics/STPIC6D595B1R/_/R-5750380/A-5750380/An-0?action=part&catalogId=500201&langId=-1&storeId=500201&listIndex=-1

Only need 3 pins - SS, SCK, MOSI, sometimes all the multiplexing is just not worth hassle!

Both available in multiple surface mount versions as well.
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.

Ft. Worth, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How about driving 4 TPIC6B595 shift registers via SPI interface, one for each digit?
Yeah, its not multiplexing, but its easy write the digits, they handle 12 volts, don't need high side drivers.
They handle 150mA per segment. 84 cents at Avnet.
https://avnetexpress.avnet.com/store/em/EMController/Counter-Shift-Register/Texas-Instruments/TPIC6B595N/_/R-1750249/A-1750249/An-0?action=part&catalogId=500201&langId=-1&storeId=500201&listIndex=-1

Or use a 6D595, 100mA/segment for 57 cents.
https://avnetexpress.avnet.com/store/em/EMController/Counter-Shift-Register/STMicroelectronics/STPIC6D595B1R/_/R-5750380/A-5750380/An-0?action=part&catalogId=500201&langId=-1&storeId=500201&listIndex=-1

Only need 3 pins - SS, SCK, MOSI, sometimes all the multiplexing is just not worth hassle!

Both available in multiple surface mount versions as well.

Nowhere enough room for 4 DIP10's. The board only has 30 columns and I'm restricted on size. Also have to fit 2 voltage regulators on the board.

If they're 8 bits, can't I still multiplex, one digit per drain?

I'm removing one switch, and moving it to the center of the board. It's a on-off-on SPDT switch with a resistor between the 2 end poles (used for dimming). The top horizontal will be voltage to the sourcing circuit for the LED's, the bottom horizontal will be 12V, and the column above the switch will be 12V with a resistor (68 ohm) on it.
« Last Edit: January 08, 2012, 12:56:49 am by magnethead794 » Logged

KF5RVR

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
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

Yes, can mulitplex the shift register across the digits. Still need to switch the 12V on/off to the common cathode of the digits tho.

I' d personally ditch that board you have, get an "island of holes" board, futurlec.com has plenty of options, cut down to size you need, and have the WHOLE board available for use.  You're backed into a corner with that thing.
http://www.futurlec.com/ProtoBoards.shtml  $1.50
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.

Ft. Worth, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, can mulitplex the shift register across the digits. Still need to switch the 12V on/off to the common cathode of the digits tho.

I' d personally ditch that board you have, get an "island of holes" board, futurlec.com has plenty of options, cut down to size you need, and have the WHOLE board available for use.  You're backed into a corner with that thing.
http://www.futurlec.com/ProtoBoards.shtml  $1.50


Those do me no good. I need something small to fit in a 5x2.5x2 enclosure. Eventually I will transfer it to PCB and fit it in a 4x2x1 enclosure (the thinner the better).

So if I multiplex source on the register and sink on the darlington, that's a DIP20, DIP18, a STDP switch, and 5 pins for the voltage regulators. Leaves 3 columns empty I think. Sounds good.

Everything stays self contained on that board, regulators go off-board, and an RJ45 breakout (or two) and the mini.

Wait- aren't these low side drivers? I need high side. For something so simple, I don't understand why they don't exist (particularly in DIP form). Seems to me there's no difference between the chip you posted and a darlington, other than being SPI rather than direct drive.

Can I simply use 4 Logic Level P-FET's, one per digit, rather than driving a PNP with an NPN?
« Last Edit: January 08, 2012, 02:15:33 am by magnethead794 » Logged

KF5RVR

Ft. Worth, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I found this. A tad pricey, but if it does what I want and makes things cleaner than having 8 transistors.......

http://www.mouser.com/ProductDetail/National-Semiconductor-TI/LMD18400N-NOPB/?qs=sGAEpiMZZMvu8NZDyZ4K0ds1WvysrZaj
Logged

KF5RVR

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
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

Buy the board, cut it down to the size needed, wire up your circuit. You are really limiting yourself on usable board space by insisting on using the strips.
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.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
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

Woohoo, that is rich! I propose a piece of $1.50 perfboard and four 56 cent shift registers, you come back with a $12 part.

Well, I guess it is true, can lead a horse to water ...
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.

Ft. Worth, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So replace each darlington with an 8 bit shifter. How do I command which output is on?

So I'd only need 4 pins of the Mini to control 28 segments?

Ideally if I used a land of holes board, I'd have to cut tons of traces?

Idea would be to fit everything in a 4x2x1" enclosure. The shift registers would take up 2 linear inches, leaving 2 more inches for the mini board, RJ-45 breakout, and heatsink/regulators. Then mount it all to the enclosure using the switch. It should weigh low enough that vibration shouldn't make it break loose. (This is an exposed part going on a ~200 mph dragster)

Once I get it on PCB, I figure I could fit everything on a single 2" square PCB, including the RJ-45 connection.
« Last Edit: January 08, 2012, 02:57:49 am by magnethead794 » Logged

KF5RVR

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
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

No, only 3 - SS, SCK, MOSI, and could be 32 (7 + decimal point, use as warning lights or something, : , etc)
Code:
digitalWrite(SS, LOW);
SPI.transfer (digit1); // data can come from an array even:  SPI.transfer ( displayArray[digit1data] );
SPI.transfer (digit2);
SPI.transfer (digit3);
SPI.transfer (digit4);
digitalWrite(SS, HIGH);
[code]
and in the rest of void loop you create/determine/whatever the digit data will be.
displayArray[0-9] will be the high/lows that create your display of a 0, 1, 2, ...9 or maybe letters A,b,c,C,d,E,F,g,h,i,J,L,P,U
[/code]
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] 2 3 4   Go Up
Jump to: