Control Your Stepper & DC Motors with Raspberry Pi Motor Shield

Control Your Stepper & DC Motors with Raspberry Pi Motor Shield


At some point in time in our life, as a kid or an adult, we have been fascinated by the robots or the similar machines that perform things that leave us spellbound. This fascination has led many enthusiasts to discover and develop various tools and motors. Along with just the tools, the controller board, the motor driver board, and the processor board are also required to mechanize the machine completely. There comes the Motor Shield which solves the purpose of making a 4-motor robot or a 2-motor robot. You can precisely control the movements and the motions of the robot.

Raspberry Pi Motor Shield is a Raspberry Pi based HAT used for controlling 2 stepper motors or 4 DC motors that lets you drive motors, controlling the speed and direction of each one independently. All you need is just connecting the Motor Shield, Raspberry Pi, and combined with the desired programming code, now it's all ready to start your robotic exploration: line tracking, obstacle avoidance, distance measurement, maze solver robot, video monitoring, WiFi/Bluetooth/ZigBee/Infrared remote control, etc. Mounting a camera on the top makes it a surveillance-based robot car.


Motor shield HAT is designed to help you control your Raspberry Pi based Robot. This board lets you control up to 4 DC motors. It includes direction indicator LEDs to help you configure your motor output and connectors designed for plugging in IR and ultrasonic sensor modules to tell your robot about its environment. Enabled with IR Sensor and the Ultrasonic sensor, it becomes a perfect component for the object detection/avoidance, wall-following or light/line following robots.

The board is designed specifically for the Raspberry Pi 2, Raspberry Pi 3 and Raspberry Pi 3 model B+. Based around the L293D IC it is capable of driving 4 DC motors or 2 stepper motors. The L293D is a dual full bridge driver that can output up to 1A per bridge with supply voltage up to 24V.


  • Dual H-Bridge IC L293D: For controlling up to for 4 DC motors or 2 stepper motors.
  • Motor Input Supply Range: 6V – 24V
  • Single Motor Output Current: 600mA or 1A peak current per channel
  • Onboard LED arrow indicator for motor direction control
  • 2 IR sensor Connectors with 3.3V level output protection
  • 1 Ultrasonic Sensor Connector with 3.3V level output protection
  • Python library for simplifying integration with the board.
  • Python based motor shield GUI

Things you can learn:

  • Controller-based programming
  • Precisely control motor movements
  • Control stepper motors
  • Make your own robots
  • PWM based speed controlling of motors
  • IR sensor and Ultrasonic sensor interfacing

Best place to buy

SB Components Shop is the official website for the Motorshield at a reasonable price. We also provide an easy interfacing based software so that you can just start playing with the motor shield without having to program the board.

We also offer other product for makers to make things intelligent using Raspberry Pi, Micro: Bit, Arduino, robotics, etc. We also offer a variety of protective cases on our online shop

Previous Blog: How to Send an E-mail via Raspberry Pi?


2 thoughts on “Control Your Stepper & DC Motors with Raspberry Pi Motor Shield

John Franklyn

I have an RPI 4b with 2 of your pi motor hats stacked on top of it. I’m driving 2 motors with 1 hat and 2 other motors with the 2nd hat. I need to change the i2c address of one of the hats. Currently i2cdetect shows addresses 40, 70. 40 is one of the hats and 70 is the RPI. I see the 5 jumpers on the back side of the hat, but no documentation on how to use those to change the address. Please advise or point me to the documentation. Thanks

June 22, 2022 at 10:46am

Is there a datasheet/schematic provided for this unit?

October 10, 2019 at 09:49am

Leave a comment

Your email address will not be published. Required fields are marked *

Please note, comments must be approved before they are published