DIY RaspiCar is an autonomous car built on Raspberry Pi, inexpensive parts and scraps. The purpose of this project is to build a car driven by algorithm without human intervention.
This project is structured in 4 layers as shown in below diagram
1st layer - algorithm that interprets data from sensors, camera, and determine the car drive path.
2nd layer - basic car function modules layer, including maneuver skills and basic car functions. For examples, the maneuver skills will drive car away from objects as well as drive around obstacles. the basic functions are tasked for moving the car forward, backward, turning, etc.
3rd layer - is libraries and operating systems interfacing hardware, such as Java (JDK), pi4j, i2ctools, wiringpi, Raspbian.
4th layer - the hardware layer. those physical stuff, such as wheels, motors, servos, sensor, chips, board.
Now, with these layers clearly defined, from top to bottom. We now proceed to how to implement this project. For implementation, we do the reverse order. we start with the bottom layer then do the layer above and so on.
For phase I - includes the third and fourth layers plus some second layers.
Hardware used to building this car are listed in the hardware section.
Libraries used for this porject are below. I include installation steps in case you are interested in building one as well.
i2c-tools - installation and configurations
sudo apt-get install -y i2c-tools
#enable i2c in configuration
Sudo raspi-config
# go to interface options and nable I2C
#remember to reboot
wiringpi - this library is preinstalled by default in the Raspbian OS image.
Java - installation and configurations
#unzip jdk tar onto usr/lib directory
sudo tar zxvf jdk-8-linux-arm-vfp-hflt.tar.gz -C /usr/lib
# update Raspbian so that OS know which java version to invoke
sudo update-alternatives –install /usr/bin/javac /usr/lib/jdk1.8{version}/bin/javac 1
sudo update-alternatives –install /usr/bin/java /usr/lib/jdk1.8{version}/bin/java 1
pi4j - upload these 4 pi4j jar files on to Raspberry Pi.
pi4j-core.jar
pi4j-device.jar
pi4j-gpio-extension.jar
log4j-1.2.17.jar
slf4j-api-1.7.25.jar
slf4j-log4j12-1.7.25.jar
Algorithm
- Applicaiton driving the car in these field tests is written in Java Language. It is multi-threaded, modular and modeled after mediator design pattern. The main strategy of the application is to let data from sensors and camera to drive the car.
At the end of this phase, the car will have basic modules allowing the car to move forward, backward, turn, and detect objects in proximity and drive away from objects.
These are videos captured during field tests.
Field Test 1 - orientation dayField Test 2 - Explore surrounding.This car runs for 5 minutes without hitting any object.
Field Test 3 - Navigate a maze.Field Test 3 - Navigate surrounding. A few changes have been made to allow the car drives itself for longer time and drive thru a maze.
- DIY Bumper - it has built-in a touch sensor and is made with Lego blocks, wood, telephone wires.
- Add DC-DC bulk step-down converter - this resolved the servo's jittery issue
- Fine tuned navigation module that tracks angle as it is rotates.
Now the car is capable of driving itself, detecting, as well as avoiding objects. Additionally, it does more than what I originally planned. It even can navigate a maze.
Finally, I feel like I am getting onto the fun stuff as I will focus more on the algorithm going forward.
Below is a brief description for phase II.
Phase II – enhancement with vision – With vision and ultrasonic sensor, this phase will enhance its ability to detect more objects as well as determine drive path. it may also will follow object ( hope I can accomplish this feature).
Phase III - sleeping on this ..
As a final note, I will update this project whenever time permits. So visit this car project occasionally and drop me a note here.......
Comments