Motion Controlled Differential Drive Car with Infrared Sensor (IR) Operated Gripper
Programmed a nRF52833 microcontroller in C to control a differential drive car and autonomously operate a gripper on detection of objects using an IR sensor
Overview
As part of Northwestern’s microprocessor design course I took in the fall, my group and I created a motion controlled differential drive car which autonomously opens and closes a gripper on detection of objects (heat sources).
Car in action
System and Control
The system
The system comprises various components working in tandem: two microcontrollers communicating via radio - the BBC Micro:Bit (nRF52833) and the MotoBit, responsible for motor control in the RC car (utilizing the SparkFun moto:bit - micro:bit Carrier Board). Additionally, the system includes a PWM-controlled gripper (servo - MG996R) and an IR sensor (SparkFun Grid-EYE Infrared Array Breakout).
Developed around the Micro:bit V2, the project involved coding directly into the Micro:bit’s microcontroller (nRF52833) using C programming language. Leveraging two sensors, namely the built-in accelerometer (for which a custom Tilt driver was written to provide Euler angles to the Micro:bit controlling the car base via radio communication) and the IR sensor (Grid-EYE), the system is designed for robust functionality.
Communication between the microcontrollers is facilitated through Radio for which a wireless communication driver was written, allowing the transmission of Euler angles from the accelerometer-equipped Micro:bit to the car-based Micro:bit. This data dictates the movement of the RC car via the motodriver, controlled using I2C communication.
The end-effector, a mechanical gripper, operates in response to a servo (MG996R) controlled by a Micro:bit that sends Pulse Width Modulation (PWM) signals via I2C. Triggered by the breakout IR Grid-EYE sensor’s heat signatures, the gripper engages and disengages through a stem attachment.
The Car being controlled by the Microbit
Operation
The system operates as follows. It begins with the user tilting the Micro:bit, operating the Tilt driver for the accelerometer. This action generates precise Euler angles, transmitted as data packets via Radio communication to another Micro:bit positioned on the car’s base.
The Micro:bit on the car base serves as the command center, engaging in two primary functionalities. Firstly, it communicates via the I2C protocol with the motodriver, responsible for controlling the car’s motors. This communication translates the received Euler angles into specific motor commands, directing the car’s movement based on both the tilt direction and the degree of inclination.
Simultaneously, the system monitors its surroundings using the breakout IR Grid-EYE sensor. Upon detecting a heat signature, indicative of an object, this information is relayed back to the Micro:bit attached to the motodriver.
The Micro:bit interprets this data and generates Pulse Width Modulation (PWM) signals, which travel over the I2C protocol to the servo responsible for the gripper mechanism. These signals precisely control the opening and closing actions of the gripper, enabling it to interact with and manipulate objects within its reach.
The Team
- Graham Clifford
- Rahul Roy