NPN transistor with LEDs on emitter and collector side; Arduino with ULN2003

Tank Circuit

Joined Mar 5, 2017
31
To address the issue with the Darlington driven by the Arduino.
I suspect this will help explain your findings. The Arduino output (pin 13) is either low (the MCU shorts this pin to GND internally) or high (this pin is connected to B+ through a "pull-up" resistor). When it's high and with no load connected this pin, it will read the 5VDC. Dependent upon the load impedance this "pull-up" resistor will create a voltage divider. I suspect the input impedance of the ULN2003 is quite low causing the measured voltage to be substantially reduced.
One question, why are you connecting the output of the Darlington IC (pin 16) to pin 10 and the LED? Is this just a Fritzing error?
 

ebeowulf17

Joined Aug 12, 2014
3,307
(this pin is connected to B+ through a "pull-up" resistor). When it's high and with no load connected this pin, it will read the 5VDC. Dependent upon the load impedance this "pull-up" resistor will create a voltage divider. I
Are you sure about that? I thought most Arduinos could drive 20mA through any individual pin safely, with higher peak currents possible. The output impedance of the Arduino pin would have to be very, very high to end up with 1.5V across a 2.7k resistor/darlington input.

Here are some interesting discussions about Arduino output impedance:

https://forum.arduino.cc/index.php?topic=134680.msg1012839#msg1012839

http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

The second link is mostly about LEDs, but partway down the page there's an interesting experiment testing Arduino output characteristics. The screenshot below shows the most relevant graph, indicating that outputs of over 250mA are possible, albeit not advisable.
IMG_5776.PNG
 

Thread Starter

BC547

Joined May 22, 2018
41
To address the issue with the Darlington driven by the Arduino.
I suspect this will help explain your findings. The Arduino output (pin 13) is either low (the MCU shorts this pin to GND internally) or high (this pin is connected to B+ through a "pull-up" resistor). When it's high and with no load connected this pin, it will read the 5VDC. Dependent upon the load impedance this "pull-up" resistor will create a voltage divider. I suspect the input impedance of the ULN2003 is quite low causing the measured voltage to be substantially reduced.
One question, why are you connecting the output of the Darlington IC (pin 16) to pin 10 and the LED? Is this just a Fritzing error?
Hello,

Actually output of the darlington pin number 16 is not connected anywhere.
 

ebeowulf17

Joined Aug 12, 2014
3,307
hi,
This clip from the ULN d/s shows the various configurations, easy to calc the input impedance.
E
View attachment 153578
I can't see the part number on the chip in the original pics. I wonder if it's a ULN2001 instead of ULN2003. With no current limiting resistor, the voltage at the input pin would be roughly equivalent two diode Vf drops, right? That would almost explain the ~1.5V reading...
 

Thread Starter

BC547

Joined May 22, 2018
41
I can't see the part number on the chip in the original pics. I wonder if it's a ULN2001 instead of ULN2003. With no current limiting resistor, the voltage at the input pin would be roughly equivalent two diode Vf drops, right? That would almost explain the ~1.5V reading...
Hi,

The part number I have used is ULN2003APG. I shall try putting a resistor ...
 

ebeowulf17

Joined Aug 12, 2014
3,307
Hi,

The part number I have used is ULN2003APG. I shall try putting a resistor ...
EDIT: Disregard all the comments I originally posted below. I just re-read the original post, including the bit where connecting a 5V supply (instead of the Arduino output pin) to the ULN2003 input makes all the readings behave as expected. This negates most of my previous ideas. I should've read more carefully before posting!

Out of curiosity, where did you purchase the ULN2003 from? Was it an official distributor like Digikey, Mouser, Farnell, RS, etc. or some other source, like eBay, Amazon, AliExpress, etc? Still wondering if it could be a ULN2001 mislabeled as a ULN2003.

Just to clarify, when you measure 5V at the Arduino output, is that with the whole circuit connected, at the same time that the ULN input reads ~1.5V? Or did you measure the Arduino output with no load, then later connect the ULN, LED, etc?

If the Arduino pin reads 5 while it's driving the ULN pin and the ULN pin reads ~1.5, then you've got a bad connection, high resistance wire, etc.
 
Last edited:

ebeowulf17

Joined Aug 12, 2014
3,307
To address the issue with the Darlington driven by the Arduino.
I suspect this will help explain your findings. The Arduino output (pin 13) is either low (the MCU shorts this pin to GND internally) or high (this pin is connected to B+ through a "pull-up" resistor). When it's high and with no load connected this pin, it will read the 5VDC. Dependent upon the load impedance this "pull-up" resistor will create a voltage divider. I suspect the input impedance of the ULN2003 is quite low causing the measured voltage to be substantially reduced.
One question, why are you connecting the output of the Darlington IC (pin 16) to pin 10 and the LED? Is this just a Fritzing error?
Ok, so I still don't think that an Arduino "output" uses a pullup resistor to provide its logic high output the way you've described, but this is what an Arduino input does. If the pin is set as input, using digitalWrite( [pin#], HIGH) will set the internal pullup on, and using digitalWrite( [pin#], LOW) will turn the internal pullup off.

So if the thread starter's sketch never sets the pin as an output, then the pin behavior would be exactly as you've described. All we need is to call "pinMode([pin#], OUTPUT);" in the setup portion of the sketch, and then you'll have low-impedance outputs.

@BC547, if everything I just said makes sense to you, see if you're setting the pin as an output or not. If you're not already setting it, add the line to set it as an output and test your voltages again. If you're not sure, or can't get it to work, post your code here and I'll take a look at it. (You can copy and paste code into a reply here, but please use the code brackets, which are accessible from the plus sign above your comment box, to format the code separately from the body of the text.)
 

Thread Starter

BC547

Joined May 22, 2018
41
Code:
int darlingtonpin=13;

void setup() {
  // put your setup code here, to run once:
pinMode(darlingtonpin,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(darlingtonpin,HIGH);
}
 

Thread Starter

BC547

Joined May 22, 2018
41
Ok, so I still don't think that an Arduino "output" uses a pullup resistor to provide its logic high output the way you've described, but this is what an Arduino input does. If the pin is set as input, using digitalWrite( [pin#], HIGH) will set the internal pullup on, and using digitalWrite( [pin#], LOW) will turn the internal pullup off.

So if the thread starter's sketch never sets the pin as an output, then the pin behavior would be exactly as you've described. All we need is to call "pinMode([pin#], OUTPUT);" in the setup portion of the sketch, and then you'll have low-impedance outputs.

@BC547, if everything I just said makes sense to you, see if you're setting the pin as an output or not. If you're not already setting it, add the line to set it as an output and test your voltages again. If you're not sure, or can't get it to work, post your code here and I'll take a look at it. (You can copy and paste code into a reply here, but please use the code brackets, which are accessible from the plus sign above your comment box, to format the code separately from the body of the text.)
Hello ebeuwolf17,

I have posted my code above.

Thanks
 
Top