2

I thought I understood the ULN2003AN before purchase, but I'm clearly missing something. I created a very simple test with two power supplies. One producing 3.3V and the other 24V.

Connections:

  • I have ground for both power supplies connected to PIN8.
  • I put +24V to PIN9.
  • I put +3.3V to PIN1.

Measurements:

  • I measure 24V between PIN9 and PIN8
  • I measure 3.3V between PIN1 and PIN8
  • I measure 0.62V between PIN16 and PIN8

I expected PIN16 to be +24V, but I'm clearly misunderstanding something here.

I thought the purpose of the ULN2003AN was to allow me to take up to 7 GPIO OUT PINs of 3.3V and translate that to 7 PINs of 24V. Where am I misunderstanding?

1

2 Answers 2

3

The ULN2003AN is a great part to use in many GPIO-based Raspberry Pi applications; it buffers the GPIO outputs; effectively allowing one to safely perform low-side switching for loads up to 400-500mA (or more if channels are switched in parallel) and 50V. Handling inductive loads (e.g. coils for large relays, dc motors, etc) is facilitated by the built-in suppression diodes for each channel.

WRT your issues: Take a look first at the spec sheet for the ULN2003AN:

Re: I put +24V to PIN9 - this is wrong, as explained below.

COM 9 Common cathode node for flyback diodes (required for inductive loads)

Re: I put +3.3V to PIN1

You have applied 3.3V to the Base of the "Channel 1" Darlington; did you add a current-limiting resistor between 3.3V supply & PIN1???

Re: I measure 24V between PIN9 and PIN8

OK, but refer to the spec sheet & remember that you're measuring through a diode.

Re: I measure 3.3V between PIN1 and PIN8

OK - but you've not limited the base current flowing into the Darlington.

Re: I measure 0.62V between PIN16 and PIN8

Hopefully, this figure from the spec sheet will provide that aha moment:

enter image description here

If you are attempting to switch the Channel 1 Darlington ON and OFF, you should do two things differently:

  1. Connect your 24V Supply through a properly-sized load to the Collector Junction at Pin 16 (instead of pin 9); "a properly sized load" for this Darlington switch means a load that will limit the current such that it never exceeds 500mA. For example, with a 24V supply, you could use a resistor whose value exceeds 51Ω - maybe use a 100Ω resistor (or a very short duty cycle) to reduce risk of exceeding SOA limits.

  2. Use a current-limiting base resistor between your 3.3V Supply and Pin 1. Refer to Figure 6.1 in the spec sheet; you shouldn't need more than 1 mA base current for saturation, so a 3.3KΩ resistor should work.

Hypothetical Schematic

schematic

simulate this circuit – Schematic created using CircuitLab

7
  • Many thanks for the detailed response, this explains why it is not behaving how I thought. I'm trying to mimic a part of a circuit board with a bread board so we can troubleshoot some software, and either the schematic is leaving out some details, or I'm still a bit lost on this unfortunately.
    – John Klein
    Oct 21, 2022 at 14:11
  • This is controlling a motor that is enclosed in a housing, but I don't have a schematic for the motor housing itself unfortunately. I see two wires going to the motor housing where both wires are controlled by a separate ULN2003A with 24V going into pin9 and 5V going to pin1. (I mistakenly was using 3.3V above) I'll troubleshoot some more, maybe I'll have an "ah ha" moment.
    – John Klein
    Oct 21, 2022 at 14:41
  • Why won't formatting work in my comments, sorry? I was able to get some time on the actual TestBox and probed the two ULN2003A chips I'm trying to breadboard. With motor 1 running. (2003A_Chip1_Pin1)5V from Pin8. (2003A_Chip1_Pin8)Ground. (2003A_Chip1_Pin9)24V from Pin8. (2003A_Chip1_Pin16)0.62V from Pin8. (2003A_Chip2_Pin1)5V from Pin8. (2003A_Chip2_Pin8)Ground. (2003A_Chip2_Pin9)24V from Pin8. (2003A_Chip2_Pin16)0.62V from Pin8. Pin16 from both chips go to motor1 and are the only two wires. I guess I'm just not fully understanding how it drives the motor like this.
    – John Klein
    Oct 21, 2022 at 21:07
  • @JohnKlein: Re formatting in comments: All of the usual Markdown stuff should work: Italic, Bold, link, code.
    – Seamus
    Oct 22, 2022 at 5:28
  • @JohnKlein: Two things would help us help you: Add a schematic to your question, and a spec sheet on your motor. I've placed a hypothetical schematic in my answer - you can copy & paste it into your question & make any necessary changes. NOTE: If I understand what you're trying to do, you don't need a separate 5V supply - you can drive the 2003 easily with the GPIO pins
    – Seamus
    Oct 22, 2022 at 6:21
1

The way @Seamus has drawn the schematic is wrong, I'm afraid. It shorts pin 16 with pin 9. That means the purpose of the fly-back diode is gone.

Why is pin 9 of the ULN so important in case of a ULN2003? When you connect an inductive device between a pin of the ULN (here: pin 16) and the power supply (here: 24V) energy is built up in the coil (every inductive device, e.g. a motor, has a coil-alike behaviour) whenever the inductive load (a motor in the OP's example) is switched on.

When you switch off the inductive load then the energy that is built up into the coil has to go somewhere. It has to be consumed one way or another. If no precautions are taken, then that energy will be consumed over the output stage of the ULN, which is bad since that energy can be a high voltage spike (much higher than the allowed 50V that can be handled by the Darlington output stage of the ULN). And that can damage the output stage or any other electronic component that might be in the circuit.

To avoid damage, a reverse-polarised diode should be put between the power supply (to be connected to the cathode of the diode) and the output stage (connected to the anode of the diode). And that's exactly what pin 9 is used for. It's connecting all the cathodes of the 8 internal diodes to a "common" point. Here, this should be the power supply.

So, when connected correctly, the ULN will put the fly-back diode in a reversed way over the inductive load. As a result, the energy stored in the inductive load will be consumed by the inductive load itself whenever the circuit opens and not by other components in the chain which could be damaged if you're unlucky.

A correct connection is like so:

Note that in the schematics a ULN2803 is used. That's why you see pins 17 and 18 as extra compared to the ULN2003. The only difference between ULN2003 and ULN2803 is that the former has 7 output stages while the latter has 8.
And since I've used a ULN2803 and not an ULN2003 in my example (didn't have a ULN2003 component in my KiCAD library, hence...) the common pin is not pin 9, but pin 10! For the rest, the devices are the same with respect to their functionality (pin numbers might differ too, of course).

enter image description here

A representation of the internals of the ULN might make it eve more clear:

enter image description here

  • Q1 represents one of the 7 Darlington stages of the ULN2003
  • D1 represents one of the 7 fly-back diodes in the ULN2003

@JohnKlein: Hope this answers your question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.