evilkitty
Posts: 371
Joined: Tue Apr 15, 2014 11:39 pm

7 segment displays

Tue Jun 23, 2015 11:26 am

I plan to use 2 two digit displays with a A+ board
When i was looking at this i saw one only using 4 pins not noticing the IC behind it
it seems it is still possible to use without that, but it needs a LOT of GPIO pins
currently i have 6 in use (board pins 1,2,7,9,11, and 12)
i plan to use another 4 pins for digital logic via a switch
that would total 6 of my logic pins in use before the displays
* Pin 7 (aka GPIO 4 is my DS18B20 sensor)

do i have enough pins to control the 2 panels directly?
* common anode
Last edited by evilkitty on Tue Jun 23, 2015 11:55 am, edited 2 times in total.
My Pi Server: http://imgur.com/a/6xIUI | Thermostat: http://imgur.com/a/4LVnT

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

Re: 7 segment displays

Tue Jun 23, 2015 11:33 am

The classic way to drive a bunch of 7-segment displays is one line per segment, plus one line per digit. So in your case that's 12 ( don't forget the decimal point).

If that's too many then you can start using shift registers, demultiplexers, and other tricks.

Driving your display from the Pi is no different to using a Z80, 6502, PIC, Arduino, whatever. Find a solution that appeals to you and fits within the restrictions you have.

evilkitty
Posts: 371
Joined: Tue Apr 15, 2014 11:39 pm

Re: 7 segment displays

Tue Jun 23, 2015 11:46 am

i will not be needing the decimal point for temp readouts ;)
My Pi Server: http://imgur.com/a/6xIUI | Thermostat: http://imgur.com/a/4LVnT

evilkitty
Posts: 371
Joined: Tue Apr 15, 2014 11:39 pm

Re: 7 segment displays

Tue Jun 23, 2015 11:58 am

ame wrote:The classic way to drive a bunch of 7-segment displays is one line per segment, plus one line per digit. So in your case that's 12 ( don't forget the decimal point).

If that's too many then you can start using shift registers, demultiplexers, and other tricks.

Driving your display from the Pi is no different to using a Z80, 6502, PIC, Arduino, whatever. Find a solution that appeals to you and fits within the restrictions you have.
but 1 per segment + 1 per digit != 12
7 segment * 4 + 4 = 32 or 36 with the decimal
where did 12 come from?
My Pi Server: http://imgur.com/a/6xIUI | Thermostat: http://imgur.com/a/4LVnT

User avatar
Douglas6
Posts: 4849
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: 7 segment displays

Tue Jun 23, 2015 12:23 pm

7 + 1 segments + 4 digits = 12. The digits are multiplexed, and share the segment lines. But the I2C backpacks are so much easier.

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

Re: 7 segment displays

Tue Jun 23, 2015 12:46 pm

evilkitty wrote: but 1 per segment + 1 per digit != 12
7 segment * 4 + 4 = 32 or 36 with the decimal
where did 12 come from?
How many segments? 8 (including d.p.)
How many digits? 4
8+4=12

As I said, people have been doing this for decades, so there are many techniques for saving pins.

DavidMS
Posts: 139
Joined: Fri May 25, 2012 8:48 pm
Contact: Website

Re: 7 segment displays

Tue Jun 23, 2015 1:02 pm

You can have a look at http://www.pimuxclock.co.uk for how it can work in practice, if you look on the download page you can see some example code for a 4 digit display
http://meanderingpi.wordpress.com/
11 Raspberry Pi's and counting....

evilkitty
Posts: 371
Joined: Tue Apr 15, 2014 11:39 pm

Re: 7 segment displays

Tue Jun 23, 2015 7:32 pm

im planning to use 2 separate two digit displays, i will not be needing decimal points
though i guess i could use a button to switch the readout and use 1 display
i am not familiar with 7segment led stuff or using any of the tricks to increase GPIO pins
My Pi Server: http://imgur.com/a/6xIUI | Thermostat: http://imgur.com/a/4LVnT

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: 7 segment displays

Tue Jun 23, 2015 7:40 pm

