Pages: [1]   Go Down
Author Topic: Multiplexing dual 7segment diplays  (Read 2543 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there,

I'm a relative newbie to programming and electronics, with a lot of perseverance I've built my own Arduino controlled home brewery and now my attention has turned to serving the beer! I've got a beer fridge (kegerator) with 4 taps and want to display the amount left in each keg. I'm concentrating on the display first.

I've got 4 CC and 4CA dual segment displays:


I also have a bunch of 74HC595N shift registers. From my research I believe its possible to drive each display via a '595 and PNP / NPN transistors to sink /source current, depending on which type of display is used (not forgetting current limiting resistors on each data pin on the display). I really could do with some pointers as to a schematic using a 328 Arduino chip, I've seen loads of different ways to drive 7 segment displays and I'm a wee bit baffled by it all!

Cheers,
Jamie
Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 854
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can use a 74595 as you describe, 1 chip per digit and load all the bits as needed for common-anode or common cathode each time you want to update the display.   Or you can use a single 74595 to drive the segments, and an IO pin (with a transistor) for each digit and quickly scan through all the digits repeatedly; that's a bit easier hardware-wise, a bit harder code-wise.

There are also chips like the 7447 which will take your digit in BCD on 4 inputs and decode the 7-segment font to drive a single digit.

The easiest way, in my opinion, is to use a MAX7219 which will drive up to 8 common-cathode digits from a single chip needing 3 IO pins on your controller.   You simply set the values the digits should display and the chip takes care of the rest including constant current drive.  There is an LedControl library available which makes this route extremely easy.
Logged

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

Many thanks Oracle, I've just ordered a couple of MAX7219 samples from Maxim and will have a play.

Cheers,
Jamie
Logged

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

MAX7219 are for common cathode displays.
It is a nice chip.
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: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow that was quick; only 3 working days and 4 MAX7219 chips have just landed on my desk in the UK from San Jose!

Reading up on them they look like really well thought out chips. I've got the rest of the week off work so I'll see what I can do with them.

Cheers,
Jamie
« Last Edit: September 12, 2012, 10:29:53 am by Jabba » Logged

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

Hello,
 try this library I written:
 http://laurent.le.goff.free.fr/blog/IMG/zip/sevenseg.zip
 This version is suitable for common cathode and anode common, directly connected to the arduino, look at example, and the image in the zip file.
 not exceed 6mA per LED (40mA max per pin)

 I'll soon adapt this library for control by transistor, and no longer be limited current.
Logged

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

Quote
Wow that was quick; only 3 working days and 4 MAX7219 chips have just landed on my desk in the UK from San Jose!
I ordered some from taydaelectronics in Bangkok, Thailand - they also arrived quickly to east coast US, but from a Colorado (western US) address with no hint that Thailand was involved outside of a piece of taydaelectronics advertising in the packate.  Don't understand the delivery flow there.

Waiting on delivery of a large piece of perfboard now, coming Niagara Falls area (western NY), really surprised it didn't arrive  before the '7219's.
Will mount 4 large (60mm) LED matrices, the 4 7219's, maybe build up a standalone arduino 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.

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I've seen loads of different ways to drive 7 segment displays

They are all quite simple and can be written in a way that is completely transparent to the user.

The simplest is just 8 segment pins and four digit pins. The flow looks like this:

Code:
  turn off all digits;
  load segment pins with the segment information;
  turn on the desired digit;

All you need to do is to run that routine periodically (for example, insert it into a timer handler).

Your HC595 comes into in two areas:

1) You can serially load the 8 segment information.
2) You can serially load the digit pin information.
3) or the combination of the two.

But the basic execution flow remains the same.

Logged

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

Hello,
I adapt the library for control by transistor

http://laurent.le.goff.free.fr/blog/IMG/zip/sevenseg.zip
Logged

Pages: [1]   Go Up
Jump to: