[SOLVED] 7 Segment display error

Hi,

I have this TM1637 4 digit 7 segment display module and I have programmed it to display the message "FULL" once a certain event is triggered.
A few weeks ago the display showed the message correctly for an old project but today when I inserted the code into another project, the display shows a wrong message "FUUO".

What seems to be the error in my project? I use the TM1637 library.
The module is connected to 3.3v outlet on my Arduino nano and its powered from a 9v wall adapter.
My previous project was powered by laptop USB port but this new project requires more power than USB port can provide.

The code is

#include <TM1637Display.h>

const uint8_t FULL[] = {
  SEG_A | SEG_E | SEG_F | SEG_G,                   // F
  SEG_B | SEG_C | SEG_D | SEG_E | SEG_F,           // U
  SEG_D | SEG_E | SEG_F,                           // L
  SEG_D | SEG_E | SEG_F                            // L
};
TM1637Display display(CLK, DIO);

before void setup

and

  if(s >= 100)                   // If integer greater than or equal to '100'
  {
  display.setSegments(FULL); // Display the message "FULL"
  }
  else if(s <=0)                 // Else if integer less than or equal to '0'
  {
  display.showNumberDec(0,false);// Display the number '0'
  }

inside void loop after an event is triggered.

inside void loop

it is called the loop function, void is simply the type of variable it returns.

If you want help then post ALL your code. If this is too big then post a minimum sketch that shows the problem.

If you would have read How to use this forum you would have known this.

Sorry, I didn't post the entire code because I didn't find it relevant since *const uint8_t FULL[] *
was the only code for that faulty message.
Also I thought it was more of a hardware issue than programming issue.

Here is the code ( I change the value of integer 's' and check the display )

#include <TM1637Display.h> 

const byte CLK = 4;   // Clock pin on D2
const byte DIO = 5;   // Digital pin on D3

const uint8_t FULL[] = {
  SEG_A | SEG_E | SEG_F | SEG_G,                   // F
  SEG_B | SEG_C | SEG_D | SEG_E | SEG_F,           // U
  SEG_D | SEG_E | SEG_F,                           // L
  SEG_D | SEG_E | SEG_F                            // L
};

TM1637Display display(CLK, DIO);  // Set TM1637 Module

void setup()
{
display.setBrightness(0xff);
}

void loop()
{
 int s = 23; 
 if(s >= 100)                   // If integer greater than or equal to '100'
  {
  display.setSegments(FULL); // Display the message "FULL"
  }
  else if(s <=0)                 // Else if integer less than or equal to '0'
  {
  display.showNumberDec(0,false);// Display the number '0'
  }


}

Thanks for posting that.
On seeing it I can only agree with you:-

Also I thought it was more of a hardware issue than programming issue.

Looks like your display has broken.

I would write some code that cycled through the display showing one segment lit at a time to confirm this, but as this display is a module it looks like it is faulty.

hmm.. I tried changing the value of 's' and assigned random numbers (between 0-99) and they all showed fine.

Also I uploaded the example code which makes the display random stuff in variable brightness, and that also went fine.

I tried changing the value of 's' and assigned random numbers (between 0-99) and they all showed fine.

If they are random how do you know if they are right?
Note it is only the last two digits that look like there is a fault on.

I meant I assigned some numbers which value I dont remember, but they showed fine when I did that to check. eg- I assigned 95 and the display showed 95.

The library makes the display unit show numbers from right to left. That means if I give 99, the display will show 0099 (I can also turn off the 00 that comes before the 99).

Displaying numbers is not using the same software function as displaying segments. Maybe your library has become corrupt?

Today it became even weirder. It now shows F86P and F86O and F86U.

How to check if the library has become corrupy?

Hi,
How much current does the digital display consume, are all the segments that light up all the same brightness?
Have you measured the 3.3V to the display with blanked display and loaded display?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom.... :slight_smile:

TomGeorge:
Hi,
How much current does the digital display consume, are all the segments that light up all the same brightness?
Have you measured the 3.3V to the display with blanked display and loaded display?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom.... :slight_smile:

I have no idea how much current is being used. The product I bought had no documentation. It works in both 5v and 3.3v.
Here is the datasheet to seedstudios same unit http://www.seeedstudio.com/wiki/Grove_-_4-Digit_Display

Yes all the active segments are lit up in the same brightness evenly. But if I observe very very carefully I can feel them flicker a bit, but its not even noticeably if you don't look very very carefully.

Sorry I dont have a sketch, the test project is very simple, I have only the display module attached to my arduino nano in my tiny breadboard. VCC to 3.3v ( havent tested 5v yet), GND to GND, DIO and CLK pins both go into Digital I/O pins.

Whats funny is that yesterday it showed atleast FU coreectly, today it shows only F. The display has no problem displaying any numbers.

Hi,
80mA max by the data sheet you linked me too.
Check the arduino board specs and see how much it is capable of supplying.
Have you measured the 3.3V pin?

Tom.... :slight_smile:

TomGeorge:
Hi,
80mA max by the data sheet you linked me too.
Check the arduino board specs and see how much it is capable of supplying.
Have you measured the 3.3V pin?

Tom.... :slight_smile:

Today it changed to "FUUO"... wth??

It could be 80mA, or maybe even more (100-200mA?) since it's not seedstudio display model.
The Arduino is a nano clone, it doesn't have any spec sheet, I don't even know the manufacturer?
But it seems to be working without any issues so far.

I will try to measure the 3.3v pin using my multimeter, also I will try plugging it into 5v and see if there is any change. :slight_smile:

also I will try plugging it into 5v and see if there is any change.

Plugging what?
Please do not do that.

Grumpy_Mike:
Plugging what?
Please do not do that.

The TM1637 display module into 5v pin of arduino.
No worries, the module works on both 3.3v and 5v as it has internal power management. :slight_smile:

You're sending commands to the display thousands of times a second. No wonder it looks weird.

will it work ok if if give a delay(1000)?

I will try and let you know.

Noobian:
will it work ok if if give a delay(1000)?

I will try and let you know.

Yes, or better, you can use millis().

aarg:
Yes, or better, you can use millis().

That did it, I gave a delay(1000) and now it correctly displays the message "FULL".
You were right about the delay part, you are sharp eyed. :slight_smile:

Edit - the problem is now totally fixed

Thanks for all your help and support, especially aarg