◎ la38 motor controller on a equipment machine to power and spin a pair of DC motors!

Whether it’s a tiny robot mouse or a tiny IoT electric fan, knowing how to control things with a DC motor with a equipment machine opens up a lot of creative DIY projects to keep you busy. In this tutorial, we’re using the la38 motor controller on a equipment machine to power and spin a pair of DC motors!
The la38 Motor Controller Module is a board that helps microcontrollers and microprocessors such as the equipment machine power DC motors that require more than 3.3V or 5V.
It uses the la38 IC to power all the logic and power management needed to start the motor and isolate the equipment machine from the higher voltages applied to the DC motor.
The la38 module is the main motor controller in the beginner robotics kit because it is easy to use. It has pin headers where you can insert jumpers to seamlessly connect it to your equipment machine. You can also speed up or slow down the motor by applying a pulse-width modulation (PWM) signal to its enable pin terminal.
In terms of currents, the la38 is a high current. It is actually a 10 amp currents consisting of motors with four momentary electric switches contact.This allows you to set the current direction without reconnecting the motor. Changing the direction of the current on the H-bridge also changes the direction of rotation of the motor. The la38 has two control contact of them, which allows you to control a pair of motors independently.  If you’re new to Python programming, don’t miss these helpful Python one-liners.
In the while loop, the leftForward and rightForward pins first turn on for one second. To control the speed, change the turn-on output duty cycle. First set them to 100% duty cycle for one second, then set them to 50%. A duty cycle of 100% will run the motors at maximum speed, while a duty cycle of 50% will run at half speed.
Save it as “rpi-dcmotor.py” or any other filename if it ends with “.py” extension. After that turn off your equipment machine.
NOTE. These jumper pins automatically connect the EN pin to 5V, “allowing” you to control the current through the IN pin. While you should still be supplying power through this pin, 5V can cause some problems for the equipment machine as it is supposed to use 3.3V instead of 5V. Also, connecting these pins to the equipment machine will allow you to control the speed of the motors later. .
Tip: To find out what the pin number is on your equipment machine, hold it so that the GPIO pins are on the right. These are tiny metal shards sitting on a black tray. Then if you look at the top left pin from that tray, that’s pin 1. To the right of that is pin 2. Under pin 1 is pin 3, and so on.
NOTE. Most DC motors do not usually have solder wires. You can solder them yourself. Any gauge will work, but stranded copper wire works best.
You can run the code by running the script on the terminal. But before that, you need to add power to the la38 module.
The la38 DC Motor Controller Module can be connected to any DC power supply as long as the voltage does not exceed 45V. In terms of usability, it would be easier to use a 9V battery and a DC plug connected to the module’s power terminals.
You also don’t have to worry about 9V batteries damaging your equipment machine. The la38 module uses a special IC called a MOSFET that acts like a low power relay, becoming an momentary electric switch that isolates your pins from the power supply.
How can I send current from a pin to make a DC motor spin? Let’s take a closer look at how we make the motor spin.
The la38 motor controller module uses several momentary electric switches to control the rotation of the motor. You can think of these switches like a wall switch, except they don’t use your fingers to operate – they use 3.3V from the equipment machine.
 And that’s where GPIO.output( , GPIO.HIGH). This is GPIO.output( , GPIO.HIGH). Setting this pin to GPIO.HIGH causes this pin to emit 3.3V. This activates the switch, allowing current to flow to the motor. The current then spins the motor. Flipping these pins to GPIO.LOW turns off the switch, which cuts power to the motor.
We can change the direction of rotation of the motor by changing the direction of the current through the motor. That’s why we have two separate pins to control the rotation of one motor: rear and front. They operate momentary electric switches on either side of the motor’s power supply, directing power forward or backward.
The same goes for speed. Unlike the forward and reverse output pins, the enable pin controls the amount of power flowing through the motor at any given time.
By increasing the voltage at the turn-on contact, their switches open a little “wider” and allow more current to flow through the motor. Increasing the power of the engines makes them spin faster. Decreasing makes them slower.
On the equipment machine, we use PWM or Pulse Modulation to control the output voltage of the pins. Increasing the duty cycle brings the maximum voltage closer to 3.3V, and decreasing it closer to 0V.
In fact, you can “switch off” the engine in some way by setting the engine enable pin to 0V. Think of it like something like a car: the enable pins supply the gas that powers the motors, and the forward and reverse pins strokes move the gears, allowing them to move forward or backward.
They differ depending on where their solenoid coils are located. A DC brushed motor has a coil in the middle that rotates between a ring of permanent magnets. Brushless DC motors have coils on the other side – their electromagnetic coils surround permanent magnets.
Collector motors are cheap and have good performance at low speeds. However, they tend to heat up faster than brushless motors and are less energy efficient. On the other hand, brushless motors can reach higher speeds, overheat less, and use less power to spin faster than brushed motors.
If you are using a motor inside a equipment machine robot wheel gearbox, a brushed motor should be better. However, if you are using a non-geared motor such as a tiny electric fan, a brushless motor should be better.
Although this may vary by manufacturer, you can expect 2A peak current per motor in the la38 motor driver module.
Terence is a robotics enthusiast trying to build the best robot in the world. If he hadn’t been burning LEDs as a second hobby, he would have taken up this a long time ago.
Affiliate Disclosure. Making it easy to earn commissions on products purchased through our links supports the work we do for our readers.