Wireless, Motion Controlled Differential Drive Robot with Gripper

A differential drive robot with a gripper mounted to the front, for the purpose of grabbing people’s ankles. This project was highlighted in an article by McCormick Computer Science!

Link to the article


This purpose of this project was always a little silly; to grab peoples ankles. I think that despite this, at the end my partner Rahul Roy and I ended up with a project that ties together many complex pieces into one cohesive and elegant package.

The project utilizes the Micro:Bit, which is basically a toy. What’s interesting is that the microcontroller behind the Micro:Bit is an nRF52833, which is surprisingly powerful. What makes the microbit more powerful is that it has an onboard accelerometer and a radio antenna.


This project utilizes two microbits and the MotoBit, a differential drive car. A user tilts one microbit like a wii remote, then the second microbit receives commands wirelessly from the first microbit and controls the car.

User Controls

The user is intended to hold the first microbit parallel to the ground. The microbit calculates Euler angles \(\phi, \psi\), and \(\phi\) using the equations on page 7 of this application note. These angles are transmitted wirelessly to the second microbit using radio communication at 2.4GHz.

The accelerometer is communicated with via I2C, as it’s an external chip to the nRF52833. The specific chip is a LSM303AGR, and here’s its datasheet We communicate with this chip using the nRF TWI Manager library. Calculating the Euler angles using an accelerometer is far better than using a gyroscope, in my opinion, because you don’t have to worry about drift at all. The downside is that you don’t know if you’ve rotated in place or not.

The wireless communication is done using the nRF IEEE 802154 radio drive library. This microbit only functions as a transmitter.

Controlling the Differential Drive Robot

The second microbit is mounted on the differential drive robot using the SparkFun moto:bit - micro:bit Carrier Board.

It functions as a radio receiver, and it receives the Euler angles measured from the first microbit wirelessly. Once these Euler angles are obtained, they’re used to calculate the wheel velocities of the differential drive car. Only \(\psi\) and \(\theta\) are used, as we assume the z axis is straight up and down.

Tilting the first microbit to create a positive angle about the x-axis (\(\psi\)) drives both the left and right wheels forward equal amounts. Tilting the first microbit around the y-axis will increase the speed of the right wheel if the angle is positive, and will increase the speed of the left wheel if the angle is negative.

A small threshold of 10 degrees is used to reduce jitter.

16-bit integers are used to hold the speed value of each of the wheels, however the speed should never exceed 150. There’s a final check before the speed is sent to the motor drivers to ensure that the speed value of each wheel never exceeds 150.

Controlling the Gripper

The gripper is controller via a servo motor. We implement a PWM frequency at 1000Hz to drive the servo. A duty cycle of 1% will fully close the gripper, whereas a duty cycle of 60% will fully open the gripper.

The gripper’s only input is an 8x8 grid array of IR sensors mounted just above the gripper, pointed forward. We take an average of the value of each of these IR sensors, and if the temperature they average is greater than 90, the gripper will close.

This is pretty rudimentary, however it works quite well in practice. If the user drives the car up to somebody’s ankle, the gripper will close on the person’s ankle and grab them. How fun!


While this project seems quite simple on the surface, it involved writing motor control logic for a differential drive robot, wireless communication, I2C communication, calculation of Euler angles based off of gravitational acceleration alone, PWM signal generation, and more… and all of it in C!

Demo Day

Another Angle Holding Robot