Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES ここでご購入を!

I.Objective
II.Parts and Devices
III.Hardware Installation
IV.Circuit Connection
V.Software Installation

Welcome to the first lesson of OSOYOO Robot Car for Raspberry Pi!

In this lesson, we will introduct how to install the framework of the OSOYOO Robot Car for Raspberry Pi firstly, then we will simply tell you how to install Raspberry Pi OS for the Raspberry pi and how to use console to control raspberry pi. We’ll use OSOYOO Robot Car for Raspberry Pi to do some simple movements.

If you have passed the test movement of this lesson, it means Raspberry pi, motors, battery, model X board, OSOYOO PWM HAT and wire connections between these parts are all functioning well, and you can move on other sample lessons

All lessons are based on the frame work of this lesson. Please follow this lesson carefully.


No. Picture Device Qty. Accessories Link
1 Raspberry pi board 2/3/4
(not in package)
1 M2.5 Plastic Screw x4
M2.5 Plastic Nut x2
M2.5 Plastic Pillar x4
M2.5*12 plastic pillars x2
Click here to buy
2 Pie car chassis 1 M3*45 pillars x 4
M3 *10 hex screws x8
M3 washer x 8
Click here to buy
3 Gear motor 2 Metal Motor Holders with screws x2 Click here to buy
4 Wheel 1 screws for wheels x2 Click here to buy
5 Universal Wheel 1 M3 *10 hex screws x2
M3 nuts x2
Click here to buy
6 OSOYOO PWM HAT v1.0 1 M2.5*12 plastic pillars x2 Click here to buy
7 OSOYOO model X motor driver module 1 M2.5 Plastic Screw x 4
M2.5 Plastic Nut x4
M2.5 Plastic Pillar x4
Click here to buy
8 Voltage meter 1 M2.5 Plastic Screw x 2
M2.5 Plastic Nut x2
M2.5 Plastic Pillar x 2
Click here to buy
9 18650 battery case 1 M3*10 screw x4
M3 nuts x4
Click here to buy
10 18650 battery charger 1 Click here to buy
11 2000mAh 18650 rechageable battery 1 Click here to buy
12 Metal Motor Holders with screws 2 Click here to buy
13 3pin female to 3pin female jumper wire 1 Click here to buy
14 OSOYOO 2pin PnP cable 20cm 1 Click here to buy
15 6Pin female to female
jumper wire
1 Click here to buy
16 Philips screwdriver 1 Click here to buy
17 Hex Screwdriver 1 Click here to buy



1) Remove the protective film on upper and lower car chassis (Each car chassis has one protective film).

2) Install 2 motors with Metal Motor Holders as follows.

3) Install 2 motors on lower car chassis with screw M3*10. (Screws in metal motor holder package. Please add M3 washers between screws and chassis if the screws come off easily.)

4) Install OSOYOO MODEL X motor driver module to car lower chassis with 4pcs M2.5 plastic screws, plastic pillars and plastic nuts. (Please make sure you install the OSOYOO MODEL X motor driver module in correct direction.)

5) Install voltage meter on lower car chassis with 2pcs M2.5 plastic screws, plastic pillars and plastic nuts.

6) Install universal wheel under the lower car chassis with 2pcs M3x10 hex screws and M3 nuts.

7) Install 2 wheels onto the motors (If you find the wheels install too tightly to move, you can remove the screws on wheels)

8) Install 4pcs copper pillars on low car chassis with 4pcs M3x10 hex screws.(Please add M3 washes between screws and chassis if the screws come off easily.)

9) Install 18650 battery box on upper car chassis with 4pcs M3x10 screws and M3 nuts.

10) Fix 2pcs M2.5 plastic pillars on upper chassis as follow:

11) Use M2.5 plastic pillar cross Raspberry Pi and M2.5*12 plastic pillar from bottom to top as follow

12) Install 2pcs M2.5 plastic screws under the chassis and 2pcs M2.5 plastic screws on Raspberry Pi

13) Insert OSOYOO PWM Hat on Raspberry Pi as follow:

Step 1: CONNECT left motor to K1 or K2 socket of OSOYOO Model X motor driver module , right motor to K3 or K4 socket as per following graph:

Step 2: Connect Voltage Meter to OSOYOO MODEL X motor driver module with 3pin female to female jumper wires as below connection diagram:

Step 3: Connect OSOYOO MODEL X motor driver module to OSOYOO PWM Hat V1.0 with 6Pin female to female jumper wire, also connect 2pin 20cm cable as following graph:

Step 4: Connect 18650 battery box to OSOYOO PWM Hat V1.0 as below connection diagram:

Step 5: Connect upper chassis to lower chassis with 4pcs M3*10 hex screws and 4pcs M3 washers

Step 6: Please install your 18650 batteries in battery box for 18650 as per following instruction (Note:Check the box instruction and make sure polar direction is correct, otherwise it can destroy your device and cause fire hazard.)

Now hardware installation is almost down.


Software Preparation:

