1

I am currently going through the tutorials included with those kits that you can get for the Pis with breadboards and components, etc. Anyway, in the tutorial, I am making the following circuit:

enter image description here

In the tutorial, it insists you use the breadboard power supply with a 9v battery, to avoid damaging the Raspberry Pi.

enter image description here

I have researched the motor a little bit (They don't provide a data sheet), but I believe they are similar to adafruits 130 toy motors. For reference, they're rated at 6v, and stall current is about 500mA. The L293D has a maximum output of <700mA anyway.

My question is this, for the sake of knowing if it's possible, is that why can't I just hook this up to the 5v pin on my RPI? It is a Model 4b, and I know they are directly linked to the power supply of the Pi. The power supply I'm using for my Pi is rated at 3A, so what's the problem here?

I should note that the idea of this circuit is to use the pontentiometer to control the speed and direction of the motor.

6
  • let me ask you this ... are you willing to use the RPi as an expensive fuse?
    – jsotola
    Jul 19, 2020 at 1:50
  • @jsotola - obviously I don't want to exceed the maximum amount of current available to me that would damage my Pi.
    – Pokebab
    Jul 19, 2020 at 2:05
  • then, no, do not use the RPi to supply power for the motors
    – jsotola
    Jul 19, 2020 at 2:54
  • Is your question about powering the L293D from the 5V supply from the RPI instead of the breadboard power adapter? From some of the replies I read, it appears some have assumed you want to connect the motor directly to a RPi GPIO and it sounds like you know where that path leads.
    – linhartr22
    Jul 22, 2020 at 0:30
  • Correct - the GPIO pins can only output 16mA so that would be insane.
    – Pokebab
    Jul 22, 2020 at 0:45

3 Answers 3

2

I would be quite happy powering that circuit from the Pi's 5V rail.

You are not directly powering the motor, you are powering a L293D motor driver which in turn powers the motor. The L293D incorporates all the protection needed to prevent back EMF from reaching the Pi (back EMF may be caused when the motor is turned off or when it in manually turned).

1
  • If you turn the motor with 5V, the back EMF it will generate will not exceed 5V. Unless, of course, you spin it manually even faster. Jul 21, 2020 at 12:03
2

Stall current is only one part of the story: the resulting undervoltage may crash the system, but it's not likely to do any damage to the hardware.

However, a motor is an inductive load which will produce a (potentially) very high voltage when you switch it off. Incorrectly powering motors, relays, electromagnets, etc. is by far the most common reason of dead Arduinos and Pies. Powering such loads with a separate supply (especially batteries which are very good at absorbing overvoltage) is by far the simplest way to make such loads safe, if you don't fully understand where the high voltage might go.

Of course, it's not the only way, and, if done right, you can power a motor and sensitive electronics from the same supply.

1

The problem is not because of the power supply given to the raspberry pi. The problem is with the amount of current the Pi itself is rated for. Yes the power supply of the Pi 4 can handle 3A of current but 3A of current is a lot of power to try and draw through the traces in the pcb of the Pi and considering it is only rated to 600mA passive draw with no peripherals. Now I think that that gpio 5V is connected to the same power bus as the USB peripherals which can only handle 1.2A max. So if the motor was the only thing you were hooking up to it it might be able to handle it but even then it would be a risk since motors can often spike in current usage and you wouldn't have any sort of back current protection if the motor gets spun on its own. If the motor spins on its own it can force current to the Pi which could cause serious damage to some of that circuitry. So is it possible maybe but usually when it comes to motors its a good idea to have an independent power supply or at least a protection circuit. The pi doesn't have any of that so it not a good idea unless you want to go through a couple of raspberry pi's testing out the limits. You can find the general power ratings in the Pi documentation but a good rule of thumb is to have any high powered device running on a different source than the pi itself

2
  • 1
    I appreciate your answer. I think that I will not attempt to do this and agree that using a separate power supply for it is the best option. I understand the risks that motors can have but I believe the L293D has protection diodes on the motor connections to stop this from happening. I was hoping by asking this question that someone who has experimented in such a way might be able to tell me what the limits are and why exactly the motor could damage the Pi, which I'm not convinced it can do with the diodes in the L293D chip present.
    – Pokebab
    Jul 19, 2020 at 5:22
  • 1
    Also, to add to this, why would the RPi 4b have a 3A PSU recommended if the Pi could not handle 3A?
    – Pokebab
    Jul 19, 2020 at 5:34

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.