LED configuration for PICAXE 'Testing the System'

Hello everyone. Ground-zero beginner here. I've been a programmer for maaaaaaaaany moons, and I'm using robots as an excuse to learn about electronics. It's strange, yet fun to be a complete newbie again ;)

Some parts are on their way and I am spending my time deciphering the picaxe manual. One paragraph confused me and I think I finally figured it out, but I would like to have confirmation.

It's in picaxe_manual1.pdf in the 'Testing The System' section when it describes the LED connection:

"When using the project boards (e.g. as supplied within the 18 and 28 starter packs), connect the LED between V+ and the output connector, as the output is buffered by the darlington driver chip on the project board. (Make sure the LED is connected the correct way around!)."

My understanding now is that if on the board I replace the darlington driver with resistors I should connect the LED+ to the output pin and LED- to ground. This is what my newbie-brain expects. It makes sense.

On the other hand, if I have the darlington driver on the board I need to connect LED+ to the V+ and LED- to the output pin. Is this correct?

In other words, when the darlington driver is in place and output is inverted, with the pin on low, the LED will receive V+ on both sides and remain off (no difference, no flow, no current, no light). On the other hand, when the pin is on high the - side of the LED will be receiving low current and the LED will light up.

Now... If I have the darlington driver and I connect LED+ to output pin 1 and LED- to ground, it should still work right?Except that the LED on/off will be inverted. It will be off when the I set high 1 and off when I set low 1?

Please let me know if I am off the mark before my head explodes or start destroying components ;)

 

You’re correct everywhere

You’re correct everywhere but the last point: if you connect the LED+ to the Darlington output and the LED- to ground then nothing will happen regardless of what state the PICAXE pin is set to.

I think where you are confused is that the Darlington driver (in this case a ULN2803A, one of my favourite ICs) is not an inverter. The output it produces is indeed inverted with respect to the input, but it does not invert the voltage/logic levels in the way you would expect from a real inverter such as the 74HC14.

Each of the 8 Darlington drivers inside the ULN2803A is actually a pair of NPN transistors working together (ignoring the protection diodes and resistors there isn’t much else in there). The Darlington arrangement makes the 2 NPN transistors act like a single transistor with a very high current gain, which means a small amount of current going in allows a large current to flow on the output side.

When the PICAXE sends a ‘high’ signal to the Darlington input, it allows the Darlington output to act like a direct link to ground, which is effectively the same as a ‘low’ signal, ie: 0V. Technically there is a voltage drop, and the current has an upper limit, but for the purposes of lighting an LED these aren’t important. However, if the PICAXE sends a ‘low’ signal to the Darlington, it causes the Darlington output to clamp shut so there is no current for the LED. In this simple switching arrangement you can think of the Darlington as a gate that allows current to flow through it to ground (and only ground) when a ‘high’ logic is applied to the input, but is otherwise tightly shut.

The Darlington output never actually generates a voltage, so it can’t produce a positive voltage to feed into the LED+ terminal. It can only provide a path for current to flow into it when (1)the input line has over a minimum positive voltage applied to it and (2)the output terminal is connected to a positive voltage source (in this case via the LED and resistor).

Hope this helps a bit, you can get a lot out of your PICAXE by pairing it with transistors like the Darlington array.

Awesome

Thank you for your explanation! It makes sense and it finally brings together the other things I read.

I think I finally get what the Darlington actually does, at least in this case. Unfortunately it’s not always clear by looking at schematics, especially being Klueless™ :slight_smile:

It’s making me reconsider wanting to use a servo for the ‘start here’ bot. It seems that leaving in the Darlington driver would open up a lot more control options… ponder

Once again, thank you. I really appreciate you taking the time to explain.

 

LED FRY
Also. if you connect the LED + to the V+ and the LED - to the darlington output, you’d need to add a resistor, preferably between the LED+ and the V+, or you’ll end up frying the LED.