# Malfunctioning 4-digit,7 segment display

**URL:** <https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185>\
**Category:** LEDs and Multiplexing\
**Created:** [October 14, 2024, 2:11pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185 "2024-10-14T14:11:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![arduinojanuary](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/arduinojanuary/32/1099446_2.png) [@arduinojanuary](https://forum.arduino.cc/u/arduinojanuary)\
**Post date:** [October 14, 2024, 2:11pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/1 "2024-10-14T14:11:04Z")

</div>

I am using a 4-digit,7 segment display for a project.Initially, it worked perfectly, butAfter some time, the display suddenly started malfunctioning and I faced many problems. Therefore, I decided to test it. I am using an arduino uno and COMMON\_ANODE has worked for me.  
The problems I face are:  
2 dim digits and one segment being dim/off in all 4 digits.

The code:

```arduino
#include <SevSeg.h>
SevSeg sevseg;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600); // start communication
  byte numDigits = 4;
  byte digitPins[] = { 10, 11, 12, 13 };
  byte segmentPins[] = { 6, 7, 8, 9, 2, 3, 4, 5 };
  bool resistorsOnSegments = false; // 'false' means resistors are on digit pins
  byte hardwareConfig = COMMON_CATHODE; // See README.md for options
  bool updateWithDelays = false; // Default 'false' is Recommended
  bool leadingZeros = false; // Use 'true' if you'd like to keep the leading zeros
  bool disableDecPoint = false; // Use 'true' if your decimal point doesn't exist or isn't connected. Then, you only need to specify 7 segmentPins[]

  sevseg.setBrightness(100);
  sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments,
               updateWithDelays, leadingZeros, disableDecPoint);
}

void loop() {
  // put your main code here, to run repeatedly:
  sevseg.setNumber(8888, 0);
  sevseg.refreshDisplay();
}

```

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/0/a/e/0aec0542ce7bd5671c2c3b0849176cf87a0405db.png)

P.S : I am a first time poster and a beginner so I have probably made a silly mistake.I hope I have provided all the required info and if any info is required, please tell me.I hope you can view my circuit digram.  
I did fix some issues by tinkering with the circuit but this problem is not getting solved, please do help me.

---

<div class="post-metadata">

