4 digit 7 segment display

Hi!

I am current working on a 4 digit 7 seg 5461AS-1. I have made it kind of work and i can count, made a beep when reaching 0 so on. I have an issue tho, The segment B is weird for D2,D3. When projecting a one on D2 its working but kinda dark for seg B, when proejcting another digit with more segment on its like totaly off, and I have tried so much but cant figure out what it could be.

I have a similar problem for seg F for D1-D3. The first digit (D4) is always working tho for some reason. Also I have NOT damaged any segments, all are working when using them seperately with 5V, resistor, GND. Might be good to use a shiftregister with stronger power supply, I would guess that could help but I see so many others getting it to work all from arduino. Using Arduino Uno btw.

I have been working on this issue for a while now and would love to get any help there is!

Welcome to the forum

Do you have one current limiting resistor for each segment or or only one for each digit ?

Please post a schematic of your project showing how all components are connected and powered. A photo of a clear pen and paper circuit is good enough

@UKHeliBob is correct, without a schematic we can only guess. While you are posting that post your code as well.

My connection is based on this vide https://www.youtube.com/watch?v=5d-dtMyqUpc. I have my pins according to that setup and my code:

const byte digitPins[] = {9, 10, 11, 12}; // D1..D4 (left→right)
const byte segmentPins[] = {2, 3, 4, 5, 6, 7, 8, 255}; // a,b,c,d,e,f,g,dp(255 = not connected)

A = 2, B = pin 3 etc
The segment for the display is like this picture bellow, but I ofcourse hasnt connected it like the pictures numbers, only based my connection according to the layout.

#include <SevSeg.h>
SevSeg sevseg;

// Your pins
const byte digitPins[]   = {9, 10, 11, 12};            // D1..D4 (left→right)
const byte segmentPins[] = {2, 3, 4, 5, 6, 7, 8, 255}; // a,b,c,d,e,f,g,dp(255 = not connected)

void setup() {

  sevseg.begin(COMMON_CATHODE, 4, digitPins, segmentPins,true, false, false, true);
  sevseg.setBrightness(100); // 0..100
}

void loop() {
  static unsigned long last_1 = 0;
  static unsigned long last_2 = 0;
  static int value = 10;

  // Display the current value (0..9999)
  sevseg.setNumber(8888, 0); // second arg = decimal places, we have not connected that for this project
  sevseg.refreshDisplay();    // MUST be called often (multiplexing)

  // Increment once per second
  if (millis() - last_1 >= 1000) {
    last_1 = millis();
    value = (value - 1) % 10000;
    tone(13,10);
    last_2 = millis();
  }
  if(millis() - last_2 >= 10){
    noTone(13);
  }

  while(value == 0){
    sevseg.setNumber(value,0);
    tone(13,10);
    delay(1000);
    noTone(13);
    delay(1000);
  }
}


Result from code above

there aren’t any resistors in the youtube video !


If you are using this circuit copied from the video then it looks like you don't have any current limiting resistors in place at all

If that is the case do not power up your circuit until you understand the problems that may cause

I absolutely get your point, hovewer they dont show it and the current is not enough to kill it from the digital pins. Will always use resistor if from the 5V pin tho.

Please show your calculations to prove that.

Using pin 9 - 12 as power source You need to limit the current to 3 mA. Else those pins might get overloaded.

aight, guess I dont have that but they havent died from it in my circuit. Have had resistors to try to see where the issue could be but they just sink slightly in light. I guess it fair to say that they could brun out quicker by time.

They are only catode in this case, dont know if that helps. Will think of not overloading those!

Probably your leds in a safe zone, but it are not only thing in danger . In your circuit you have a risk to fry an Arduino pins.

Yes, youre likely right.

Where did you put them in the circuit, what value were they and how many did you use ?

they were 330 ohm, i tried both on all segments except the once not lit. Also tried to have them on the common cathodes, so pin 9-12. Didnt really help in any way I could see.

Except safer use of the components i guess as many are telling me haha.

Did you installed a pair of resistors on each segment?

Too much words instead of the one drawing.
It would be better if you present a schematics.

This circuit shows how to correctly and safely wire a common anode 4x7 segment display for direct drive by an Arduino UNO R3. The resistors and the transistors are required.

For a common cathode display, you would use NPN transistors from cathodes to GND.

You're right, im sorry. Here is a picture of my connection with arduino pins and resistors.