Pi Takes Control of the Monster

Now we have the GrovePi we can interface the Pi with the Sparkfun Monster Moto shield so the Pi can control the motor driver. Before hooking up the motor driver to the shield Reb and I needed to confirm which inputs on the Monster Moto operated which motors, Sparkfun’s sketch gave us some clues but we wanted to be certain.

reb at laptop with arduino and multimeter

Testing the monster moto inputs

Using a multimeter and running our motor Arduino program for the last time we wrote a table of pins high and low from pins 4 – 9 as we changed the motors individually from clockwise rotation to anti-clockwise. The result:

  • Motor 1A pin 9
  • Motor 1B pin 4
  • Motor 2A pin 7
  • Motor 2B pin 8
  • Motor 1 PWM pin 5
  • Motor 2 PWM pin 6

Because the Monster Moto is an Arduino shield and we happened to have an Arduino Grove shield too we’ve decided to wire the GrovePi to the motor drivers using JST connectors instead of individual wires to the rails – which we think is neater. The JST connectors on the Grove breakouts are couplets of pins along with a 5V and GND line. Due to the configuration of these and the inputs to the motor driver we would have to use 4 JST connectors – we have reduced this to 3 by jumping pin 3 to 9 on the motor driver saving us a JST connector on the GrovePi for something else – you can see this on the motor driver rail in the photo below.

two grove breakouts connected to each other

Jumping the GrovePi to the Monster Moto shield

We wrote a Python script to test out the motor driver – this code snippet which runs on the Pi tests all drive functions of the motors:

A quick vid to show it in action:

Leave a Reply

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