Skip to content

Instantly share code, notes, and snippets.

@RandomInsano
Last active December 20, 2015 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RandomInsano/fa86a95a58abda48bcfb to your computer and use it in GitHub Desktop.
Save RandomInsano/fa86a95a58abda48bcfb to your computer and use it in GitHub Desktop.
Making a toy car autonomous via Arduino/RPi

The plan this time around is to take a one-button remote control car and make it autonomous so it can wonder the house on its own. One day maybe I'll have it map things using a Raspberry Pi Zero, but for now it will be Arduino controlled and use an ultra-sonic sensor to 'see'.

The toy car itself is pretty simple, and seems to be designed to be modular with the control chip being on a daughter board. All of the control for lights, motor and sound run to that board-to-board connector making it easy to hack! For those looking for their own, it seems to run under the name "My First RC Car" and it's manufactured by a company called Parent's which is out of China. It has three following delightful traits:

  1. Six transistor-controlled LEDs (no idea amperage ability, 3 channels with two LEDs each)
  2. A speaker with amplifier (for vroom-vroom noises)
  3. A single momentary switch just for beep-beep noises
  4. A one-way single button radio
  5. A zainy drive system that can go forward or steer to the left (no reversing possible)
  6. Some regulator down to 3V for the logic somewheres

I've gone and reverse engineered the pinout (see below). I've numbered these from left to right when looking at the mainboard from the back of the car (use LED traces and transistors for reference). All I/O is active high, so that makes life easy. The drive system seems to be controlled by an H-bridge made from TO-92 transistors, so make sure not to activate both at the same time or you'll short everything out. Also, VCC is regulated down from 6 volts down to 3.3v.

  1. Motor - Turn
  2. LEDs - Red (front)
  3. LEDs - Green (middle)
  4. LEDs - Yellow (back)
  5. Motor - Forward
  6. Ground
  7. Speaker
  8. VCC
  9. unknown
  10. Radio input (VCC)

I went and wired these to female headers so I could interface the car with either an Arduino Micro or a Raspberry Pi. Either should work thanks to the I/O being 3.3v.

I have so far tested driving the motor with a PWM signal from the Arduino API. It seemed to work well at higher than a 50% duty cycle, but that was with a nearly dead set of batteries. Be warned that there is a very noticeable hum from the motor because of the Arduino API not using a very high frequency.

With regard to batteries and power, I had serious brown-out problems with the low end of the batteries before adding a decently sized capacitor. The motor takes a decent amount of power so isolating the Arduino is a good plan. Also, use the VIN pin if connecting it to the battery so that the regulator can do its job. It will damage things otherwise.

For the radio input, it seems to have its own pulldown somehow. Attempting to use a 10k pull down resistor completely swamped out the high signal, so be mindful of that.

The audio amplifier input floats between vcc and ground. It is irritatingly loud, which you'll notice when you put batteries in for the first time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment