Bluetooth Toy Car
Posted: September 13, 2013
So this is "pimp my crappy-ass toy R/C car" part 3. In my first project I used an MSP430 and a $10 car. In this project I'm using Bluetooth and and Android phone with the $20 car. This is the same model car as the dsPIC car but this time a Corvette instead of a Mustang.
Related Projects @mikekohn.net
My chip of choice here is the Atmel ATtiny2313 (no, it's not an Arduino) programmed in pure assembly language with naken_asm. I picked this chip since it could run at 5v (with a maximum rating of 6v). Since this car has a compartment on the bottom for 4 AA batteries, I used this to power the car. I was trying to avoid using a voltage regulator (unlike the circuit I did for the dsPIC.. although that car ran on a 7.4v LiPo which made the car faster). Since the Atmel chip isn't really supposed to go over 5v (maximum rating of 6v) I used some 1N4001 diodes to try and lower the voltage.
To control the car I made a simple little protocol that translates a single byte over the UART into a command. The lower 2 bits of the byte tells the micro which part of the car to change (0 for rear wheels, 1 for front wheels, and 2 for LED's). The upper 6 bits are the value is to be set:
; Command byte:
If no data is seen on the line for 1/2 or so the motors will turns off for saftey.
The Android App
The Android app was mostly copied code from my Bluetooth thermometer project. It simply allows the user to pick a Bluetooth device that was previous paired and then 4 buttons appear on the screen. The first two buttons independently control two LED's that are mounted on the bottom of the car. The third button tells the Android app if it should send motor commands to the chip or not (kind of a safety feature.. didn't help though when I couldn't hit the button fast enough and accidently drove the car down the steps). The car is controlled with the accelerometer in the phone so that tilting left and right turns the car and tipping the phone forward or back changes the speed of the car moving forward or back. I was going to post the app on the Google Play store giving people the option to build the circuit and have a premade app, but I'm sick of idiots who downloaded the Bluetooth thermometer and whined and gave it bad reviews because they didn't have my circuit. If anyone wants it let me know. Maybe I'll find another way to distribute it.
Here's the car circuit prototyped and tested with a smaller car. For a larger version of the video try https://youtu.be/DQQVk2ZYWE8.
Here's a test drive of the car in my basement. I kept the lights dim to help show off the LED's on the bottom of the car. Not the best video since it's prety difficult to drive the car and film a video. For a larger version of the video try https://youtu.be/i43b2rE464g.
The car, seen here in its original packaging, is made by Jada with the model being BigTime Muscle. This is a 2009 Corvette Stringray concept car. The original circuit is only able to go left/right and forward/back without any speed control. My circuit gives PWM to the back motor so speed can be adjusted. The front wheels have a very weird design where there is another motor similar to the one in the back that can pull the wheels left/right depending on the direction of the current. The wheels are centered by some springs. Kind of seems hackish to stall a motor like this, but I guess it works.
Here is the car out of its packaging not yet modified. I was planning to put headlights on the front, but it would have been too difficult with the shape of this car so I put a purple and blue LED on the bottom instead.
Here's the circuit board sitting inside the car all wired up. This board looks a lot cleaner than dsPIC car since the steering and an drive motor are running at the same voltage I was able to use 1 chip for both motors. On top of that by only using the SN754410 and not the L293, I removed the kickback diodes.
And here's the schematic...
Copyright 1997-2024 - Michael Kohn