Loading...
 
Skip to main content
structure
RPi Kits PCB05 Front01 900w

Raspberry Pi PCB
Drive Motor control

PXL 20201025 082325383.NIGHT Whitened 1000w

 

Conventional 'drive' motors, controlled by a Raspberry Pi, are very commonly used in many projects e.g. the various types of 'wheeled' robots it is possible to build.

The Raspberry Pi PCB can be used to prototype/demonstrate 'drive' motor control and the examples below describe the use of very commonly used 5-6V geared motors controlled by two different types of motor controller. In these examples the custom 3D prints used to mount the various components are designed to connect to standard LEGO blocks so that they can be incorporated into overall LEGO constructs; the 3D print designs for the 'connectors' shown in the images below can be downloaded at the Prusa site here.

For each use case Python software has been developed to demonstrate all the usual motor control methods that would be needed for a 'wheeled' robotics project and all the currently available example software and documentation is available here.

 

HG7881 motor controller

HG7881 02 800w

 

The HG7881 motor controller, as shown on the left, is a small and relatively basic 2-channel device for controlling two electric motors.

The board and its controlled motors can be powered from a source that can supply from 2.4 to 10.0 volts DC and each motor can be supplied with a maximum of 800mA continuously.

The small size of this motor controller board, with its reasonable range of voltage/current capabilities, make it a very useful module for use in 'making' projects such as robotics.

 

 

RPi_kits_PCB05_20210425_064015619_900w As shown in the image on the right, an HG7881 motor controller can be connected to the Raspberry Pi Maker PCB PCB to independently control two drive motors, with power for both the motor controller and the two drive motors supplied from either a 4xAA battery pack, or as shown on the right, from a 5V USB battery bank.

For this test/demonstration build option the HG7881 control pins are 'reusing' the stepper motor IN1-IN4 input pins on the PCB, with power to the motor controller and the drive motors being fed from the PCB power bus.

The drive motors shown here have been mounted on custom 3D printed LEGO compatible blocks so that they can be incorporated into an overall LEGO 'mechatronic' construction where parts of the build can be made to move with the motors.

 

RPi Kits PCB01 HG7881 20201008 080401749.NIGHT 800w

A 16x2 LCD has also been connected to the PCB in this test arrangement so that the controlling Python code can also display the status of the 'drives' during the various running modes.

 

The HG7881 has also been mounted on a small 3D printed custom designed LEGO compatible 'tile', as shown on the left, so this too can be securely incorporated into an overall LEGO construct.

 

 

 

L298N motor controller

L298N Image Markedup 500w The L298N motor controller board, as shown on the left, provides a wide range of capabilities for controlling two electric motors.

The motors can be powered from a source that can supply from 5 to 35 volts DC and each motor can be supplied with 2A continuously. The board itself is powered from the same supply source with the voltage automatically stepped down to 5 volts DC and when  powered correctly the L298N board has a red LED switched on.

A very useful capability is that if the input power comes from anything that supplies no more than 12 volts DC, then a board 'jumper' enables an output feed of 5 volts DC which can be used to power the controller e.g. a Raspberry Pi, Arduino board, etc.

 

RPi_kits_PCB05_20210424_093727117.NIGHT_900w

 

 

As shown in the image on the right, a L298N motor controller can be used to independently control two drive motors when connected to the PCB, with power for the motor controller and the two drive motors supplied either by a 4xAA battery pack, as shown, or from a 5V USB battery bank.

For this test/demonstration build option, the L298N IN1-IN4 control pins are 'reusing' the PCB's stepper motor IN1-IN4 input pins on the PCB and the L298N's ENA + ENB pins are connected to the PCB's 'spare' GPIO #15 and #18 connectors. Power input to the motor controller is then fed from the PCB power bus and the drive motors' power supplied from the L298N in the usual way.

A 16x2 LCD has also been connected to the PCB in the test arrangement shown so that the controlling Python code can also display the status of the 'drives' during the various running modes.

 

RPi Kits PCB01 L298N 20201008 181927672 800w

 

 

The drive motors shown here have been mounted on custom 3D printed LEGO compatible blocks so that they can be incorporated into an overall LEGO 'mechatronic' construction where parts of the build can be made to move with the motors.

The L298N has also been mounted on a 3D printed custom designed LEGO compatible 'tile', as shown on the left, so this too can be securely incorporated into an overall LEGO construct.

 

 

 

 

 

 

Electric motor control:

 

 

The following links provide more details on various aspects of this evolving PCB project development:

 

 

Details for all the Maker PCB projects:

 

 

All the currently available maker project information:

 

 


Page last modified on Thursday 27 February 2025 11:37:04 GMT