Ever wanted to control a tank with your phone? Well, here’s one way to make it happen (Figure 1).
Figure 1. | Bluetooth MSP430 Tank |
Parts:
- MSP430 Launchpad with MSP430G2553 chip from Texas Instruments (TI).
- Wireless Bluetooth V2.0 RS232 TTL Tranceiver Module
- Motor Drive Booster Pack You’ll need to make this yourself unless the guy (Parker Dillmann @ longhornengineer.com) who designed it starts selling them. I used oshpark.com to print the board, and mouser.com to order the parts.
- A Tank with 2 motors. You’re on your own here, but I bought my tank treads and motors at Pololu.com, and built the chassis out of scrap and legos.
- Some sort of battery (I used a 6.2V NiCd from another RC vehicle).
- And of course, an android phone.
LaunchPad is an easy-to-use development tool intended for beginners and experienced users alike for creating microcontroller-based applications (Figure 2). At $4.30, the LaunchPad offers everything you need to get started with your projects.
Figure 2. | MSP430 LaunchPad (MSP-EXP430G2). |
The LaunchPad development kit is a part of the MSP430 Value Line series. LaunchPad has an integrated DIP target socket that supports up to 20 pins, allowing MSP430 Value Line devices to be dropped into the LaunchPad board. Also, an on-board flash emulation tool allows direct interface to a PC for easy programming, debugging, and evaluation. Included are free and downloadable software development environments for writing and debugging software. LaunchPad can be used to create interactive solutions thanks to its on-board push buttons, LEDs, and extra input/output pins for easy integration of external devices.
Motor Drive Booster Pack - This is a Low Voltage, 2A motor controller BoosterPack for the Ti LaunchPad (Figure 3, 4). So far I have not found a motor controller yet so I decided to make one.
Figure 3. | Low Voltage, 2A motor controller BoosterPack for the Ti LaunchPad. | Figure 4. | Motor Driver Booster Pack connected to MSP430 LaunchPad. |
It uses the Ti DRV8833PWPR Dual H-bridge Motor Driver chip. The chip is capable of 2Amps per motor channel and a motor voltage from 2.7V to 10.8V. Logic voltage for the DRV8833 is 3.3V which makes it a perfect match for the MSP-430 LaunchPad (Figure 5).
Figure 5. | Motor Driver Booster Pack Schematic Diagram. |
The BoosterPack has the nSleep pin broken out from the DRV8833. Using this pin will put the DRV8833 to sleep to minimize current draw. If this pin is not needed or the LaunchPad is lacking I/O there is a jumper to pull the nSleep pin high.
The transceiver module is easy to use and completely encapsulated (Figure 6). It allows your target device to both send and receive the TTL data via Bluetooth technology without connecting a serial cable to your computer. The wireless Bluetooth RS232TIL transceiver module is suitable for mouse, keyboard, joystick; computers and peripherals; GPS receiver; instrument and industrial control.
Figure 6. | Wireless Bluetooth V2.0 RS232 TTL Transceiver Module. |
Features:
- Allows your target device to both send and receive the TTL data via Bluetooth technology without connecting a serial cable to your computer
- Easy to use and completely encapsulated
- Chipset: CSR
- Bluetooth V2.0
- Working voltage: 3.3V
- Current: pairing 20~30mA, connected 8mA
- User defined Baud rate: 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200
- Default serial port setting: 9600, N, 8, 1
- Suitable for: mouse, keyboard, joystick; computers and peripherals; GPS receiver; instrument and industrial control
Source Code for Android application is pretty rough, a cobbling together of various stuff from the internet and old projects I’ve written in the past.
It’s just two sliders to control each motor and a menu item to connect to the bluetooth device. It actually took some pretty tricky coding to the get the interface right, and I learned a lot about android bluetooth and multitouch programming in the process. I can post the code if anybody is interested, but it is pretty rough (see above).
All in all, a fun project where I learned a lot as usual. Next step might be to add some sensors. Or maybe a really bright LED and then have a control on the phone to flash it at people. Anyway, here’s a little video of the setup in action:
Downloads
Source code for launcPad - download
Motor Driver Booster Pack schematic and PCB (Eagle V6) - download
Wireless Bluetooth V2.0 RS232 TTL Tranceiver Module Documentation - download
.apk and Android Application Source Code - download