Multiple 7-segment LED Displays

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
TestRunner
 
Posts: 3
Joined: Tue Jun 21, 2016 5:27 pm

Multiple 7-segment LED Displays

Post by TestRunner »

Hi, I'm trying to make a timer/clock display by using two 1.2" 7-segment displays side by side. I have code that will display the time across the two displays. I've wired both of the displays and an Arduino Due together soldered on a protoboard (Using the 3.3V, 5V, GND, SCL, SDA pins). If I connect only one of the two displays then the program works fine (as far as I can tell). However, when I have both displays connected it works fine for a while but then both displays will simultaneously freeze after some seemingly random amount of time. This usually takes about a half an hour for the freeze to happen but it varies a lot. The displays continue to display but no longer update.

I can verify that the arduino main loop is still running normally as it is communicating with my computer over Serial and continues to do so when the displays freeze. I can also verify that the arduino continues to try to update the displays with new values on the program's side. I have not tested if the SDA/SCL pins are oscillating in an appropriate manner with an oscilloscope.

I next tried changing the displays brightness, but that didn't seem to help. Setting to the lowest setting seemed to cause the crash even faster (a few minutes)?

Next I tried having the displays powered externally since I am probably drawing too much from the Arduino's pins. I used a 2A 5V DC USB power line to power the displays by connecting the GND and 5V to it instead of the Due. The displays did not turn on at all when I did this. I then connected the external ground and Due ground together because I was measuring a ground level differential with a multimeter. This seems work and the displays turn on. However the displays still freeze after an hour or two.

Thinking I might be putting too much power over the trace in the protoboard, so I race the 5V and GND across two traces, but that didn't seem to help.

Lastly I went back and used a breadboard instead, and it seemed to improve it. I thought it was stable finally, but it froze after 6 hours. I assume the breadboard probably can handle a higher amperage or something? I'll need to have this be able to run for multiple days.

I'm pretty confused at the moment and could really use some assistance if anyone can help. Testing this is very difficult because of how long it takes for the freeze to happen. Let me know if there's any more info people need or things for me to try. Thanks a lot of your time.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Multiple 7-segment LED Displays

Post by adafruit_support_mike »

It's very unlikely that the problems are related to power. The 7-segment displays use 150mA at most, and just about any wire thick enough to see will carry that much safely.

If you have the capability to watch the I2C signals on an oscilloscope or logic analyzer, do. It's always good to see what the signals are doing if you can.

Also try measuring your code's memory use:

https://learn.adafruit.com/memories-of- ... ree-memory

Memory exhaustion is one of the most common reasons for code to fail at random times after working normally.

User avatar
TestRunner
 
Posts: 3
Joined: Tue Jun 21, 2016 5:27 pm

Re: Multiple 7-segment LED Displays

Post by TestRunner »

Thanks for the response!

I'll have to wait until the oscilloscope/logic analyzer at work is free which will probably be a few more days. I'll mess with it when I get the chance, but probably will be too late for my deadline unfortunately.

For memory: I only use about 7% of of the flash memory. I do not use EEPROM. I don't think I dynamically allocated anything but I checked free memory on SRAM anyways and I have 22971 bytes free at the start of each main loop, so I'm certain that everything is being freed if there happened to be something missed.

I'm not sure it's a memory issue anyways since like I said, my code still runs and everything (buttons, serial interface, etc) still works. Only the LED display stops functioning. If there were some kind of SRAM OOM then I'd expect the whole system to crash, right?

I did more testing and I noticed that when I set the brightness level higher, the timer seems to periodically hang for a little bit. At half brightness it hangs for about 50-100ms every second and at full brightness it hangs for about 100-200ms every half second. By hang I mean that it stops updating for a short time. The rest of the arduino still functions continuously. This makes it pretty clear to me that it is very likely some kind of power or heat issue and not a programming one.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Multiple 7-segment LED Displays

Post by adafruit_support_mike »

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

User avatar
TestRunner
 
Posts: 3
Joined: Tue Jun 21, 2016 5:27 pm

Re: Multiple 7-segment LED Displays

Post by TestRunner »

I took some pictures and I also included the wiring schematic. Let me know if these aren't sufficient.

http://puu.sh/pGDCM/74fe476985.zip

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Multiple 7-segment LED Displays

Post by adafruit_support_mike »

Sorry for the late reply.

I don't see anything in the wiring or connections that would be likely to make a system crash. All the wiring should be able to carry a couple amps of current, but you might try replacing the jumpers in case one of them has a break inside the insulation.

User avatar
TerryG1014
 
Posts: 3
Joined: Tue Feb 20, 2018 6:33 pm

Re: Multiple 7-segment LED Displays

Post by TerryG1014 »

I have one 7 segment display and I would like tie 2 together side by side. I made a pinball machine and would like to be able to have an 8 digit score display. The display I have is the 1.2 inch with the backpack. I'm using an Arduino mega for this project. Can this be done or do I need to look elsewhere? Any help would be appreciated. Thanks
Terry Gruenenfelder

User avatar
kcl1s
 
Posts: 1512
Joined: Tue Aug 30, 2016 12:06 pm

Re: Multiple 7-segment LED Displays

Post by kcl1s »

Terry,
If you are talking about the code to split the score so you can display the lower 4 digits on one display and the upper digits on another you could use some code like this to split them.

Code: Select all

long score = 12345678;
int high4;
int low4;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  high4 = score/10000;
  low4 = score % 10000;
  Serial.println(score);
  Serial.println(high4);
  Serial.println(low4);
}

void loop() {
  // put your main code here, to run repeatedly:

}
You would need to give the backpacks different I2C addresses following this guide. https://learn.adafruit.com/adafruit-led ... 2c-address Then create 2 instances of the 7segment in your code. Here is the example code to get you started. https://github.com/adafruit/Adafruit_LE ... venseg.ino

Hope this helps
Fellow hobbyist
Keith

User avatar
TerryG1014
 
Posts: 3
Joined: Tue Feb 20, 2018 6:33 pm

Re: Multiple 7-segment LED Displays

Post by TerryG1014 »

Keith,

That's exactly what I want to do. I still need to purchase another 7 segment display, I'll update my post once I get everything configured.
Thank you for the reply.

Terry

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”