The advantage of Arduino Robot Car kit is that Arduino has no Operation System and programming is simple and easily. For some basic robot application which needs only simply logic to handle sensor data and control actuators, Arduino-controlled robot car is a good choice.

However, for some more complex robot applications which need more complex functions such as computer vision(CV), Internet of Things (IoT), web server control etc, Arduino board’s ability is too weak to reach the target.

In order to help intermediate students to complete some complex Robotic project. We developed a more advanced Raspberry Pi Robot Car learning Kit.

Why Raspberry Pi is so important to the Robot Car DIY learning kit?

Because Raspberry Pi is a real computer which has Linux OS(Raspbian) and therefore much powerful than Arduino Board which is simply a micro-controller(MCU).

Unlike Arduino board, Raspberry Pi programming environment is much more complex and flexible. It supports almost all programming language as long as the language is supported by Rasbian Open Source community. The most commonly used languages for access Raspberry Pi GPIO pins are C and Python. If you want to learn some Raspberry Pi hardware GPIO programming, you can read our tutorial in following links:

Since Raspberry Pi programming is different from Arduino, we suggest user should get some basic Linux knowledge before practice Raspberry Pi Robot project.

If you want to learn Linux Robot by doing, you can buy this kit as learning kit. We provide some basic lessons in the kit to show you how to set up Rasbian Linux environment, how to use Linux shell to control car movement and how to use web browser to monitor and control car movement through the camera.

These basic projects in our tutorial have step by step instruction with sample code, circuit graph and installation video.These lessons all have been tested, so if you strictly follow our instruction, they will work without any problem. We also write detailed comments in our python sample code which can help you to understand the code and customize for your own application. However, you must have some linux and python background knowledge otherwise please do not change the code.

We also provide an optional Open-CV sample project for use to practice Robotic Computer Vision procedure. However, as OPENCV and machine learning open source community is evolving everyday, we can not guarantee that the opencv project will work properly. You might do your due diligence to follow up the opencv community’s updates and make your project work.

If you have any interesting application to use our Robot kit, you are more than welcome to share your excellent ideas in our comments section.

]]>Raspberry Pi Robot Car DIY Learning Kit Lesson 1: Basic Framework Installationhttp://osoyoo.com/2018/05/15/lesson-1rpi-robot-car-test/
Tue, 15 May 2018 10:00:00 +0000http://osoyoo.com/?p=12817 Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Objective In this lesson, we will install the most important framework in the smart car and make car to do ...Read the Rest]]>

Authorized Online Retailers

>

Buy from US

Buy from UK

Buy from DE

Buy from IT

Buy from FR

Buy from ES

Objective

In this lesson, we will install the most important framework in the smart car and make car to do some simple movements as per our python sample code. If you have passed the test movement of this lesson, that means Arduino, voltage meter,motor drive module(Model-PI), motors, batteries，chassis and wire connections between these parts are all functioning well.As your experiments in future lessons are all based on frame work of Lesson One, it is very important to test the installation and sample code in this Lesson properly.

Click on the wireless icon top right on desktop, should give a list of access points, select your wifi ssid and connect it. Once your Pi is connect to Wifi, you can hover your mouse to the wifi icon to see the your IP address.

Or your can type sudo ifconfig wlan0 command in terminal. Your local ip address will show in wlan0 block(right side of the word inet addr:). It will look like 192.168……

Please remember above IP address, it will be used in our next steps.

Important Note:As the raspberry pi robot car image was written into SD Card, you just need to follow the step 1 to connect wifi and skip Step 2 to Step 5, directly run the Testing Python code.

Step 2: Open SSH connection

SSH enable user to type shell command remotely from internet so that we can control the car through wifi.In order to enable SSH function, we need type following command from terminal:

sudo raspi-config

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

Step 3:Use SSH to connect Raspberry Pi terminal remotely

In order to make the car moving freely, we need disconnect Raspberry Pi from monitor, keyboard/mouse and use SSH to send command to Raspberry Pi terminal remotely.

If you are using Windows to send ssh command. you need download a free software called PuTTy to connect the Raspberry Pi local IP(you got from STEP 1).

Hardware Installation

If you don’t install 5 tracking sensor modules in lesson1, please install and connect these modules as following pictures. If you have already installed and connected these, please skip this step.

Software Installation

Note:
1. if you use our image as OS system as lesson1, please skip Software Installation and go to Step2 to adjust the sensitivity of tracking sensor module or the step “test tracking line”
2. Please keep the raspberry Pi on power when using SSH to send command to Raspberry Pi terminal remotely.

