Powering devices with a TIP120

Hi,

I need to control the power (on/off) of several devices :

  • 10 little LED
  • 10 little infrared sensors
  • 5 servo motors

I have some TIP120 with me, so I tried this wiring :

And I've connected the power lines (GND/+5V) of all my devices on the output (on the bottom of the image)

For simple tests, it works, but is that a correct circuit ? Can I use it for a personnal project ? (the TIP120 is maybe overkill ?)

And the more important, how do I compute the correct resistor value on the image ? Do the depend on the powered devices ?

Thanks

First off, a logic level MOS FET would be a better choice for the transistor.

Second, what is the collector to emitter voltage when the transistor is turned on by the controller?

How much load current are you expecting to need?

.

Controlling devices wth a bottom switch circuit like this is generally a bad idea. Look up how to use a top switch. This will involve using a PNP transistor or a P-channel FET.

Thanks for answers.

This circuit will be controlled from an ESP32 dev board : so it's 3.3V outputs, about 40mA max.

The goal is to turn on/off the 5V power supply for :

  • 1 LED (using a 270 ohm resistor) : about 10mA
  • 8 "ITR9608" optointerrupter (each using a 270 ohm resistor) : about 8x10mA
  • 8 "SG90" 9G mini servo : about 8x100mA max
  • 1 "MCP23017" : 8 LED outputs, 8 sensors inputs : about 200mA max

So the total should be 1.1A, maybe should say 1.5A as a security factor ?

I've found this circuit : http://www.instructables.com/id/DIY-Motor-Driver-With-ESP32-Controller/

They use a NPN : BC337, can I reuse this design ? or is it better to use a PNP /P-channel mosfet ?

From the datasheet, BC337 (or the PNP BC327) have a maximum current of 800mA, so that's probably not enough :slight_smile:

Maybe I should use a driver circuit like this ?

http://www.ti.com/lit/ds/symlink/uln2803a.pdf

Not really - why not start listening to us? Use a high-side switch with a logic-level p-MOSFET for 5V and high current.

Anything else will either fry itself or drop too much voltage or otherwise be dissappointing.

For instance checkout the "High side switch" on Nick Gammon's pages: https://www.gammon.com.au/motors

If you want to drive low-side, remember everything you switch will be at 5V when switched off, so every
control wire or sensor wire will also have to be at 5V or you'll risk damaging something. This is why
high-side switching is generally preferred, just fewer issues to deal with.

And since you have several servo motors you will need a separate 5V for those, with many amps of
available current.

If you have supplies that are not all the same voltage you'll need to drive your p-MOSFET with a level
shifter circuit (2nd circuit under the "High side driver" section on that page).

I've found this circuit : http://www.instructables.com/id/DIY-Motor-Driver-With-ESP32-Controller/

And did you notice a schematic in that article?

No, and that is a sure sign that the writer of that instructables, like virtually all the electronic projects on that site, has not got the slightest clue as to what they are doing.

Basically if you treat all electronic instructables as total crap then you won't go far wrong.

AMEN to that.

I'm a software engineer since 15 years, and I can now identify a crap source about code in a few minutes...

But about hardware electronics, I'm a newbie :slight_smile:

Thanks for the advice, I will stay away from instructabes now.

About my original problem, I've opened a more complete topic here : Advices to complete this project - Project Guidance - Arduino Forum