Maker Pro
Maker Pro

Arduino pin to switch around 140ma?

mickmazz

Oct 24, 2022
5
Joined
Oct 24, 2022
Messages
5
Hi!
I'm kind of a beginner. I built this project: https://electronics-project-hub.com/arduino-7-segment-display-clock-with-and-without-rtc/ which works well with the 4-digit 7-segment module, but my plan is to change each segment to a 20mA LED (or maybe less, because I want it less bright).
So I checked it out and if I connect the 20mA segments the same way on it, I'm wondering if it will be over the current rating of the Arduino (I've seen continuous 20mA/pin and 200mA in total)? Or is it not because it is pulsating so not all the displayed segments will be powered at the same time?
I've been thinking to add NPN (or PNP?) transistors trying to solve this possible issue like this:
disp.PNG
My question is if it's going to be ok connected like this with the transistors or is it actually unnecessary and I can connect just directly to the Arduino pins?
 

Bluejets

Oct 5, 2014
6,920
Joined
Oct 5, 2014
Messages
6,920
Which Arduino...?
7 segments per digit(possibly 8 with decimal point) ......... 20mA each.......
however you have 1k so 5mA per.....??
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,719
Joined
Nov 17, 2011
Messages
13,719
  1. A single pin of the Arduino can source or sink up to 40 mA (although afaik <= 20 mA are recommended). There is a second limit, however, which limits the total current into the Vcc or GND pin of the processor to 200 mA. With a power supply current for the processor of <= 20 mA this leaves max. 180 mA for the I/O pins. Therefore it is a good idea to decouple high loads by external transistors.
  2. Using an NPN transistor to switch +5 V (high side switching) is possible but not a good technique. The emitter of the transistor is 0.6 V lower than the base, so the displays never "see" the full 5 V. This may not be a problem here, but in many other applications. See our resource on using transistors to switch a load.
You may also want to read this info about driving LEDs with an Arduino.

What is totally unclear to me is the connections shown in your diagram. Normally you use a driver transistor to drive the common cathode. If, as shown in your diagram, the common cathode is driven directly by the Arduino, the total current will be 7 × Isegment which at 20 mA per segment is way too much for the Arduino.
Have a look at this project to see how its done correctly.
 

mickmazz

Oct 24, 2022
5
Joined
Oct 24, 2022
Messages
5
Which Arduino...?
7 segments per digit(possibly 8 with decimal point) ......... 20mA each.......
however you have 1k so 5mA per.....??
Arduino Nano, possibly not the original but same. I just put 1k, might want to put actually like 320 or 510, or however the current stays in safe zone and the LEDs will be bright enough.
 

mickmazz

Oct 24, 2022
5
Joined
Oct 24, 2022
Messages
5
  1. A single pin of the Arduino can source or sink up to 40 mA (although afaik <= 20 mA are recommended). There is a second limit, however, which limits the total current into the Vcc or GND pin of the processor to 200 mA. With a power supply current for the processor of <= 20 mA this leaves max. 180 mA for the I/O pins. Therefore it is a good idea to decouple high loads by external transistors.
  2. Using an NPN transistor to switch +5 V (high side switching) is possible but not a good technique. The emitter of the transistor is 0.6 V lower than the base, so the displays never "see" the full 5 V. This may not be a problem here, but in many other applications. See our resource on using transistors to switch a load.
You may also want to read this info about driving LEDs with an Arduino.

What is totally unclear to me is the connections shown in your diagram. Normally you use a driver transistor to drive the common cathode. If, as shown in your diagram, the common cathode is driven directly by the Arduino, the total current will be 7 × Isegment which at 20 mA per segment is way too much for the Arduino.
Have a look at this project to see how its done correctly.
Well yes, I see now sinking all that into the Arduino is not a good idea:D
I'll check this project out, thanks!
 
Top