There are 5 black/white tracking sensors in the forehead of the car. Each sensor has two LED lights . The red LED indicates power. The green LED indicates black/white. When black is detected, Green LED will turn off and a “1” will be sent to Raspberry Pi GPIO pin, otherwise LED will ON and a “0” will be sent.
* To make sensors working properly, you need use a screw driver to adjust the sensitivity screw on each sensor and make sure Green LED will ON when it is over White and Off when it is over Black.

If you want to learn more about adjust tracking module, please follow the next vedio:

Following python code and experiment will tell you if the sensors are installed correctly.
First, put a 2 cm black track on white ground, then put your car over the track and turn on battery.
Next, use SSH to connect your Raspberry Pi remotely from your PC(use Putty if you are using Windows), and type following terminal command:cd ~/osoyoo-robot/lfpython test.py

When your put the first sensor(from right) on the black track, the green LED will turn off and your will see Putty terminal window show 00001 as following:

This means Raspberry Pi detected WHITE(0) from 4 sensors in the left and Black(1) from the right edge sensor. You can change the position of the black track from right to left sensors one by one and make the result change from 00001 to 00010,00100,01000,10000.If your result is not showed as above, you might need to double check if the sensor sensitivity and connection to the Pi is correct.

Testing line tracking

First, make a black track on white ground. The track can be round or curve , but the turning angle of each curve should not be too sharp. We suggest user use 2cm width black tape sticking on white ceramic tile and make a nice track.

Next put your car over the track and turn on the power switch on battery box.

Authorized Online Retailers

Objective

In this lesson, we will learn how to let the robot car has vision to see front environment and how to control the robot car through web browser or mobile APP.

To complete this task, we need install a web server software called “mjpg-streamer” in Raspberry Pi, this software will catch video from Robot Car camera and send the video to a web page.

We also need to install another web server software called “WebIOPi” in Raspberry Pi. This software will allow user to use browser to remotely control Raspberry Pi GPIO input/output and therefore control the movement of our robot motor.

You need verify the installation by typing following commandwebiopi -h

If WebIOPi is installed successfully, you will see following message in terminal, otherwise you might need redo the download and installation.

Step 4: Run webiopi by typing following command:(skip this step if your micro SD card has pre-installed Osoyoo Robot Image)

sudo webiopi -d -c /etc/webiopi/config

Use a browser in another computer (your computer/PAD/Phone in same LAN of your Pi) to visit your Pi’s IP address with port “8000” ( i.e http://192.168.0.115:8000, please replace 192.168.0.115 with your Pi’s local IP address), your browser will show WebIOPi login page. You need use default WebIOPi user name “webiopi” and default password “raspberry” to login to the server. Once you are logged into WebIOPi page, you will see WebIOPI Main Menu as following. If you can not see this page , you need to reinstall the WebIOPI software.

Your raspberry Pi IP address is in the right side of the word inet addr:

Following Step 5 to 7 is for mjpg-streamer server Installation

Step 5: If you are using CSI camera , please take following action as per step A and B. (If you are using USB camera which comes with the car, please skip this step)(skip this step if your micro SD card has pre-installed Osoyoo Robot Image)

You should see following result in your terminal, “/dev/video0” is the camera installed in Pi

At last, Run mjpg-streamer Server by typing following command in terminal:cd ~/osoyoo-robot/cam-robot/mjpg-streamer
sudo ./start.sh

Now use browser in another computer to access your Raspberry Pi IP address with port 8899 (i.e, if your Pi IP address is 192.168.0.115, visit http://192.168.0.115:8899 in your browser), you will see following image. Click Stream button in left menu, you will see the real time video captched by the camera in your Raspberry Pi

You can use Ctrl C command in terminal to end the mjpg-streamer server

Step 8: To combine webiopi and mjpg-streamer into same webpage which allows we “see” video from camera and control Robot Car with brower, we need change some default setting of WebIOPi and MJPG-streamer. To do so, we need to edit config file by typing following command and modify this file as Modification A, Modification B, Modification C:(skip this step if your micro SD card has pre-installed Osoyoo Robot Image)

sudo nano /etc/webiopi/config

Modification A: replace webiopi default script python file which allow us to send control signal to Pi from Browser, please add following pink line into “/etc/webiopi/config” file

Now you can put your car on the ground and turn on the power-switch in battery box. We need to use SSH to control the car. So you must enable SSH with raspi-config command before testing. If you are using windows, please use download Putty to ssh your Pi, if you are using MacBook, please directly use ssh command in terminal.

Now you can use your browse to acess Raspberry IP with port 8000(i.e, if your Pi IP address is 192.168.0.115, please visit http://192.168.0.115:8000, you will see following picture in your browser, click arrow buttons, you can make car moving to your desired directions.

Android App

You can also use our free Android App instead of browser to control the car. Download the app from http://osoyoo.com/driver/osoyoo-robot.apk
Run the App, click set up and enter config page set the fields as following: