EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: mr_byte31 on October 17, 2024, 08:42:18 pm

Title: ULN2003A as servo driver
Post by: mr_byte31 on October 17, 2024, 08:42:18 pm
Hi All,

I am trying to use Microcontroller(3.3v logic) to generate 7 PWM signals to be used to control small servos or BLDC motors (via ESC).
The microcontroller gpio pins can deliver up to 10-20 mA and I want to deliver more current for my servos ( 100-200 mA ).
The motor's supply voltage would be 5v.

I was thinking to use ULN2003A since once IC contains 7 channels (Darlington Transistors) with extra stuff ( zener, flyback diode, resistors). This shall make my PCB more compact and less effort to manufacture.

I checked the datasheet (https://www.ti.com/lit/ds/symlink/uln2003a.pdf?ts=1729134836886&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FULN2003A) to see figure 5-4 and figure 5-5.

My concern that with increasing dutycycle for 7 channels, the output current goes down!!
in case of duty cycle equal to 80%, 90 and 100%, each channel can deliver only 50mA which is low in my opinion.
(https://i.postimg.cc/W3ctvj80/Screenshot-2024-10-17-at-10-30-50-PM.png)

I also noticed in figure 5-1 and figure 5-2, that V_ce will 1v @200mA. This mean the power delivered to the servo motors will decrease. 
(https://i.postimg.cc/nLDMgM4H/Screenshot-2024-10-17-at-10-40-01-PM.png)

did I understand the datasheet correctly or I overlooked something ?


as an alternative solution, I was thinking to use SI2300 and add zenner, transistors, flyback diodes but I was thinking if there is an IC that I can use directly that would be better option.

is there a better alternatives ?
Title: Re: ULN2003A as servo driver
Post by: RoGeorge on October 17, 2024, 08:57:32 pm
did I understand the datasheet correctly

Yes, total power dissipated by the capsule is not enough for all 8 transistor fully ON.  And at 3.3V you will lose considerable voltage (and power) percent because of the Vce sat of ULN2003.

I would look for a driver with MOSFET transistors instead of BJT.  MOSFETs can easily achieve miliohms Rds when fully ON.  You need low Vgt MOSFETs that can fully turn on at Vg less than 3.3V (sometimes these are called "digital" MOSFET).
Title: Re: ULN2003A as servo driver
Post by: langwadt on October 17, 2024, 09:00:25 pm
make no sense, the PWM for an ESC or servo is a logic signal, the supply is separate
Title: Re: ULN2003A as servo driver
Post by: mr_byte31 on October 17, 2024, 09:01:16 pm
Many thanks for the answer.

Yes, MOSFET can do the job. I only know about discrete components. do you know name of IC with has array and flyback diodes? :) 
Title: Re: ULN2003A as servo driver
Post by: mr_byte31 on October 17, 2024, 09:03:13 pm
make no sense, the PWM for an ESC or servo is a logic signal, the supply is separate

your point is valid for BLDC with ESC but if I connect a servo, then I need current driver.

I would like to use the same output of microcontroller to either servo or BLDC.
Title: Re: ULN2003A as servo driver
Post by: langwadt on October 17, 2024, 09:06:34 pm
make no sense, the PWM for an ESC or servo is a logic signal, the supply is separate

your point is valid for BLDC with ESC but if I connect a servo, then I need current driver.


which servo?
Title: Re: ULN2003A as servo driver
Post by: RoGeorge on October 17, 2024, 09:17:22 pm
do you know name of IC with has array and flyback diodes?

Might be, but I don't know any.

I would search for motor H bridge instead, some can control 2 motors, which might give for digital outputs (if they allow to be used as a half bridge).  Texas Instruments has a lot of motor bridge drivers IC, maybe you find a low power one with more than two H bridges.
Title: Re: ULN2003A as servo driver
Post by: mr_byte31 on October 17, 2024, 09:38:32 pm
Lets take SG90. The smallest and cheapest servo ever.

In idle —> 10mA
Moving —> 100-250 mA
Stalling —> 350 mA
Title: Re: ULN2003A as servo driver
Post by: RoGeorge on October 17, 2024, 10:26:00 pm
Can't find any decent datasheet for SG90, but by their values, those you listed seem to be the currents for the motor (the Vcc current), not for the control input.  I expect the PWM control input to be a CMOS, or a TTL compatible at worst, so less than 1mA.
Title: Re: ULN2003A as servo driver
Post by: Ian.M on October 17, 2024, 10:48:22 pm
There are plenty of people driving a SG90 servo direct from a Raspberry Pi (3.3V logic on its GPIO pins) without any level conversion, so it seems likely the SG90 has a TTL compatible control input.

https://www.youtube.com/watch?v=bQCj8_6ZvpA (https://www.youtube.com/watch?v=bQCj8_6ZvpA)
Title: Re: ULN2003A as servo driver
Post by: langwadt on October 17, 2024, 11:31:11 pm
Lets take SG90. The smallest and cheapest servo ever.

In idle —> 10mA
Moving —> 100-250 mA
Stalling —> 350 mA

that is supply current, not current on the pwm control pin
Title: Re: ULN2003A as servo driver
Post by: mr_byte31 on October 18, 2024, 07:02:54 am
it seems I overlooked the motors.
Yes. the control pins (PWM) doesn't provide the current to the servo nor BLDC motors.


But since I opened the topic. I would still be interested for a solution for Leds or small DC motors. something like this:
(https://i.ebayimg.com/images/g/D1sAAOSwbdpWblBI/s-l1600.webp)

If I use all channels of ULN2003A. it still will not provide that much current.