Introduction: Driverless Powerwheels Car
It is becoming cheaper and cheaper to build artificially intelligent systems that would have been considered military technology 20 years ago. In this Instructable, I will show you how, for about $100, you can convert an old PowerWheels car to a wave-point programmable autonomous car.
The brain of the device is an off the shelf device called the ArduPilot Mega 2.6 (APM). Even though this is relatively old technology, It is advanced enough for an autonomous ground based vehicle. The APM is based around an ATmega 2600 (The same chip on the Arduino Mega). It is running firmware called ArduRover. I got the Power Wheels car second hand, and when I got it, it had a dead battery (I had to buy a new battery). This Instructable, as well as the amazing APM Rover documentation, should be all you need.
Step 1: What You Are Going to Need
- Power Wheels Car or other kids toy car (I got mine for free from a neighbor)
- Ardupilot Mega 2.5 (or Pixhawk)
- GPS & Compass for APM
- Telemetry for APM (Optional but highly recommended)
- Arduino Uno (To act as transmitter)
- 2 Brushed Car ESCs
- Waterproof Box
- Ultrasonic Rangefinders for obstacle avoidance
Step 2: Checking If Your Car Will Work for the Project
Before you begin, Make sure that the car you have will work for the project. You will be checking to see if the back wheels are controlled individually.
To check if the Power Wheels car you have will work for this project, spin one of the motorized wheels by hand. If the other wheel on the car spins, your car will not work. This is to see if there are two separate drive motors controlling the car. The way we will steer the APM car requires that it have two drive motors (tank style steering). If you wanted to use the steering wheel to turn, you will need to add a separate motor to move that. You could also check by taking apart the car to see how many motors are driving it.
Step 3: Prepare the Car for the APM
The APM car will not use the front wheels for steering. We are going to replace them with a caster wheel. This allows the APM to control the back wheels for steering, and not skid the front wheels against the ground. Try to get a caster that keeps the front of car level with the back wheels. Using two front casters would make the design much more stable.
Now would also be a good time to remove all the existing wiring. The only things you will need to keep are the back drive system (motor, gearbox, wheels)the battery and the fuse.
Step 4: Mounting the Hardware
In the Power Wheels car I used, there was a lot of wasted space in the motor assembly. I decided to mount my electronics there. The only thing I need to watch out for is the high heat that may build up in the closed area.
We will start by creating positive and negative terminals from the battery (Now would also be a good time to add a power switch in line with the battery as well as a fuse). The terminals I used were just two machine screws I screwed into the plastic of the car. All the devices that required power had crimp-on connectors that would slide onto the bolt. This setup was non-permanent and allowed for easy expansion.
Mounting the ESCs was the next step. I put them near their respective motors and attached them with screws to the main body of the car. I stripped the leads of the existing motor wires and attached bullet connectors to them. Bullet connectors were also attached to the ESCs. The power leads were attached via lug connectors to the two terminals mentioned above. Servo extensions were added to the signal leads so they would reach the APM.
The APM mounting is a crucial part of making the car work well. The GPS should be mounted outside the car to receive good reception. The APM will most likely have to be mounted near the GPS. This meant for me, that I would have to mount the APM inside a waterproof box directly on top of the motor housing. The APM needs to be mounted with the front of the car matching the arrow on the board. The direction of the GPS matters as well.
If you decide to use ultrasonic sensors on the car, you should attach them now. Try to put them on a part of the car that will not receive much water.
Step 5: Upload Arduino Code
This project does not need an RC transmitter for the rover to work., but the APM will be very fussy if it does not receive any transmitter input at all. This Arduino code communicates with the APM via PPM. It was based on code by Hasi on the RC groups forum.
Here is full documentation.
The code should run on the Arduino and be wired to the APM in the way the photo shows.
Here is the code:
Step 6: Setting Up the APM
First and most importantly, you should flash the APM with the "Rover" Firmware. Many APMs from eBay will come pre-flashed with the incorrect firmware, so be sure to do this step.
I will not go very in-depth into each of the APMs parameters because the APM Rover documentation is extremely extensive, and there are many complete tutorials on the web. Here is a link to the entire APM Rover documentation.
Some of the parameters to watch out for (be sure to rewrite the parameters after you change each one)
- SKID_STEER_OUT: Controls the different steering configurations: pivoting front wheels, or two independent back wheels.
- FS: The Fail-Safe settings need to be changed if you are using an Arduino to pretend to be the transmitter.
- RNGFND: All of the rangefinder functions need to to be adjusted if you are using an ultrasonic sensor.
Step 7: Testing the Car
Please use common sense when testing your car. The car can be a real danger to almost all living things. Before you drive this anywhere near other people, check your local laws. Never let this go on a street that has any traffic from cars or people.
If you want to see mine in action, here is the video:
We have a be nice policy.
Please be positive and constructive.