Discussion in 'The Projects Forum' started by cremaster, Jun 30, 2010.

  1. cremaster

    Thread Starter New Member

    Jun 30, 2010
    I bought yesterday a ULN2003, an integrated circuit with which I plan to drive a stepper motor (controlled by the parallel port on my computer) as is shown here:


    I could wire this very easily, but I don't want to do so until I have a full understanding of how its going to function. My main point of confusion is the operation of the ULN2003 itself. The following is a link to its datasheet, with a schematic on the first page:


    Its an array of seven darlington pairs which I understand are each comprised of two NPN transistors and which can be used for amplifying or directing current. In the more general schematic on the left side of the page (b) are seven inverters and seven diode symbols, each of which connects to the common, which as in (a), will be connected to the cathode of my power supply.

    But why I ask, why? This is how I see it presently: The electrons from my power source are going to flow into pin 9 and up the line butting into each of these diodes and not making it through any of them. It will also flow into the motor and through individiual coils, take brown for instance, into pin 13. Lets say I have pulled pin 5 on my parallel port to high and now this is inverted before coming to pin 13, so the current from the cathode which has travelled through brown and into pin thirteen now goes through the diode and back to the cathode.

    Why does this work? It seems like my pulling of pin 5 high results only in a short circuiting of the cathode.

    Im rather new to working with circuitry and I know there is a flaw somewhere in how I understand this. I hope you can help, if someone could enlighten me as to the operation of this IC, or what I am misunderstanding, I would be greatly appreciative.

    Thank you!
  2. SgtWookie


    Jul 17, 2007
    The ULN2003 has open-collector outputs; they can sink current, but cannot source current.

    When your input pin goes high, the Darlington turns on and begins sinking current. This energizes the coil in the stepper motor.

    The diodes in the ULN2003 are being used as reverse-EMF protection diodes. When your input pin goes low, the output of the Darlington is turned off, so it stops sinking current. Current flowing through a coil doesn't stop immediately. The diodes give that current a place to go, instead of building up to very high voltage levels.
    cremaster likes this.
  3. AlainB

    Active Member

    Apr 12, 2009
    ULN2803 would be a better choice. It is an 8 darlington arrays and you could parallel 2 inputs and 2 outputs foe each phase of the motor unlike the ULN2003 that leave you with 3 inputs and outputs unused.

    Not using the flywheel diodes will probably improve the motor performance. Try it with and without and you will see if there is any change. Personnally, I don't use them and I never noticed any harm to the chips because of that.


  4. Markd77

    Senior Member

    Sep 7, 2009
    The inverter symbol in the chip confused me too years ago. It still makes no sense to me. Just look at the first typical application at the bottom for how to wire it up.
    V can be a different voltage to Vcc in the diagram.
    For inductive loads COM should be connected to V.
  5. John P

    AAC Fanatic!

    Oct 14, 2008
    If you don't use the freewheeling diodes you're begging to have the driver chip fail.

    Thes driver chips are considered to be inverters because a high level on the input causes a low voltage on the output. So does a low voltage in cause a high voltage out? Well, not exactly. The high voltage is supplied externally, and there's a load (in this case a motor coil) between the power supply and the chip. The voltage at the chip's output pin is high when no current flows through the load. When it goes low, the power supply's voltage is across the load, and current flows.

    This is elementary stuff, but surprisingly difficult to explain in basic terms!
  6. cremaster

    Thread Starter New Member

    Jun 30, 2010
    Ahh, I think I am understanding this a little bit more now.
    So, in reference to the first diagram:

    * Input pin 2 is pulled high, which leads into the base of a darlington pair, which results in current being allowed to flow from the collector to the emitter. The collector of the darlington pair is externalized on output pin 15 and its emitter leads internally to the ground pin 8. So now the power source has a complete circuit: + > black coil > collector (pin 15) > emitter (pin 8) > -, as long as pin 2 is high.

    And when I suddenly pull pin 2 low, what could be a huge voltage runs back from the coil and may damage a transistor if not for the diode, which (only for large voltages such as this) allows current to travel in the opposite direction to ordinary. Does this result in the back-EMF short-circuiting or simply dissipating to the ground?

    So, the darlington pairs are used to switch on and off the current from particular coils and not to amplify current. But then why use darlington pairs and not simply single transistors?

    I am also still confused as to how the logic diagram on the left side of the datasheet relates to the actual electrical schematic on the right side.
  7. Markd77

    Senior Member

    Sep 7, 2009
    The current from the back EMF flows through the diode and coil until it has dissipated.
    Darlingtons are used to give bigger gain than a single transistor, which means the base current is reduced.