Raspberry pi OS
(Raspberry Pi Legacy(Bullseye))
Download Raspberry pi OS from:
https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-legacy
Imager utility:
Win32DiskImager utility
Download for free
Format Tool:
SDformatter (Optional)
Download for free
SSH Tool:
PuTTY (for Windows users)
Download for free

Operation System :   This car supports Raspberry Pi Latest  Bullseye OS. So far we can’t support latest BookWorm Raspbian distro. So please do NOT install Bookworm OS.

Here are the steps to install the Raspberry Pi Bullseye OS:
Step 1: Download  Raspberry Pi Bullseye Operation System(OS) and burn it onto SD card(skip this step if your SD card has pre-installed Rpi Buster OS Image).

You can select the of Raspberry Pi Legacy OS on the official website: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-legacy. Write the image via Win32DiskImager utility into your microSD/TF card(minimum 16G) via SD card reader.

Prepare a new Micro SD card (minimum 16G) and insert it in USB micro SD card reader,  and connect USB micro SD card reader with your PC.

Step 2: Connect Wifi

1. Connect Raspberry Pi to your HDMI monitor or TV. Put a keyboard and mouse into Raspberry Pi USB ports. Insert SD card(from Step1) into the slot on your Raspberry Pi (if you have intalled your raspberry pi robot car, please replace the raspberry Pi in the following picture with your robot car).

2. Please click the Lan icon at the right-upper conner, and select your WIFI SSID, and enter the password of your wifi to connect wifi hotspot. Then you can see the console full screen.

3. If you move over the Lan icon, and get the notice as following:

4. Please click configure the WIFI localisation as following:

Step 3. Find out the IP address of the RPi.
Method A: Connect your Pi to monitor and mouse, click LAN or WIFI icon to get the IP address as following photo

Method B: Click the icon of Terminal on the screen,enter the following command in terminal window to get your IP address :

hostname -I

Step 4:  Enable SSH 

press Ctrl-T and open command terminal. Then type :
sudo raspi-config

You will go to configuration menu, select Interface Options ->SSH -> Yes ->OK ->Finish

Step 5: Use ssh tool to control Raspberry Pi remotely

Note:
1) To learn more about how to use ssh tool to control Raspberry Pi remotely, Please visit the link: https://osoyoo.com/2017/06/20/raspberry-pi-3-basic-tutorial/#7

2) In our sample lessons, we use Windows PC as the remote console device and PuTTY as the ssh tool

1. Please install the Raspberry Pi with SD card (from step 4) on the robot car (Attention please: you need to power off the rapsberry pi firstly), and then power on robot car.

2. Download PuTTY from: https://www.chiark.greenend.org.uk/~sgtatham/putty/ and install this exe. in your Windows PC

3. Open PuTTY and click Session on the left tree-alike structure (generally it’s collapsed upon PuTTY startup):

4. Enter the IP address you got into the textbox under Host Name (or IP address) and 22 under Port (by default it is 22) ,then click open.

5. Note that when you first log in to the Raspberry Pi with the IP address, you’ll be prompted with a security reminder. Just click Yes. When the PuTTY window prompts login as: type in the user name: pi, and password: raspberry (the default one, if you haven’t changed it).
Note: when you’re typing the password in, the window shows nothing just null, but you’re in fact is typing things in. So just focus on typing it right and press Enter. After you log in the RPi successfully, the window will display as follows:

Use ssh tool to control Raspberry Pi remotely on other OS PC, Please visit the link: https://osoyoo.com/2017/06/20/raspberry-pi-3-basic-tutorial/#7

Step 6: Enable I2C

If you have not enable I2C, please run following command to enable I2C.

sudo raspi-config

Then select Interfacing Options->I2C->Yes->Ok->Finish

Step 7: Install GPIO Library by running the following three commands:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install rpi.gpio


Step 8: Install pca9685 and servokit Library by running the following commands (ATTENTION: please select a correct command according to your Pi board):
If you are using Python 2 in Raspberry Pi 3, type:

sudo pip install adafruit-circuitpython-pca9685
sudo pip install adafruit-circuitpython-servokit

If you are using Python 3 in Raspberry Pi 4/3A+, type:

sudo pip3 install adafruit-circuitpython-pca9685
sudo pip3 install adafruit-circuitpython-servokit

Step 9: Type following command to download the sample code.

wget http://osoyoo.com/driver/picar/picar-basic.py

Step 10: Put the robot car on the ground and then run the basic movement python program by typing following command in terminal (ATTENTION: please select a correct command according to your Pi board):

If you are using Python 2 in Raspberry Pi 3/3B+ type:

python picar-basic.py

If you are using Python 3 in Raspberry Pi 4/3A+ type:

python3 picar-basic.py


After above python is running, your robot car will move forward for 1 seconds and then move backward for 1 seconds, and turn left for 1 seconds and turn right for 1 seconds then stop. (If the robot car don’t move as above, please check your connections firstly)

We have write full comments in the sample python code http://osoyoo.com/driver/picar/picar-basic.py . If you have some basic python knowledge, you can easily understand how to customize the code for your own application.