I2C Motor Controller Board

Read it on my new Blog: www.keeganmann.com

board pic

Partially assembled first revision of the Motor Controller Board


I’ve recently been developing an I2C motor controller board for UC Berkeley’s Pioneers in Engineering (PiE), a club who’s purpose is to run a high school robotics competition. PiE creates the kit of parts which high schoolers use to create their robots and provides them with college mentors to help them through the process of building their robot. This year, this means building a motor controller to provide a cheaper alternative to the Pololu Simple motor controller.


We decided to use the Freescale MC33887 H-bridge chip and the ATMEGA328 microcontroller. The ATMEGA328 allows us to read encoder signals making them accessible over the I2C interface and can run a PID using current sensing or the encoder. It’s also the same chip used on Arduino boards so we can use the Arduino IDE and libraries. Allowing the encoders to be read through the motor controller frees up processing on the main controller and simplifies wiring.

Some modifications were necessary to upload the Arduino bootloader on the ATMEGA328 because it has different signature bits from the ATMEGA328P. I haven’t yet figured out how to upload the bootloader using the Arduino IDE and found it easier to just use avrdude directly from the command line.

Motor controller schematic


smaller version of the motor controller PCB


Final version of the board (without through hole components). Sorry for the fuzzy photo.

Later, I created a new revision which is significantly smaller (slightly larger than the Pololu simple motor controller). See the schematic, PCB design, and partially assembled board on the right.

As I continued working on the firmware for the device, the Arduino libraries became cumbersome, so I decided to switch to pure AVR C code.

The code I uploaded to the ATMEGA is available on GitHub along with some test software here: https://github.com/keeganmann/PiE-Motor-Controller

The eagle files are available here on google docs.

We’ve created documentation for the high school students on PiE’s public wiki.

Here are some videos:

It also plays nyan cat:

First revision board in action.

About these ads

About Keegan

Hi, I'm Keegan.
This entry was posted in Circuits, Robotics. Bookmark the permalink.

8 Responses to I2C Motor Controller Board

  1. Pingback: Motor controller also does nyan cat - Hack a Day

  2. Pingback: Motor controller also does nyan cat » Geko Geek

  3. Pingback: Motor controller also does nyan cat | ro-Stire

  4. Pingback: Motor controller also does nyan cat » Dirty Old Device

  5. Pingback: Motor controller also does nyan cat « Hackaday « Cool Internet Projects

  6. Pingback: Motor controller also does nyan cat | Orange Claymore Red Slime

  7. Pingback: Motor controller also does nyan cat | CisforComputers

  8. Pingback: Motor Controller Board Using I2C | HACKOLOG - Amazing Hacks and Mods

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s