Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: Montmorency on Apr 22, 2019, 09:26 pm

Title: 4-digit 7-segment indicator on Multi-function shield
Post by: Montmorency on Apr 22, 2019, 09:26 pm
This is about that red LED 4-digit indicator built into the multi-function shield.

I see that the above indicator is implemented to display only digit at a time. In order to display a 4-digit number on that indicator, I have to constantly sweep through all 4-digits (in software, or use a hardware "sweeper" instead) in order to create an illusion of a muti-digit number being displayed. I'm fine with that.

But let's say that in some application I need to display just a single digit. Can I in this case just abandon the sweep entirely? Or do I still need a full sweep through all 4 digits in order to reduce the duty cycle of the lit-up segments?

Basically, my question is: will keeping  one digit permanently displayed burn the segments out?

Title: Re: 4-digit 7-segment indicator on Multi-function shield
Post by: PaulRB on Apr 22, 2019, 11:47 pm
Maybe, yes. It depends how the circuit was designed. At best, lighting all 4 digits will make the display only 25% as bright as if only one digit was lit.

All this is normal .
Title: Re: 4-digit 7-segment indicator on Multi-function shield
Post by: ShermanP on Apr 23, 2019, 01:08 am
The sweeping is called multiplexing.  And as PaulRB says, if you light up one digit all the time it will be a lot brighter than if it were ON only 1/4 of the time.  But you can deal with this by "displaying" characters in the other three digits which happen to have no segments lit up.  They would still each be ON 1/4 of the time, but there would be nothing to see because the segments are dark.
Title: Re: 4-digit 7-segment indicator on Multi-function shield
Post by: Montmorency on Apr 23, 2019, 01:33 am
The sweeping is called multiplexing.
Well, yes and no.

Multiplexing means time-sharing a single data channel to transfer multiple streams of data. The 4-digit indicator of the MF shield does use multiplexing to transfer data for each digit, no argument here.

However, this has nothing to do with the need to constantly "sweep" the image on the display. The MF shield could, for example, implement simple latches for each segment in each digit to make it stay on by itself once it is lit (i.e. add internal "memory" for each segment). This would eliminate the need to constantly "sweep" the display. The display would simply hold its last set state for all its segments. Of course, such display would cost quite a bit more.

Note that we would still have to use miltiplexing to update the state of each digit when necessary, but we would not have to constantly "sweep" the display anymore.

So, sweeping and multiplexing are two completely independent/orthogonal principles here. Multiplexing is how we transfer data. Sweeping is how we create the optical illusion of all 4 digits being lit up simultaneously.

And as PaulRB says, if you light up one digit all the time it will be a lot brighter than if it were ON only 1/4 of the time.
Yes, I know that.

Again, the question is: do the segments get damaged by 100% duty cycle? Are they normally designed for 100% duty cycle? Or do they need 25% duty cycle to have time to "rest" and "cool down"?
Title: Re: 4-digit 7-segment indicator on Multi-function shield
Post by: Grumpy_Mike on Apr 23, 2019, 06:59 am
Quote
However, this has nothing to do with the need to constantly "sweep" the image on the display.
Yes it has. It is the term used by hardware people, it is the term everybody uses. Get used to not being correct when you wander outside your area of knowledge.

Quote
So, sweeping and multiplexing are two completely independent/orthogonal principles here.
No. You have to use the words as they are used by the rest of the world.

Quote
the question is: do the segments get damaged by 100% duty cycle?
It depends on how they were designed. Some designs overdrive the segments in order to compensate for loss of brightness, on these designs stopping the multiplexing will burn out the display. Others are more conservatively designed and will not over drive the display. You find out what you have by consulting the data sheet for forward current and looking at the current limiting components in the design.

