0
\$\begingroup\$

I tried connecting the GPIO1_0 pin of LPC1114 to the input pin 1 of the ULN2003a IC. And I connected a 9V supply to the COM pin of ULN2003a. For whatever the logic level at pin1 (i/p) of ULN2003a, its corresponding output is always 0.57V. The logic high of the MCU at the o/p gives around 3.1V. What is wrong here?

EDIT: I am trying to drive a stepper motor using the uln2003a as an interface to MCU. I haven't connected the motor yet. I want to make sure it will not burn the MCU. I figured out the common pin of the motor should be connected to the +ve power rail.

Stepper motor - uln2003 interfacing

  1. Is it safe to connect the MCU o/p pins to uln2003's input pins without any current limiting resistors between them?
  2. The Motor's rated voltage & current is 24V and 600mA. The ULN2003A can drive only 500mA. Is it safe to drive the motor at 9V with ULN2003a?
\$\endgroup\$
  • \$\begingroup\$ Got the grounds of the 2 supplies connected together? \$\endgroup\$ – Dean Jun 10 '11 at 10:55
  • \$\begingroup\$ @Dean yes, I did. \$\endgroup\$ – 0xakhil Jun 10 '11 at 11:07
  • \$\begingroup\$ I am not sure what the COM pin's function is. I read the datasheet, but I dont find much info in it. \$\endgroup\$ – 0xakhil Jun 10 '11 at 11:09
  • \$\begingroup\$ Pin 8 is the GND. Then pin 9 which i think your referring to enables the common freewheeling diodes. See the image of the internals on the first page \$\endgroup\$ – Dean Jun 10 '11 at 11:12
  • 2
    \$\begingroup\$ The outputs are "open collector". How do you have the outputs connected? If you post a schematic it would be helpfull. \$\endgroup\$ – SteveR Jun 10 '11 at 11:38
3
\$\begingroup\$

You need pull-up resistors on the outputs (or whatever load you want to drive).

Inside the ULN2003 there are darlington transistors with an open collector, so without some external circuit the output will not be pulled up to some higher voltage.

The COM pin is connected to a freewheeling diode for each transistor, so you can connect it to the positive rail to protect against overvoltage, for example for inductive loads.

\$\endgroup\$
  • \$\begingroup\$ I want to drive a stepper motor with this uln2003a IC. Do I have to connect any resistors at input pin to protect the MCU pins from getting fried? Then motor has 4 i/p pins and 2 ground pins. How do I give supply to the stepper motor? \$\endgroup\$ – 0xakhil Jun 10 '11 at 12:09
  • \$\begingroup\$ No, the base resistors are included in the ULN2003A. \$\endgroup\$ – starblue Jun 10 '11 at 12:31
3
\$\begingroup\$

The ULN2003 can only sink 500ma as you stated. It will not handle the 600ma required by the motor. You can parallel the inputs and outputs however on the ULN2003 to increase the current. For example if you were to tie two inputs to the micro output, then tie their respective outputs to the motor connection then the current will almost double. See the data sheet for the current curve plot showing duty cycle with current vs number of drivers on. If you use ULN2803A instead it has 8 drivers. That way you can parallel two I/O's and end up with 4 drivers using only one chip. You can drive either chip directly from the MCU output without using a current limiting resistor. The resistor is within the chip.

\$\endgroup\$
  • \$\begingroup\$ While I can imagine you can increase current I'm not sure you can presume the current is always evenly distributed between the two outputs. \$\endgroup\$ – stevenvh Jun 10 '11 at 16:42
  • \$\begingroup\$ Datasheet for the ULN2803A shows two channels conducting simultaneously can safely sink 800 ma @ 100% duty cycle. If he had 4 channels conducting @ 50% duty cycle he can still sink 800ma. Being a stepper motor 50% duty cycle should not be a problem. \$\endgroup\$ – SteveR Jun 10 '11 at 18:41
1
\$\begingroup\$

Start with the stepper and the ULN2003A. With the ULN inputs floating the outputs should be pulled up by the stepper coils. If not remove the ULN. If still not high there is something fishy with the stepper. If High now, you have a problem with the ULN.

Next, connecting an ULN input to +5V should cause it to sink its corresponding output to 1 .. 2V. If not, there is a problem with the ULN.

When your stepper is rated for 24V / 600 mA it should draw much less current at 9V, so you are safe on that aspect. Whether the stepper will work at all at 9V is another question. You can try that manually by energising the coils in the appropriate sequence.

As for the ARM, try first whether you can switch the pin(s) high and low without anything connected. If not, correct your code.

Now let's look at the LPC1114 to ULN interafce. At 300 mA output current the ULN datasheet requires a Vin of 3V. I can't find the current, let's assume 1 mA. An LPC1114 can deliver 1 mA, but its output will be somewhat below its power supply, the datasheet states a drop of 0.4V at 4mA. When the LPC is powered at 3.3V it should just work, but with very little margin. Which is not surprising, the ULN2003A was designed to be driver by a 5V powered chip, not for a 3.3V power chip. It will probably work, but I would not trust it in a serious product.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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