0
\$\begingroup\$

For a project I'd like to use a Raspberry Pi Zero as a web server interface to receive and send data to/from an Arduino Uno which will control 2 stepper motors and a servo. I would like to have only one source of power for all of this and would like your advice on how to do it. I first thought to connect the power supply to the Arduino and then using a shield ( like this one ) to control the steppers and servo. But can I also power the Raspberry Pi Zero through the Arduino USB port while also sending and receiving data through USB?

Thank you

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

This kind of thing gets very tricky. In theory you could do it all with one 5 amp 5 volt supply, in practice it might be better with a 12 volt supply and independent switching regulators for the computers vs motors.

Power the pi via the 5v pins on the GPIO header or the power-only USB jack.

Let the pi power the Arduino.

Where you want to run in an independent power supply is to the motor drivers themselves, as distinct from the Arduino hosting them.

Note that stepper motors are best driven with a chopping switch-mode driver using a power supply several times the rated coil voltage, otherwise winding inductance means torque falls of sharply at high rotation rates. The generic motor shield you list is not a very good choice. You might instead look at one of the Arduino shields or unitary Arduino-derived boards designed for 3d printers or other CNC uses, as these tend to have chopping driver chips/modules such as the A4988 or similar/competitors. These will need to support the current rating of your motors or they will underperform.

You'd then power the motor drive directly from 12 volts (or more!) and use a switching regulator to power your pi (and through it, Arduino) from 5v regulated down from the 12 volts. Given the power demands of the pi, this really needs to be a switching regulator, not a linear one.

You don't really need a "shield" to drive a servo; just a PWM pin. If using a higher voltage main supply, the servo should get it's own switching regulator, so that any "stall" there doesn't cause a brownout of the 5v supply to the computers.

\$\endgroup\$
3
  • \$\begingroup\$ Thank you very much for your answer Chris, I think I understand better now. Is this diagram an accurate representation of your solution ? (ibb.co/QYkHn3X) \$\endgroup\$
    – O. Bigo
    Commented Dec 10, 2020 at 20:12
  • \$\begingroup\$ You want to use "chopping" or switch mode stepper modules (allegro and competitors), not L298's - again, see 3d printer shields/boards as a starting point. And you need another 5v switching regulator ("battery eliminator" in hobby terminology) to power the servo as it cannot be run on higher voltage the way the steppers should be. \$\endgroup\$ Commented Dec 10, 2020 at 20:18
  • \$\begingroup\$ Alright so if I sum it up : My main power supply will be 12V and it will power an Arduino CNC Shield with 2 A4988 drivers on it. I'll also connect the servo to this shield but with the 5V provided by a D24V22F5 regulator. An another D24V22F5 will provide the 5V for the Pi which will power the Arduino Uno through USB. Thank you @Chris Stratton ! \$\endgroup\$
    – O. Bigo
    Commented Dec 10, 2020 at 23:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.