Raspberry Pi Motor control HAT

DC Motor Control HAT

Using a Raspberry Pi to control DC motors needs additional hardware and I wanted to create a minimal sized HAT to cover a lot of requirements as listed below.


  • 3 channel DC Motor control using SN754410ne drivers using the DFRobot motors.
  • 3 channel encoder ls7184n processing (processed before it gets to the Pi so that you just get a direction and steps # flag)
  • 2 channel MOSFET FQP30N06 switching for external devices
  • SPI breakout
  • RF24 wireless breakout
  • 5v input for Pi
  • specific motor input so that you can run different voltage motor types
  • Piezo buzzer
  • Raspberry Pi GPIO header
  • 3 x RJ45 headers for connection to the motors to have motor control and pass back the encoder data.



This add on HAT uses just about every single GPIO pin to achieve motion control of 3 axis of DC motors.
The encoder IC provides a direction and utilises the A and B channels from the Motor encoder to give an accurate position.


Sick write-up Andrew!

Thats a sick IC, if I ever need to read an encoder on a Pi I’ll be sure to jump on this!


It is an awesome IC, pity that it is difficult to get. I had to order 50 from the USA and all the associated costs that go along with that, however now that I am using it, the timing issues that I was having when reading the A and B channels went away.

The Encoder IC coupled with the DFRobot mini DC Encoder motors is a very sweet combination, the only component that I would like to change over time is the motor driver, purely because I cant get the braking function to work.
If the motors would stop faster it would be ideal, currently getting about 4-5 encoder rotations after commanding it to stop.
The other driver issue is that the motors really wont drive at any other speed than 100% via PWM, the torque is simply reduced too much.
That was the first test in replacing braking, slow down the motor when coming up to the set-point, but it would always end up stalling, unfortunately.