Freenove 4WD Smart Car Board for Raspberry Pi User manual

Welcome
Thank you for choosing Freenove products!
About Battery
First, read the document About_Battery.pdf in the unzipped folder.
If you did not download the zip file, please download it and unzip it via link below.
https://github.com/Freenove/Freenove_4WD_Smart_Car_Kit_for_Raspberry_Pi/archive/master.zip
Get Support and Offer Input
Freenove provides free and responsive product and technical support, including but not limited to:
Product quality issues
Product use and build issues
Questions regarding the technology employed in our products for learning and education
Your input and opinions are always welcome
We also encourage your ideas and suggestions for new products and product improvements
For any of the above, you may send us an email to:
support@freenove.com
Safety and Precautions
Please follow the following safety precautions when using or storing this product:
Keep this product out of the reach of children under 6 years old.
This product should be used only when there is adult supervision present as young children lack necessary
judgment regarding safety and the consequences of product misuse.
This product contains small parts and parts, which are sharp. This product contains electrically conductive
parts. Use caution with electrically conductive parts near or around power supplies, batteries and
powered (live) circuits.
When the product is turned ON, activated or tested, some parts will move or rotate. To avoid injuries to
hands and fingers, keep them away from any moving parts!
It is possible that an improperly connected or shorted circuit may cause overheating. Should this happen,
immediately disconnect the power supply or remove the batteries and do not touch anything until it
cools down! When everything is safe and cool, review the product tutorial to identify the cause.
Only operate the product in accordance with the instructions and guidelines of this tutorial, otherwise
parts may be damaged or you could be injured.
Store the product in a cool dry place and avoid exposing the product to direct sunlight.
After use, always turn the power OFF and remove or unplug the batteries before storing.

