digitalwrite(3, HIGH) 1.5Vdc instead of 5Vdc

I am driving a ULN2003 with some loads, 2 relais and 2 leds. For some reason 1 of the leds is not sinked well by the ULN. The output from the Atmega328P turns out to be 1.5Vdc instead of the 5Vdc. Is there something I need to know about pin3? All 3 other outputs are nicely 5Vdc when driven. The Atmega's pin3 is not shorted or anything.

A schematic diagram would be useful. A picture of you project would be nice too. And your code.

Here ya go. It’s not my neatest project,but hey, I wasn’t expecting to put pics online :slight_smile:

I assume the circuit worked on a bread board and the circuit worked with the software.
Has this circuit ever worked or was the problem there from the beginning?
If this is a new PCB and the problem was there from the beginning there may be a solder bridge from the o/p to a near by trace. Use an ohm meter…
I assume you have tried a new controller.

  pinMode( 3, OUTPUT );

...add to setup.

If the 2003 is in a socket pull it, what happens on the o/p then?

pinMode(led3, OUTPUT); check int led3 = 3; check digitalWrite(led3, HIGH); check

Unfortunately, the ULN is not in a socket so I cannot remove it. I will try a different Atmega, maybe I abused this one too much....

Look at the equivalent diagram (the clamping diode is backwards).
I guess we aren’t all perfect.

2003.jpg

You could bend the O/P pin of the 328 so it sticks out of the socket. Bed time...

I abused the uC and bend the pin. It puts out a nice 5Vdc. Now what happens when I put my multimeter in between the bend pin and the ULN, precisely 99uA is drawn. Is that a limitation of the PWM pin?

SuperR: I abused the uC and bend the pin. It puts out a nice 5Vdc. Now what happens when I put my multimeter in between the bend pin and the ULN, precisely 99uA is drawn. Is that a limitation of the PWM pin?

As my experience , all the pins can supply 20 mA drawn.

pinMode(led3, OUTPUT); check
int led3 = 3; check
digitalWrite(led3, HIGH); check

must no be

int led3 = 3; check
pinMode(led3, OUTPUT); check
digitalWrite(led3, HIGH); check

?

BAD Arduino!
Why is digitalWrite(led3, HIGH) not the same as analogWrite(led3, 255). This fixed the problem.
Let me think for a while, I think I made a mistake.
Edit;
:roll_eyes:
I defined analoginput 0-3 as pin 0,1,2 and 3.
Now changed it to A0 - A3 and the problem is fixed. In other words, I had used pin3 twice, with one time, the digital pin in mind, and the other time, the analog input in mind.