I am a complete beginner to Arduino and electronics. One of the tutorials i was doing required me to use a 4 digit LED display with 12 pins. What i ordered online is different from what is in the tutorial unfortunately. I just want to know how do i interface this LED with the Arduino UNO i have.
You left out one critical piece of information: COMMON ANODE or COMMON CATHODE ?
Please post a link to the vendor's website for this display.
I just want to know how do i interface this LED with the Arduino UNO i have.
Maybe so, but until we know how much you know about leds we can't answer your question.
Do you know how to connect a led (ANY led) ? (do you know what cathode and anode mean ?)
The pins are clearly marked. We don't know if they are active HIGH (COMMON CATHODE) or active LOW
(COMMON ANODE). We also don't know if the DIGIT ENables are active HIGH or LOW.
You can see that the Digit enables drive transistors, which makes them active HIGH.
You can see that in order for any segment to light, the corresponding segment pin must be HIGH.
You need to make a table that lists the segments required for each number and create functions for
each number. There are other ways to do it, like port writes using an 8-bit port and writing a constant
defined as the combination of 1s and 0s to light some particular number. The constant is in the form
b01111111 (binary).
It seems to me that you are asking the wrong question. The question you should be asking is:
How do I research a topic to find the necessary documentation and instructions to build a circuit and write the code ?
The answer is:
Google the topic with the keyword "arduino" at the beginning of your search and the keywords
"schematic" and "code" and "tutorial" at the end of your search:
ie:
"arduino 4-digit 7-segment display schematic example code tutorial"
Think about it ? What is the difference between lighting a single 5 mm red led using a resistor and lighting a 4-digit 7 segment display with all the resistors built in ?
Is the code any different. Does it not depend on whether it is COMMON CATHODE or COMMON ANODE ?
Is not the anode always more positive with respect to the cathode ?
I can see 4 transistors at the top of the board, these will each select one of the 4 digits.
On the connector at the lower left hand side, the pins are clearly labeled 5V, D1, D2, D3 and D4.
I think the transistors are going to be PNP transistors that connect 5V to the common anodes of the display to when you take any of the D1 - D4 pins low.
You will most likely need to invert the data sent to select the digit, if the display used in the tutorial didn't have the transistors.
So you need to supply +5V to the pin marked 5V, then take the other pins low as required to select digits and segments. I assume the tutorial will explain how to multiplex the display.
I started typing my last reply before you posted the information about the seller's website, and the Indestructable site.
Now that I have seen the photographs on the seller's website, which clearly show both sides of the PCB, I am now certain that what i suspected is correct.
You have Common Anode displays, with the drive to the anodes inverted by transistors.
You need to take pins low to select digits, and also to select segments.
The Instructable guy used Common Cathode displays.
He takes pins low to select digits (same as you), but he takes pins high to select segments (opposite to you).
So you will need to make changes to his sketch.
At the end of his sketch there are functions to display digits 0 to 9 and to clear the display.
Luckily line numbers are displayed, so the changes you need are:
Lines 285 to 415 each time he has LOW, you need to change it to HIGH, and each time he has HIGH, you need to change it to LOW.
JohnLincoln:
I think the transistors are going to be PNP transistors that connect 5V to the common anodes of the display to when you take any of the D1 - D4 pins low.
They should be PNP, and quite likely are, but there is no immediate guarantee that they are - it is vaguely possible they are NPN emitter followers with incorrectly implemented base resistors.