1

Say I bought you a RC car as a gift, that works on 24v battery. You decided that RC car is boring and want to control it with raspberry pi 2. There are two motors on the car.

You bought a voltage regulator, you reduced 24v to 5v and were able to get the signal in the Pi. But the car works on a 24v so all the commands you send to the motor should be 24v, how to increase the voltage back for the motors to run? The wires are on an extension board like this. If you could show me a diagram on how to connect it, it would be great. All DC current.

  • 1
    I don't understand what you are doing. What sort of motors are you talking about? Most ordinary DC motors will be driven via a motor driver board. The motor driver board will supply 24V to the motors but may well accept 3V3 for its logic (control) circuitry. – joan Aug 21 '15 at 11:19
  • @joan true, but there was a controller which got 24v from the battery, you push the button, the motor turns on, I removed the controller, plugged in the pi instead, reduced 24v to 5v, then I want to send the same signals to the driver board, so i guess i have to reincrease the voltage, again it's all in theory, i dont want to mess around unless I'm sure what I'm doing - so what you say is that there's no need to increase the voltage? would the driver board accept any voltage? – Lynob Aug 21 '15 at 11:30
  • I don't know. It sounds like bespoke circuitry tailored to that model so there is no way of telling what it expects without experimentation. – joan Aug 21 '15 at 11:32
  • @joan okay so if there's no need to increase the voltage, it's easy, and I hope that's the case, but if I have to increase it, how to do so? – Lynob Aug 21 '15 at 11:34
  • @joan i think problem solved, i'm sending data, i need some fast switching, called an engineer in an electronics shop and he says he has some transistors that can help, and he says that he can solve it, so technically the problem is solved, at least i'd like to think it is, but anyway it would be nice to get an answer here, and technically I'm increasing the voltage from 3.3v not 5, – Lynob Aug 21 '15 at 11:55
2

You can't do this effectively, no matter how many transistors you connect.

The motor is intended to run at say 5 watts. That would require 200 mA at 24 V (5 W / 24 V), but to step that up from 3.3 V you need 1.5 A (5 W / 3.3 V).

The total amount of power that should be drawn through the GPIOs is 50 mA, and no more than 16 mA per pin. I believe if you try to go over this you risk damaging the pi. There's no way this could drive a motor big enough to power a car capable of carrying the pi around.

Even if you used the 5 V supply and switched that somehow I think you would not have enough, since the input current is limited to 2 amps. You could use a relay board and a separate power supply.

1

I think this IS possible. It would be best, as already commented, if you had more details of the circuit, so I do some assumptions:

  • battery 24 V, big enough to drive motors
  • motors have 24 V power supply input
  • motors have 24 V control signal input

Now: 1. Choose RPi GPIO pin(s), configure as output (enough info to be found when unclear) 2. Get N-type (MOS)FET (most will work) 3. Get 10 kOhm resistor 4. Connect GPIO pin to Gate of FET 5. Connect Source pin of FET to ground 6. Connect Drain pin of FET to resistor 7. Connect other side of resistor to 24 V power 8. Connect Drain pin of FET to motor control signal Note that this is an inverting circuit, GPIO high means control signal low and vice versa. This can be swapped easily in software.

If needed you could at a pull-down resistor to the GPIO pin as here

Good luck

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.