Quote
Or do they need 25% duty cycle to have time to "rest" and "cool down"?
Displays do not get too hot when they are over driven. It is a common beginners mistake to believe that the average rating of an LED can be equated to the continuous rating in the data sheets. Other factors like electron depletion in the conducting band of the semiconductor also come into play. If an LED has a peak rating above that of the continuous rating it will say so in the data sheet along with the duty cycle this peak current applies to.
Title: Re: 4-digit 7-segment indicator on Multi-function shield
Post by: GolamMostafa on Apr 23, 2019, 08:39 am
1.  This is an example of a 4-digit cc-type 7-segment multiplexed display system.
(https://forum.arduino.cc/index.php?action=dlattach;topic=611658.0;attach=305182)
Figure-1: Example of 4-digit multiplexed display system

2.  In this multiplexed display system, there is only one 8-bit data path (PD7-PD6 PB5-PB0) over which 4 different signals (0x06 -- cc-code for 1; 0x5B -- cc-code for 2; 0x4F -- cc-code ofr 3; 0x66 -- cc-code for 4) travel at different times for 4 different destinations which are DP0 (display position 0), DP1, DP2, and DP3.  

3.  When 1 appears at DP0 position, there are nothing on DP1-DP3 positions (they remain completely blank);  when 2 appears at DP1 position, there are nothing on DP0, DP2-DP3 positions (they remain completely blank) and so on. There is only one digit that is present/visible on the display system at one time.

4.  If the statement of Step-3 is true (and it is true), then what do we do to see all the digits (1234) on the display system at a time? The trick is (also see Fig-2 in Step-6):

We maintain a walking 0 (logic-low) across the cc-pins (cc0, cc1, cc2, and cc3) of the display units. The speed of this 'walking 0' is about 100 kHz. We call this speed the 'scan frequency'.  I had not heard that anybody was saying it 'sweep' or 'sweep frequency' -- a term used in 'television technology'.

The 'scanning technique' does not create the 'illusion' for us to see all the digits simultaneously; rather, it is the 'eye perception' by virtue of which we see that all the digits are there. The eye saw digit 1 at DP0 position at time t1; at time t2, the digit 1 has gone from its position and a new digit 2 has arrived at position DP1. The eye sees both digits (1, 2) as the eye has not yet forgotten what it saw a while ago. We can decrease the 'scan frequency' and doing so we can force the eye to loss its 'perception power'. Now, the eye will see only the digit 2.

Every field of disciple has it own set of vocabulary that regulates our communications. For example: in hardware what we call data, that is called streams in software. Arduino Forum is predominantly a hardware platform; software (particularly the Library Functions) has come as a great aid to program it. Unfortunately, some of the software veterans talk in a very high level of 'abstraction'.  

5.  In a multiplexed display system,  scanning is done on all the cc-pins of the display units whether there is any data or not for a display position. For example: we want to show only 4 at DP3 position of Fig-1; as a result, there is only one digit that is ON for all the time. Is it going to cause over-heating for the segments of the digit 4? No! The average current for each segment is independently same, which is controlled by the 'series current limiting resistor (2.2K).

6.  Multiplexing Mechanism of 16-digit Display System (direct driven without any display controller) of a Taxi Meter (6-digit Fare Meter, 6-digit Distance Meter, and 4-digit Waiting Time Meter)          
(https://forum.arduino.cc/index.php?action=dlattach;topic=611658.0;attach=305186)
Figure-2: 16-digit direct driven multiplexed display system
Title: Re: 4-digit 7-segment indicator on Multi-function shield
Post by: Paul__B on Apr 23, 2019, 02:58 pm
This is about that red LED 4-digit indicator built into the multi-function shield.
It seems that despite 139 posts at this moment, you have failed to understand how this forum works.

"the multi-function shield' is not by any means a meaningful description.  You need to cite - with a Web link - the animal to which you refer.  Now I presume you mean this device (https://www.ebay.com/itm/Multi-Function-Shield-Buzzer-74HC595-4LED-for-Arduino-UNO-R3-Lenardo-Mega2560/181993441203).
(https://i.ebayimg.com/images/g/04MAAOSwAEhbWsFM/s-l1600.jpg) (https://www.ebay.com/itm/Multi-Function-Shield-Buzzer-74HC595-4LED-for-Arduino-UNO-R3-Lenardo-Mega2560/181993441203)

The thing is, many or most of us with some experience will never have had the need or desire to use such a "shield"; it tends to be  a"beginner" project - and indeed it proves to be!  :smiley-eek:

For whatever reason, this forum will not permit me to post a link to the schematic on electroschematics.com!
Initial research indicates that it is a terrible design using 74HC595s driving the LEDs without current limiting resistors.  This influences discussion of the whole topic to follow.

Well, yes and no.
Multiplexing means time-sharing a single data channel to transfer multiple streams of data. The 4-digit indicator of the MF shield does use multiplexing to transfer data for each digit, no argument here.

However, this has nothing to do with the need to constantly "sweep" the image on the display.
No, it's actually called "multiplexing".  Perhaps you had better take your complaint to the argument section of the Wikipedia page (https://en.wikipedia.org/wiki/Multiplexed_display).  There are probably people there who would enjoy it. Lots of luck!  :smiley-roll:

The MF shield could, for example, implement simple latches for each segment in each digit to make it stay on by itself once it is lit (i.e. add internal "memory" for each segment). This would eliminate the need to constantly "sweep" the display. The display would simply hold its last set state for all its segments. Of course, such display would cost quite a bit more.
Well, it might but I think there are displays that have that integrated into them.  Tiny little ones.  :smiley-eek:

Not worth analysing your post further - I started on it many hours ago but had to go and work elsewhere and the forum choked on electroschematics.com at that moment so I had to come back to it.

In the meantime, Mike has "told it like it is":
Yes it has. It is the term used by hardware people, it is the term everybody uses. Get used to not being correct when you wander outside your area of knowledge.
and
No. You have to use the words as they are used by the rest of the world.
And GolamMostafa has provided a tutorial on display multiplexing.  So you really are well answered.  :smiley-lol:

Title: Re: 4-digit 7-segment indicator on Multi-function shield
Post by: Grumpy_Mike on Apr 23, 2019, 03:09 pm
The MF shield could, for example, implement simple latches for each segment in each digit to make it stay on by itself once it is lit (i.e. add internal "memory" for each segment). This would eliminate the need to constantly "sweep" the display. The display would simply hold its last set state for all its segments. Of course, such display would cost quite a bit more.
All this is true except that when you implement what you describe here, you no longer have a multiplexed display.
Title: Re: 4-digit 7-segment indicator on Multi-function shield
Post by: PaulRB on Apr 23, 2019, 05:31 pm
Here is the schematic for the multi-function shield:
(https://forum.arduino.cc/index.php?action=dlattach;topic=611658.0;attach=305247)
As Paul__B already pointed out, there are no current limiting resistors for the led segments, and no transistors to boost the current for the display's common pins.

So, to answer your original question:
Quote
will keeping  one digit permanently displayed burn the segments out?
the answer is yes, lighting one digit will burn out the display, the shift registers or both. But they will burn out anyway, sooner or later, because this is a badly designed circuit.
Title: Re: 4-digit 7-segment indicator on Multi-function shield
Post by: Montmorency on Apr 23, 2019, 07:35 pm
A mix of useful and useless information here. Many thanks to those who spent their time to come up with the former and address the actual question. The latter apparently came from people who have hard time controlling their temper.

Some remarks here:

1. Nobody is arguing with the fact that the device is referred to as "multiplexed display". Why some people are trying to present it here as if it is a matter of debate is puzzling me. My post #3 contains a clear and concise explanation how the term "mutiplexing" got into the name of this device. If there is something that I haven't made sufficiently clear there - feel free to ask.

2. References to how "hardware people" call it are interesting, but add little to the discussion. We are all aware of many remarkable peculiarities in the genesis of everyday technical terminology, ranging from ingenious to ridiculous. (I surely hope they don't use the term "multiplexing" to refer to the image-forming principle in a CRT display...) Also, see 1.

Some specific remarks:

Yes it has. It is the term used by hardware people, it is the term everybody uses. Get used to not being correct when you wander outside your area of knowledge.
Please, refrain from such remarks about people whose "area of knowledge" you know nothing about. I'm inclined to let it slide this time. But keep in mind that we don't appreciate it here.

The 'scanning technique' does not create the 'illusion' for us to see all the digits simultaneously; rather, it is the 'eye perception' by virtue of which we see that all the digits are there.
Um... Every time human perceptual system distorts one's perception of some natural phenomenon, it is called an illusion. In the above quote you begin by stating that it is not an illusion, and then right away proceed to show that it is.

I'd also use this opportunity to recommend R.L.Gregory's "Eye and Brain: The Psychology of Seeing" as a very good book that explains how many perceptive phenomena are actually facilitated by visual processing centers in human brain, not by human eye per se. This, BTW, also applies to our ability to form a complete image from its components presented by a "swept" display.

However, this has nothing to do with the need to constantly "sweep" the image on the display. The MF shield could, for example, implement simple latches for each segment in each digit to make it stay on by itself once it is lit (i.e. add internal "memory" for each segment). This would eliminate the need to constantly "sweep" the display. The display would simply hold its last set state for all its segments. Of course, such display would cost quite a bit more.
All this is true except that when you implement what you describe here, you no longer have a multiplexed display.
And that's why I made this example. Note that the device might no longer be referred as "multiplexed display"  by those "technical people" (BTW, are you sure about that?), but it would still rely on classic multiplexing for interface purposes. Another example would be a good old mechanical flip-disc display: such displays are controlled by a multiplexed data interface, yet they do not need to be constantly "swept" to maintain a continuous image.

These examples clearly show where the actual multiplexing begins and where it ends.

As Paul__B already pointed out, there are no current limiting resistors for the led segments, and no transistors to boost the current for the display's common pins.
Good point about resistors, but the part about transistors is irrelevant. The transistors are normally needed to avoid overloading Arduino outputs when they are connected directly to the LED segments. However the display on this MF shield is not driven directly by Arduino, it is driven by a pair of MC74HC595AD registers, which can handle the load. Meanwhile, the Arduino only supplies data through a 3-wire multiplexed line.
Title: Re: 4-digit 7-segment indicator on Multi-function shield
Post by: Paul__B on Apr 24, 2019, 12:28 am
Here is the schematic for the multi-function shield:
I give you credit for finding one which does not cause the forum to give me a poison cookie!

It does however contains spurious parts - the "standard" MFS does not have those relay drivers.

As Paul__B already pointed out, there are no current limiting resistors for the led segments, and no transistors to boost the current for the display's common pins.
Exactly my point.

So, to answer your original question:the answer is yes, lighting one digit will burn out the display, the shift registers or both. But they will burn out anyway, sooner or later, because this is a badly designed circuit.
Did I mention?  No I didn't because I was so busy figuring out what the rotten forum had done to me!  :smiley-eek:

Forensics is part of my job (called out last night by coincidence) so I actually sank $3 to buy one of these boards on eBay - just to complain about it.  :smiley-lol:

All the other parts of the design are fine - switches to ground with pull-ups, LEDs with conservative resistors (but could be more conservative!) pin-outs for temperature sensor and IR receiver.  I would certainly not advise anyone else to purchase it other than for sheer morbid curiosity!