Arduino + 7 Segment Display [Feedback Needed]

Hello all,

This is my first real project using Arduino. I have integrated a 7 segment display with Arduino and it goes on in a loop and displays the numbers from 0-9.

You can view the Fritzing diagram of the circuit below.

The code for the program is available at my github account arduino-sketches/SevenSegment at master · sudar/arduino-sketches · GitHub

I know this is kind of simple, but please do go through the circuit and let me know if I am a) doing anything wrong (b) can I improve anything.

Thanks for your time. :slight_smile:

A few things: You wired up your circuit as common cathode display, your text says common anode. If it works, no problem, just change the label.
Next, you have a current limiting resistors on both middle contacts. That's not what you want, they're connected internally and present on both sides for convenience only. Remove one.
Last, you have the current limiting resistor on the common cathode. Which means, the current through led varies with how many segments are active, so the 8 will be much darker than the 1. It's better to put a resistor on each line from the Arduino to the anode of each led. The version with the resistor on the common cathode can also fry a led, if one draws more current than the others. But that shouln't be problem with a 7-segment led display, the leds are going to be pretty much equal.

Korman

Thanks for the reply.

Even I was confused whether it has a common cathode or common anode. The datasheet says it is common anode, but I am not very sure. Is there a way by which I can check whether it is common anode or cathode?

Regarding the current limiting resistors, I will remove one of them.

If the middle pin is attached to +5V and the LEDs work, it's a common anode. If it's attached to GND, it's a common cathode.

Korman

Thanks for letting me know the method. I checked and it indeed seems to be common cathode. I guess the datasheet is wrong.

I have updated my circuit diagram.

Well done Sudar