Hello and Welcome! If you have a technical question please check out our Forums. If you have an order or shipping question please refer to our Customer Support page. Please see all COVID-19 updates here and thank you for your continued support.


Please take our customer survey for a chance to win $1000 in SparkFun credit! We really appreciate the time you take to give us your extremely valuable feedback on how SparkFun can be its best - we couldn't do it without your input. Thank you!

SparkFun Auto pHAT for Raspberry Pi

The SparkFun Auto pHAT for Raspberry Pi is an all in one robotics package that focuses on quickly adding robot functionality and support to your Raspberry Pi or other single-board computer. The Auto pHAT can drive two small DC motors with or without encoders and up to four servo motors in a straightforward manner via an I2C connection. The servo control is based on the SparkFun servo pHAT and thanks to its I2C capabilities, this PWM add-on saves the Raspberry Pi's GPIO pins, allowing you to use them for other purposes. We have also provided a Qwiic connector for easy interfacing with the I2C bus using the Qwiic system. Whether you use the Auto pHAT with a Raspberry Pi, NVIDIA, Jetson Nano, Google Coral, or other SBC, it makes for a unique robotics addition for and board with a 2x20 GPIO.

The DC motor control comes from the same 4245 PSOC and 2-channel motor ports system used on the SparkFun Qwiic Motor Driver. This provides 1.2A steady state drive per channel (1.5A peak) and 127 levels of DC drive strength. The SparkFun Auto pHAT also supports up to two motor encoders thanks to the onboard ATTINY84A to provide more precise movement to your creation!

Additionally, the Auto pHAT has an on-board ICM-20948 9DOF IMU for all your motion sensing needs. This enables your robot to access the 3-Axis Gyroscope with four selectable ranges, 3-Axis Accelerometer, again with four selectable ranges, and 3-axis magnetometer with an FSR of ±4900µT.

Power to the SparkFun Auto pHAT can be supplied through USB-C connector or external power. This will power either the motors only, or power the motors as well as the Raspberry Pi that is connected to the HAT. We've even added power protection circuits to the design, to avoid damage to power sources.

  • 4245 PSOC and 2-channel motor ports programmable using Qwiic library
  • On board ATTINY84A supports up to two DC motor encoders
  • 5v pass-through from RPi
  • On board ICM-20948 9DOF IMU for motion sensing accessible via Qwiic library
  • PWM control for up to four servos
  • Qwiic connector for expansion to full SparkFun Qwiic ecosystem
  • Designed for stacking, full header support & can use additional pHATs on top of it
  • Uninhibited access to the RPi camera connector & display connector.
  • USB-C for powering 5V rail (Motors/Servos/backpowering Pi)
  • External power inputs broken out to PTH headers

SparkFun Auto pHAT for Raspberry Pi Product Help and Resources

SparkFun Auto pHAT Hookup Guide

April 16, 2020

The pHAT to get your projects moving. This guide will help you get started using the Auto pHAT.

Core Skill: Robotics

This skill concerns mechanical and robotics knowledge. You may need to know how mechanical parts interact, how motors work, or how to use motor drivers and controllers.

2 Robotics

Skill Level: Rookie - You will be required to know some basics about motors, basic motor drivers and how simple robotic motion can be accomplished.
See all skill levels

Core Skill: DIY

Whether it's for assembling a kit, hacking an enclosure, or creating your own parts; the DIY skill is all about knowing how to use tools and the techniques associated with them.


Skill Level: Noob - Basic assembly is required. You may need to provide your own basic tools like a screwdriver, hammer or scissors. Power tools or custom parts are not required. Instructions will be included and easy to follow. Sewing may be required, but only with included patterns.
See all skill levels

Core Skill: Programming

If a board needs code or communicates somehow, you're going to need to know how to program or interface with it. The programming skill is all about communication and code.

3 Programming

Skill Level: Competent - The toolchain for programming is a bit more complex and will examples may not be explicitly provided for you. You will be required to have a fundamental knowledge of programming and be required to provide your own code. You may need to modify existing libraries or code to work with your specific hardware. Sensor and hardware interfaces will be SPI or I2C.
See all skill levels

Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

2 Electrical Prototyping

Skill Level: Rookie - You may be required to know a bit more about the component, such as orientation, or how to hook it up, in addition to power requirements. You will need to understand polarized components.
See all skill levels


Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Is the PSOC able to talk to the encoder counter ATTINY as well? Ultimately everything on the board can support closing the loop with the encoders, but it's not clear if the PSOC is able to support master communication to the ATTINY and slave communication to the pi - is this possible the way the hardware is configured? It's so close to being perfect!

    • Hi there, it sounds like you are looking for technical assistance. Please use the link in the banner above, to get started with posting a topic in our forums. Our technical support team will do their best to assist you.

      That being said, yes it is possible, as they are connected to the same I2C bus. However, you would need to re-program the PSOC using the SWD pins. Unfortunately, those instructions are beyond the scope of our support team. (I would recommend checking out the schematic and our Serial Controlled Motor Driver for information on the PSOC firmware.)

  • Is it possible to have code source of the ATiny ? (if I ask kindfully...)

  • Will this board be stackable, allowing for more motors and servos?

    • Yes, the I2C addresses just need to be modified for the motor driver and servo controller ICs, with the jumpers on the bottom.

      • Hey Santa and #965, Thanks for chiming in here! You are correct. But I also wanted to mention there are 2 more devices on the I2C bus: (1) the 9DoF IMU and (2) the Encoder Reader ATTiny84. (this means there are 4 total devices on the bus that you must consider while stacking). All of these have dedicated hardware address jumpers on the bottom side of the board, so this would enable stacking two of the HATs.

        Hey #965, how many HATs were you thinking of stacking? For what application?

  • Hi there, is it possible to stack more servos? Maybe stacking this servo controller "Zio 16 Servo Controller" https://www.sparkfun.com/products/16773 ?

    • Hi there, it sounds like you are looking for technical assistance. Please use the link in the banner above, to get started with posting a topic in our forums. Our technical support team will do their best to assist you.

      That being said... yes, you can add more PCA9685 chips (i.e. servo controllers) to the I2C bus. You just need to modify the jumpers so that each controller has their own I2C address (i.e. similar idea to giving people their own phone number or home address). Then you would need to modify the code so that you are controlling each chip separately.

  • The board has pins for powering the motors externally, but the hookup guide says that the DRV8835 H-bridge is hard wired to 5V. Do I need to disconnect the 5V hard wiring somehow before using the external power pins?
    I am using a pair of L-shaped TT motors and encoders and at only 3 Ohms of resistance I find that the motor needs to draw 1.7A to start from stall when powered with 5V. If I can power the H-bridge with only 3.3V then the current draw should remain below the 1.5A max and 1.2A steady state limit.

Customer Reviews

No reviews yet.