evilkitty wrote:im planning to use 2 separate two digit displays, i will not be needing decimal points
though i guess i could use a button to switch the readout and use 1 display
i am not familiar with 7segment led stuff or using any of the tricks to increase GPIO pins
Use a spi device with max7219 controller, dirt cheap on ebay

evilkitty
Posts: 371
Joined: Tue Apr 15, 2014 11:39 pm

Re: 7 segment displays

Tue Jun 23, 2015 8:58 pm

that looks a little too big, i only have 65mm to work with and i need to stick a mini toggle switch in the middle of that
though if i solder stuff on to a 2x8cm board i can put that out of the way
My Pi Server: http://imgur.com/a/6xIUI | Thermostat: http://imgur.com/a/4LVnT

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: 7 segment displays

Wed Jun 24, 2015 7:00 pm

evilkitty wrote:that looks a little too big, i only have 65mm to work with and i need to stick a mini toggle switch in the middle of that
though if i solder stuff on to a 2x8cm board i can put that out of the way
The max7219 can control up to 8, 7 seg displays (plus DP), but can also work with 4. The chips are available in DIL packages, so are quite 'hobby' friendly (no smd soldering required), and are easy to wire up on proto- or breadboards.

evilkitty
Posts: 371
Joined: Tue Apr 15, 2014 11:39 pm

Re: 7 segment displays

Fri Jun 26, 2015 1:25 am

thanks, would using a chip like that take the looping load off of the pi or would i still be changing output every few hundred nanoseconds to display multiple digits?

i figured out how the 7segment actually work :)
since i am going to be suing common anode panels, i guess i should use a PNP transistor as a switch for each digit

if i were going to drive the panel from the pi
i would put a GPIO to each of the 7 segments (not using decimal point)
then put a GPIO to each PNP transistor
have + 3.3 to the PNP collectors, while the emitter goes to the panel's voltage input
what would be a decent choice PNP transistor (one good for fast switching at low voltages)
(one that can be soldered to 2.54mm breadboard)
My Pi Server: http://imgur.com/a/6xIUI | Thermostat: http://imgur.com/a/4LVnT

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: 7 segment displays

Sat Jun 27, 2015 11:02 pm

evilkitty wrote:thanks, would using a chip like that take the looping load off of the pi or would i still be changing output every few hundred nanoseconds to display multiple digits?

i figured out how the 7segment actually work :)
since i am going to be suing common anode panels, i guess i should use a PNP transistor as a switch for each digit

if i were going to drive the panel from the pi
i would put a GPIO to each of the 7 segments (not using decimal point)
then put a GPIO to each PNP transistor
have + 3.3 to the PNP collectors, while the emitter goes to the panel's voltage input
what would be a decent choice PNP transistor (one good for fast switching at low voltages)
(one that can be soldered to 2.54mm breadboard)
With the MAX chip you set registers corresponding to the dispaly number values, not the individual segments (it has and inbuilt 'font' so if you set 0, it displays "0" ). It handles all the multiplexing, you only need to send updates over spi when the values change.

evilkitty
Posts: 371
Joined: Tue Apr 15, 2014 11:39 pm

Re: 7 segment displays

Sun Jun 28, 2015 10:43 am

a quick look on ebay shows it being sold with common cathode displays, does it work with common anode?
if not is there a version for common anode?
does it have resistors and transistors built in so it can be directly connected to the LEDs?
My Pi Server: http://imgur.com/a/6xIUI | Thermostat: http://imgur.com/a/4LVnT

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

Re: 7 segment displays

Sun Jun 28, 2015 11:14 am

evilkitty wrote:a quick look on ebay shows it being sold with common cathode displays, does it work with common anode?
if not is there a version for common anode?
does it have resistors and transistors built in so it can be directly connected to the LEDs?
A quick Google will obtain for you the driver chip data sheet. The data sheet will answer all of your questions and more.

evilkitty
Posts: 371
Joined: Tue Apr 15, 2014 11:39 pm

Re: 7 segment displays

Sun Jun 28, 2015 3:06 pm

it does not support common node
but you do some clever tricks to make it work
http://marco-difeo.de/2013/02/21/drive- ... -displays/
is there a version of this chip for common anode?
My Pi Server: http://imgur.com/a/6xIUI | Thermostat: http://imgur.com/a/4LVnT

Return to “Automation, sensing and robotics”