Need support? support.freenove.com
About Freenove
Freenove provides open source electronic products and services worldwide.
Freenove is committed to assist customers in their education of robotics, programming and electronic circuits
so that they may transform their creative ideas into prototypes and new and innovative products. To this end,
our services include but are not limited to:
Educational and Entertaining Project Kits for Robots, Smart Cars and Drones
Educational Kits to Learn Robotic Software Systems for Arduino, Raspberry Pi and micro: bit
Electronic Component Assortments, Electronic Modules and Specialized Tools
Product Development and Customization Services
You can find more about Freenove and get our latest news and updates through our website:
http://www.freenove.com
Copyright
All the files, materials and instructional guides provided are released under Creative Commons Attribution-
NonCommercial-ShareAlike 3.0 Unported License. A copy of this license can be found in the folder containing
the Tutorial and software files associated with this product.
This means you can use these resource in your own derived works, in part or completely, but NOT for the
intent or purpose of commercial use.
Freenove brand and logo are copyright of Freenove Creative Technology Co., Ltd. and cannot be used without
written permission.
Free your innovation
Raspberry Pi®is a trademark of Raspberry Pi Foundation (https://www.raspberrypi.org/).
○
R

Contents
Welcome................................................................................................................................................................................ 1
Contents.................................................................................................................................................................................1
List........................................................................................................................................................................................... 1
4WD Smart Car Board for Raspberry Pi .................................................................................................................. 1
Machinery Parts ........................................................................................................................................................... 2
Transmission Parts....................................................................................................................................................... 3
Acrylic Parts .................................................................................................................................................................. 3
Electronic Parts............................................................................................................................................................. 4
Tools............................................................................................................................................................................... 4
Self-prepared Parts.....................................................................................................................................................5
Preface ................................................................................................................................................................................... 6
Raspberry Pi Introduction ..........................................................................................................................................7
Chapter 0 Raspberry Pi Preparation...............................................................................................................................17
Install a System...........................................................................................................................................................17
Remote desktop & VNC ............................................................................................................................................24
Chapter 1 Software installation and Test (necessary)..................................................................................................39
Step 1 Obtain the Code and Set python3 as Default .........................................................................................39
Step 2 Configuration.................................................................................................................................................42
Step 3 Run the Libraries Installation Program........................................................................................................47
Chapter 2 Assemble Smart Car .......................................................................................................................................48
Chapter 3 Module test (necessary).................................................................................................................................62
Chapter 4 Light tracing Car..............................................................................................................................................84
Description..................................................................................................................................................................84
Run program ..............................................................................................................................................................84
Chapter 5 Ultrasonic Obstacle Avoidance Car .............................................................................................................86
Description..................................................................................................................................................................86
Run program ..............................................................................................................................................................86
Chapter 6 Infrared Line Tracking Car .............................................................................................................................88
Description..................................................................................................................................................................88
Run program ..............................................................................................................................................................88
Chapter 7 Smart video car ...............................................................................................................................................91
Server...........................................................................................................................................................................92
Client............................................................................................................................................................................98
Android and iOS app..............................................................................................................................................119
Free innovation ........................................................................................................................................................121
What's next?......................................................................................................................................................................128


Need support? support.freenove.com
2
List
www.freenove.com █
Machinery Parts
Note: You may receive M1.4*4 or M1.4*5. Can be used normally

Need support? support.freenove.com
3
List
█www.freenove.com
Transmission Parts
Servo package x2
Driven wheel x4
DC speed reduction motor x4
Motor bracket package x4
Acrylic Parts
For Pan Tilt

Need support? support.freenove.com
4
List
www.freenove.com █
Electronic Parts
Line tracking module x1
Camera x1
HC-SR04 Ultrasonic
Module x1
Connection board
Jumper Wire F/F(4) x1
XH-2.54-5Pin cable x1
Tools
Cross screwdriver (3mm) x1
Black tape x1
Cable Tidy x25cm

Need support? support.freenove.com
5
List
█www.freenove.com
Self-prepared Parts
Please refer to About_Battery.pdf in unzipped folder.
Raspberry Pi (Recommended model: Raspberry 4B / 3B+ / 3B) x1

Need support? support.freenove.com
6
Preface
www.freenove.com █
Preface
Welcome to use Freenove 4WD Smart Car Kit for Raspberry Pi. Following this tutorial, you can make a very
cool smart car with many functions.
This kit is based on Pi Raspberry, a popular control panel, so you can share and exchange your experience
and design ideas with many enthusiasts all over the world. The parts in this kit include all electronic
components, modules, and mechanical components required for making the smart car. And all of them are
packaged individually. There are detailed assembly and commissioning instructions in this book.
And if you encounter any problems, please feel free to contact us for fast and free technical support.
support@freenove.com
The contents in this book can help enthusiasts with little technical knowledge to make a smart car. If you are
very interested in Raspberry Pi, and want to learn how to program and build the circuit, please visit our
website www.freenove.com or contact us to buy the kits designed for beginners:
Freenove Basic\LCD1602\Super\Ultrasonic\RFID\Ultimate Starter Kit for Raspberry Pi

Need support? support.freenove.com
7
Preface
█www.freenove.com
Raspberry Pi Introduction
Raspberry Pi (called RPi, RPI, RasPi, the text these words will be used alternately later), a micro-computer with
size of a card, quickly swept the world since its debut. It is widely used in desktop workstation, media center,
smart home, robots, and even the servers, etc. It can do almost anything, which continues to attract fans to
explore it. Raspberry Pi used to be running with Linux system and along with the release of windows 10 IoT.
We can also run it with Windows. Raspberry Pi (with interfaces USB, network, HDMI, camera, audio, display
and GPIO), as a microcomputer, can be running in command line mode and desktop system mode.
Additionally, it is easy to operate just like Arduino, and you can even directly operate the GPIO of CPU.
So far, Raspberry Pi has developed to the fourth generation. Changes in versions are accompanied by increase
and upgrades in hardware. A type and B type, the first generation of products, have been stopped due to
various reasons. Other versions are popular and active and the most important is that they are consistent in
the order and number of pins, which makes the compatibility of peripheral devices greatly enhanced between
different versions.
Below are the Raspberry Pi pictures and model pictures supported by this product.
Practicality picture of Raspberry Pi 4 Model B:
Model diagram of Raspberry Pi 4 Model B:

Need support? support.freenove.com
8
Preface
www.freenove.com █
Practicality picture of Raspberry Pi 3 Model B+:
Model diagram of Raspberry Pi 3 Model B+:
Practicality picture of Raspberry Pi 3 Model B:
Model diagram of Raspberry Pi 3 Model B:

Need support? support.freenove.com
9
Preface
█www.freenove.com
Practicality picture of Raspberry Pi 2 Model B:
Model diagram of Raspberry Pi 2 Model B:
Practicality picture of Raspberry Pi 1 Model B+:
Model diagram of Raspberry Pi 1 Model B+:

Need support? support.freenove.com
10
Preface
www.freenove.com █
Practicality picture of Raspberry Pi 3 Model A+:
Model diagram of Raspberry Pi 3 Model A+:
Practicality picture of Raspberry Pi 1 Model A+:
Model diagram of Raspberry Pi 1 Model A+:

Need support? support.freenove.com
11
Preface
█www.freenove.com
Practicality picture of Raspberry Pi Zero W:
Model diagram of Raspberry Pi Zero W:
Practicality picture of Raspberry Pi Zero:
Model diagram of Raspberry Pi Zero:

Need support? support.freenove.com
12
Preface
www.freenove.com █
Hardware interface diagram of RPi 4B is shown below:
Hardware interface diagram of RPi 3B+/3B/2B/1B+ are shown below:
GPIO
Connector
Display
Connector
Power
Connector
HDMI
Connector
Camera
Connector
Ethernet
Connector
GPIO
Connector
Display
Connector
Power
Connector
MINI HDMI
Connector x2
Camera
Connector
Ethernet
Connector
USB
Connector x4
Audio
Connector
USB
Connector
Audio
Connector

Need support? support.freenove.com
13
Preface
█www.freenove.com
Hardware interface diagram of RPi 3A+/A+ is shown below:
Hardware interface diagram of RPi Zero/Zero W is shown below:
GPIO
Connector
Power
Connector
HDMI
Connector
Camera
Connector
USB
Connector
GPIO
Connector
Display
Connector
Power
Connector
HDMI
Connector
Camera
Connector
Audio
Connector
USB
Connector

Need support? support.freenove.com
14
Preface
www.freenove.com █
GPIO
GPIO: General purpose input/output. We will introduce the specific feature of the pins on the Raspberry Pi
and what you can do with them. You can use them for all sorts of purposes. Most of them can be used as
either inputs or outputs, depending on your program.
When programming the GPIO pins there are 3 different ways to refer to them: GPIO numbering, physical
numbering, WiringPi GPIO Numbering.
BCM GPIO Numbering
Raspberry Pi CPU use BCM2835/BCM2836/BCM2837of Broadcom. GPIO pin number is set by chip
manufacturer. These are the GPIO pins as that computer recognizes. The numbers are unordered and don't
make any sense to humans. You will need a printed reference or a reference board that fits over the pins.
Each pin is defined as below:
For more details about pin definition of GPIO, please refer to http://pinout.xyz/

Need support? support.freenove.com
15
Preface
█www.freenove.com
PHYSICAL Numbering
Another way to refer to the pins is by simply counting across and down from pin 1 at the top left (nearest to
the SD card). This is 'physical numbering', as shown below:
WiringPi GPIO Numbering
Different from the previous mentioned two kinds of GPIO serial numbers, RPi GPIO serial number of the
WiringPi was renumbered. Here we have three kinds of GPIO number mode: based on the number of BCM
chip, based on the physical sequence number and based on wiringPi. The correspondence between these
three GPIO numbers is shown below:
(For more details, please refer to https://projects.drogon.net/raspberry-pi/wiringpi/pins/ )
Table of contents
Other Freenove Microcontroller manuals