**Author:** ![kolaha](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kolaha/32/966427_2.png) [@kolaha](https://forum.arduino.cc/u/kolaha)\
**Post date:** [October 14, 2024, 2:41pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/2 "2024-10-14T14:41:00Z")

</div>

> [@arduinojanuary](#):
>
> 2 dim digits and one segment being dim/off in all 4 digits.

photo ?

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [October 14, 2024, 2:48pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/3 "2024-10-14T14:48:46Z")

</div>

The wiring diagram is uninterpretable, because we don't know how the display is wired. But I suspect that you are burning out port pins.

A port pin can support only about 20 mA, either "going in", or "going out". The pins that select the segment anodes or cathodes are probably expected to conduct many times that.

You need transistors to drive the anodes or cathodes.

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [October 14, 2024, 2:53pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/4 "2024-10-14T14:53:09Z")

</div>

> [@arduinojanuary](#):
>
> I am using an arduino uno and COMMON\_ANODE has worked for me.

Then the circuit you should use is this:-

 ![Seven Segment Bus CA](https://europe1.discourse-cdn.com/arduino/original/4X/8/c/1/8c17805133365f95a5051770b907a4d5f7cad895.jpeg)

Note the big diffrence between the correct way of wiring it up and what you did is:-

1. The anode of each display needs to be connected to a PNP transistor driver, not to resistors.
2. Each segment needs to be connected to a current limiting resistor, not direct to the Arduino.

These two things are why you damaged both your seven segment displays and most probably your Arduino as well.

Damage like this does not necessarily show immediately, it will simply shorten the time before failure. This is what you are seeing.

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [October 14, 2024, 3:01pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/5 "2024-10-14T15:01:41Z")

</div>

> [@arduinojanuary](#):
>
> ` byte hardwareConfig = COMMON_CATHODE; // See README.md for options`

> [@arduinojanuary](#):
>
> I am using an arduino uno and COMMON\_ANODE has worked for me.

? ? ?

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [October 14, 2024, 3:25pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/6 "2024-10-14T15:25:41Z")

</div>

First determine whether your display is common anode or common cathode (see above post).

---

<div class="post-metadata">

**Author:** ![arduinojanuary](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/arduinojanuary/32/1099446_2.png) [@arduinojanuary](https://forum.arduino.cc/u/arduinojanuary)\
**Post date:** [October 14, 2024, 4:10pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/7 "2024-10-14T16:10:56Z")

</div>

> [@kolaha](#):
>
> photo ?

I did upload an image but I think there was an error sorry,here is the image:

 ![WhatsApp Image 2024-10-14 at 9.34.06 PM](https://europe1.discourse-cdn.com/arduino/original/4X/6/3/d/63dac9609c57a95acbdffd0063a1ebde69197336.jpeg)

> [@Grumpy\_Mike](#):
>
> The anode of each display needs to be connected to a PNP transistor driver, not to resistors.

Thanks for the suggestion but unfortunately i do not have a transistor are there any alternatives

PS: If I input 1111 then i get this , so I am not sure if the segments are damaged:

 ![WhatsApp Image 2024-10-14 at 9.40.20 PM](https://europe1.discourse-cdn.com/arduino/original/4X/c/2/4/c244aa4a163d85eda4d140c7218c465c5b350b4a.jpeg)

---

<div class="post-metadata">

**Author:** ![arduinojanuary](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/arduinojanuary/32/1099446_2.png) [@arduinojanuary](https://forum.arduino.cc/u/arduinojanuary)\
**Post date:** [October 14, 2024, 4:15pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/8 "2024-10-14T16:15:02Z")

</div>

Thanks for the suggestion could you suggest a way to cross verify if it is Common cathode or common anode  
Btw I have a 4 digit display labelled : 3461BS-1 348

Sorry for the inconvenience and thanks in advance

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [October 14, 2024, 4:17pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/9 "2024-10-14T16:17:07Z")

</div>

Where did you buy it? The product page should state the connection.

[This one](http://www.lanpade.com/7-segment-led-dot-matrix/3461bs.html) is common anode.

---

<div class="post-metadata">

**Author:** ![arduinojanuary](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/arduinojanuary/32/1099446_2.png) [@arduinojanuary](https://forum.arduino.cc/u/arduinojanuary)\
**Post date:** [October 14, 2024, 4:18pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/10 "2024-10-14T16:18:51Z")

</div>

I will check if the port pin is burnt out and inform you.Thanks for the info.

---

<div class="post-metadata">

**Author:** ![ShermanP](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@ShermanP](https://forum.arduino.cc/u/ShermanP)\
**Post date:** [October 14, 2024, 4:31pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/11 "2024-10-14T16:31:53Z")

</div>

> [@arduinojanuary](#):
>
> 3461BS-1 348

It appears to be common anode:

[http://www.xlitx.com/datasheet/3461BS.pdf](http://www.xlitx.com/datasheet/3461BS.pdf)

Make sure the display pins are inserted correctly in the breadboard, and not shifted over one slot.

What value resistors are you using? I think you can use it without transistors if you use higher value resistors (at least 1K, but 2.2K would be better) on each of the eight segment lines, with no resistors on the common anode pins. 1K resistors would have the anode pins sourcing 25mA for an "8.", which is really pushing it. 2.2K, or even 1.5K, should work ok, but might not be very bright.

Edit: No, I'm wrong. Your wiring should work. See below.

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [October 14, 2024, 4:49pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/12 "2024-10-14T16:49:43Z")

</div>

Please explain why the posted code uses COMMON\_CATHODE for hardware configuration.

---

<div class="post-metadata">

**Author:** ![ShermanP](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@ShermanP](https://forum.arduino.cc/u/ShermanP)\
**Post date:** [October 14, 2024, 5:02pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/13 "2024-10-14T17:02:54Z")

</div>

Your library settings include:

```arduino
resistorsOnSegments = false;

```

That means the library will use multiplexing by segment instead of multiplexing by digit. And that means that only one segment line is turned on at a time, but all the common anodes (digits) that use that segment are turned on at the same time. So the maximum load on a segment line is four segments if that segment is lit up on all four digits, which an Arduino should be able to do without resorting to transistors at, say, 5mA per segment or so. And the maximum load on an anode line is one segment.

So your original drawing should work if you have the display and the Arduino inserted in the right places in the breadboard, and if the anode resistors are reasonable. But you do need to change code to reflect that you're using a common anode display.

You can confirm that it's common anode by removing all the jumpers to the display, then connecting the 5V pin of your Arduino to pin 12 of the display through a resistor, and pin 1 of the display to an Arduino GND pin. That should light up a segment.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 14, 2024, 7:02pm UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/16 "2024-10-14T19:02:24Z")

</div>

The 10K resistors are way too high. I am surprised you can see the display lighting at all, except in a very dark room.

I think @ShermanP is correct in post #13 (not post #11), resistorsOnSegments = false will cause the library to multiplex by segment, rather than by digit, so only 1 resistor per digit is required, and each pin is only handling current for a single segment at any instant in time, so no transistor is needed, although this will limit the brightness of the display.

In your case, the average current flowing through each segment would be around (5-1.8)/10000/8 = 26uA which is so small that it could barely be seen. For this reason I think your circuit isn't as you have shown. Please post some bright, clear photos of the whole circuit from above.

---

<div class="post-metadata">

**Author:** ![arduinojanuary](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/arduinojanuary/32/1099446_2.png) [@arduinojanuary](https://forum.arduino.cc/u/arduinojanuary)\
**Post date:** [October 15, 2024, 1:41am UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/17 "2024-10-15T01:41:34Z")

</div>

Sorry it was an error i was trying to figure out if i had commen cathode or anode

---

<div class="post-metadata">

**Author:** ![arduinojanuary](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/arduinojanuary/32/1099446_2.png) [@arduinojanuary](https://forum.arduino.cc/u/arduinojanuary)\
**Post date:** [October 15, 2024, 1:46am UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/18 "2024-10-15T01:46:56Z")

</div>

I am not using 10k resistors , sorry for the mistake.  
I am using 2 1K resistors and 2 330 resistors for the digit pins

---

<div class="post-metadata">

**Author:** ![arduinojanuary](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/arduinojanuary/32/1099446_2.png) [@arduinojanuary](https://forum.arduino.cc/u/arduinojanuary)\
**Post date:** [October 15, 2024, 1:48am UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/19 "2024-10-15T01:48:21Z")

</div>

> [@arduinojanuary](#):
>
> PS: If I input 1111 then i get this , so I am not sure if the segments are damaged:

Does anyone have a idea on why the display is not showing any other no. properly even after i fixed my code

---

<div class="post-metadata">

**Author:** ![arduinojanuary](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/arduinojanuary/32/1099446_2.png) [@arduinojanuary](https://forum.arduino.cc/u/arduinojanuary)\
**Post date:** [October 15, 2024, 1:49am UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/20 "2024-10-15T01:49:08Z")

</div>

Thanks! Will check it out and tell if it works

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [October 15, 2024, 3:21am UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/21 "2024-10-15T03:21:50Z")

</div>

> [@arduinojanuary](#):
>
> why the display is not showing any other no. properly

The possibility of damaged display segments and/or port pins has already been mentioned.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 15, 2024, 5:53am UTC](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185/22 "2024-10-15T05:53:40Z")

</div>

> [@arduinojanuary](#):
>
> The problems I face are:  
> 2 dim digits

> [@arduinojanuary](#):
>
> I am using 2 1K resistors and 2 330 resistors for the digit pins

Do you think that could be a reason?

[Next page](https://forum.arduino.cc/t/malfunctioning-4-digit-7-segment-display/1311185.md?page=2)
