Accessing peripheral with Arduino UNO

Hi, I have a question about using a 3_digit numeric LED display with Arduino, the LED display is connected to Arduino UNO, the details of the LED display are shown in the picture above. Suppose we want to show "0" to DIG2/D1, according to the instructions, I need to

  • apply logic '0' to segment [a...f]
  • apply logic '0' to C2 and
  • keep logic '1' to C1 and C3 as off

then segment [a...g] of DIG1/D0 will lit on. I don't understand why we apply logic '0' to C2, as I know, C2 represents DIG2, where we want to output the number, so why do we need to apply logic '0' to it? Also, aren't segments [a...f] we want to lit on, why apply logic '0' to them? What does the 'logic 1/0' mean in this context? Any help would be appreciated!

Logic 0 is 0V (ground), logic 1 is Vcc (5V on an Uno). To light any segment you need a logic 1 on the segment and a logic 0 on the DIGx terminal. Conventional current flows from the segment input through the a current limit resistor and LED and to ground (logic 0) at the DIG terminals.

Not shown are the required current limit resistors on each of the segments.

Usually need a transistor on the digit (common) lines to handle the current from, potentially, 7 lit segments.

1 Like

Thanks! But why apply logic '0' to C2/DIG2? As you say, isn't logic '1' should be applied? Likewise, why logic '1' is applied to C1/DIG1 and C3/DIG3?

An LED is a diode. Current can flow only one way through a diode. To light the LED current must (and can only) flow from the anode to the cathode so to light the LED the anode must more positive than the cathode.
We, usually, define logic 1 as Vcc and logic 0 as ground. So in order to light, the anode must be at logic 1 (Vcc) and the cathode at logic 0 (ground). That is the only condition that will light the LED. If the anode is at 0 and the cathode is 0 there can be not current flow just as if the anode is 1 and the cathode is 1 there is no current flow and no light. The remaining condition is the anode at 0 and the cathode at 1. In that case the anode is NOT more positive so no current can flow through the diode. To light the digit the DIGx must be 0 and the desired segment(s) must be at 1. DIGx at 1 will be off no matter what the segments are at.

The (conventional) current only flows in the direction of the arrow.

1 Like

Oic, many thanks for the help!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.