Firmware for rc controlled raspberry-pi car.
- Light controller for controlling lights of the car
- Move controller for controlling movement of the car
- Extension manager for adding sensors
- Different modes:
- real time mode - the car is controlled by remote controller in real time
- programmable mode - the user predefines set of instruction and send it to the car
- Bluetooth communication - remote controller will communicate with the firmware through bluetooth module. It can be replaced with wifi communication
-
Clone the repo to your raspberry
-
Bluetooth module installation (Raspbian). This step will remove bluetooth console option to free the bluetooth for the carty controller.
- Backup /boot/cmdline.txt -
sudo cp /boot/cmdline.txt /boot/cmdline.txt.backup
- Go and edit file /boot/cmdline.txt -
remove "console=ttyAMA0, 115200 kgboc=ttyAMA0, 115200"
- Backup /etc/inittab -
sudo cp /etc/inittab /etc/inittab.backup
- Go and edit file /etc/inittab - comment the line below the line "#Spawn a getty on Raspberry Pi serial line"
- Reboot the Raspberry Pi
- Backup /boot/cmdline.txt -
-
Controller
- Download Arduino Bluetooth RC Car (Android). You can use other software for communication but most probably, it will require code modifications)
- Start the android application and go to gear button t connect to raspberry-pi If you have any problems see troubleshoot section)
-
Motors
-
You will need breadboard and motor driver (In this project I use L293DNE search in google)
-
Cable the motor driver as described below: (start from left up to down of motor driver if you watch it with hole on top)
Motor driver Raspberry Left Right Left Right PWM VCC pin 26 pin 2 LEFT RIGHT pin 24 pin 11 MOTOR MOTOR GND GND pin 25 pin 25 GND GND pin 25 pin 25 MOTOR MOTOR RIGHT LEFT pin 22 pin 13 VCC PWM pin 2 pin 15
-
-
Install raspberry-pi
gpio
libsudo pip install rpi.gpio
-
You need pyserial for python3
git clone -b python3 https://github.com/makerbot/pyserial.git
cd pyserial
python3.4 setup.py install
-
Install boot script
edit /etc/rc.local
/path/to/carty/run.sh
reboot
-
PWM lib for raspberry PI
git clone https://github.com/metachris/RPIO.git)
cd RPIO
sudo python3.4 setup.py install
If you have problem with bluetooth communication:
- Install minicom tool
sudo apt-get install minicom
- Try to connect with another bluetooth device to Raspberry Pi.
minicom -b 9600 -o -D /dev/ttyAMA0
- Try to send some messages between the raspberry-pi and the other device.
- If you can't rx/tx messages from/to one of the sides check the jumpers on the serial bluetooth.
Bluetooth | Raspberry |
---|---|
VCC | 5V power supply |
GND | Ground (0) |
TDX | RXD |
RDX | TDX |