Electrical – How to power and control a Raspberry Pi and 12V DC window motor with the same battery

currentdc motorh-bridgeraspberry pivoltage

For a project, I need to use a Raspberry Pi 2 to control a 12V car window motor. To save space, I also need for them to use the same battery. The motor will need to work at a low speed but have a hight torque. From research, it seems I might need to use an h-bridge to slip the power and control the motor, and then a UBEC to lower the voltage for the Raspberry Pi. But I'm not sure if that is correct. What I also don't know is what type of battery to use and how to make sure I don't burn out any components. Would a low voltage and high current battery be best? And will an h-bridge be the correct component to handle a high current? And will all of this be able to connect together? I can give more information if needed.

enter image description here

Best Answer

The car widow motor has a worm gear that makes it operate at a low speed and high torque as it is, supplied by 12 volts. You should determine what its speed is with a 12-vlot supply. Then determine if your project needs to operate at just one speed or over some range of speeds. Determine the maximum and minimum speeds that will ever be needed. If the maximum speed is less than the motor speed for 12 volts, it would be best to add some means like a belt an pulleys to to reduce the speed further mechanically. That will further increase the available torque. Reducing the speed mechanically to the maximum speed required will most efficiently use the motor. Electronic speed control should be used only to provide adjustable speed, not to reduce the maximum speed.

You can use a single 12-volt battery or power supply to power both the Raspberry Pi and the motor. You will need a voltage regulator to reduce the voltage to 5 V for the Raspberry Pi. You will need some noise filtering to prevent noise from the motor's commutator from interfering with the Raspberry Pi.

A PWM controlled H bridge can be used to control the motor speed by reducing the effective voltage from 12 volts.

The battery needs to be sized to supply the maximum total current that the motor and Raspberry Pi might need. The loads will only draw the current they need. There is no need to worry about excess supply.