Bluetooth Remote Control Treaded Chassis
This is my first robot using an Atmel ATtiny2313 Microcontroller. It uses an L298N H-bridge with no PWM, with plans to add PWM. I've included schematic and code in the files. The high current/low voltage Tamiya motors were swapped out for Solarbotics RM3 motors. The gearbox is a Tamiya Twin motor gearbox. The Bluetooth module is the Roving Networks RN-41-SM and is available at Mouser.com for $45.
The Cell phone is programmed in Python for S60 v2.0.0. The computer program is a LabVIEW 8.20 virtual instrument control. Remove the _.txt extension when using these two files.
UPDATE:
I've added PWM for independent speed control of each motor as a function of accelerometer values in the phone. The last video shows a demonstration of the PWM version. The zip file 'Bluetooth_and_accelerometer_RC_tank_with_PWM.zip' includes all PWM version code and updated schematic. This revision was mostly changing code - the only hardware changes was the addition of a couple of wires to connect the PWM outputs of the microcontroller to the enable inputs of the H-bridge, which required moving a couple of IO pins to get at the necessary dedicated PWM pins.
The improvements made to this revision:
- PWM
- Graphical accelerometer feedback on phone python script
- Bluetooth automatically turned on when off in python script (before it failed when BT was off)
- New communication scheme to transmit direction and PWM commands to vehicle - has the form {<dir><left PWM><right PWM>}
- Automatic shutoff - microcontroller firmware stops the motors if no commands are received within 100ms (accomplished with 16-bit timer), which prevents the robot from continuing to move when the Bluetooth connection is terminated or fails. This requires the phone to transmit constantly.
You may also notice it looks more responsive. That's because I was using a lowpass filter when reading accelerometer data in the first revision, oops!
Controlled via phone accelerometers and Bluetooth
- Actuators / output devices: Tamiya gears and tracks
- Control method: Bluetooth
- Power source: 4xAA rechargeable
- Programming language: C, Python
- Target environment: indoors