SunFounder Smart Video Car Kit User manual

Preface
About SunFounder
SunFounder is a technology company focused on Raspberry Pi and Arduino open
source community development. Committed to the promotion of open source
culture, we strive to bring the fun of electronics making to people all around the
world and enable everyone to be a maker. Our products include learning kits,
development boards, robots, sensor modules and development tools. In addition
to high quality products, SunFounder also offers video tutorials to help you make
your own project. If you have interest in open source or making something cool,
welcome to join us!
About This Kit
The kit is suitable for the Raspberry Pi model B+ and Raspberry Pi 2 model B.
In this book, we will show you how to build the smart car via description,
illustrations of physical components, and schematic diagrams of circuits, in both
hardware and software respects. You may visit our website www.sunfounder.com
to download the user manual and also the related code by clicking LEARN -> Get
Tutorials and watch the videos by clicking VIDEO, or clone the code on our page
of github.com at
https://github.com/sunfounder/Sunfounder_Smart_Video_Car_Kit_for_Raspberr
yPi
If you have any questions, please send an email to support@sunfounder.com. You
can also leave a message and share your projects on our Forum.

Contents
Introduction..........................................................................................................................................1
Components ........................................................................................................................................2
i. Acrylic Plates .......................................................................................................................2
i. Mechanical Fasteners .......................................................................................................3
ii. Drive Parts ............................................................................................................................4
iii. Electrical Components .....................................................................................................5
iv. Self-provided Parts ............................................................................................................8
Assembly ...............................................................................................................................................9
i. Mechanical Assembly .......................................................................................................9
ii. Electrical Module Assembly..........................................................................................30
iii. Circuit Connecting...........................................................................................................31
Electrical Components Basics .......................................................................................................41
i. Raspberry Pi.......................................................................................................................41
ii. Step-down DC-DC Converter Module ......................................................................42
iii. Servo....................................................................................................................................43
iv. DC Motor Driver ...............................................................................................................44
v. Servo Controller ...............................................................................................................45
vi. USB Wi-Fi Adaptor...........................................................................................................45
Software Related...............................................................................................................................46
i. Download and Install Raspbian on a TF Card..........................................................46
ii. Get Source Code ..............................................................................................................46
iii. Basic Software Environment.........................................................................................48
iv. Calibration..........................................................................................................................51
v. Program Analysis and Explanation.............................................................................59
Summary.............................................................................................................................................64

1
Introduction
The SunFounder Smart Video Car Kit for Raspberry Pi is composed of Raspberry Pi,
step-down DC-DC converter module, USB camera, DC motor driver, and
PCA9685-based servo controller. From the perspective of software, the smart car is
of client/server (C/S) structure. The TCP server program is run on Raspberry Pi for
direct control of the car. And the video data are acquired and delivered via the open
source software MJPG-streamer in a real-time manner. The TCP client program is
run on PC to send the control command. Both the client and server programs are
developed in Python language. The smart car is developed based on the
open-source hardware Raspberry Pi and integrates the knowledge of mechanics,
electronics, and computer, thus having profound educational significance.

2
Components
i. Acrylic Plates

3
i. Mechanical Fasteners
Parts
Name
Quantity
M1.2*5 self-tapping screw
8
M2*10 screw
6
M2.5*6 screw
16
M3*10 countersunk screw
2
M3*8 screw
8
M3*12 screw
6
M3*30 screw
4
M4*25 screw
2
M2.5*8 copper pillar
16
M3*24 copper pillar
8
M2 nut
6
M2.5 nut
16
M3 nut
20
M4 self-locking nut
2
F694ZZ flange bearing
2

4
ii. Drive Parts
Parts
Name
Quantity
Tower Pro
Micro Servo
SG90
3
Gear reducer
2
Driven wheel
2
Active wheel
2

5
iii. Electrical Components
Parts
Name
Quantity
Raspberry Pi
Model B+
1
16-Channel
12-bit
PWM driver
(servo
controller)
1
L298N DC
motor driver
1

6
Step-down
DC-DC
converter
module
1
USB Wi-Fi
adapter
1
USB camera
1
18650*2
Battery holder
1
Ribbon
1

7
USB cable
1
Cross socket
wrench
1
Cross
screwdriver
1
20cm jumper
wire (F to F)
4
10cm jumper
wire (F to F)
5
10cm jumper
wire (M to F)
2
20cm jumper
wire (M to M)
2

8
iv. Self-provided Parts
The following parts are not included in the set.
Parts
Name
Qty.Needed
18650 3.7V
rechargeable
Li-ion battery
2
TF Card
1

9
Assembly
i. Mechanical Assembly
1. Car Assembly
Front Wheels
a) Fasten the F694ZZ flange bearing, driven wheel and following acrylic plates
with an M4*25 screw and an M4 self-locking nut in the way as shown below.
b) When completed, the assembly
should look like the figure below.
c) Bear in mind that DO NOT over
tighten the nut or else the wheel
cannot turn flexibly. Neither too
loose, in case the gap between the
parts is too large.

10
a) Fasten the F694ZZ flange bearing, driven wheel and following acrylic plates
with an M4*25 screw and an M4 self-locking nut in the way shown as below.
b) When completed, the assembly
should look like the figure below.
c) Bear in mind that DO NOT over
tighten the nut or else the wheel
cannot turn flexibly. Neither too
loose, in case the gap between the
parts is too large.

11
Note: The acrylic plates next to the bearing in the two wheels are of opposite faces,
as shown in the following figure.
Back Half Chassis + Rear Wheels
a) Assemble the following two acrylic
plates
b) When completed, the assembly
should look like the figure below.
c) Assemble the gear reducer, the active wheel and following acrylic plates
with two M3*30 screws and M3 nuts.

12
d) When completed, the assembly should look like the figure below.
a) Assemble the following two acrylic
plates
b) When completed, the assembly
should look like the figure below.
c) Assemble the gear reducer, the active wheel and the previously assembled
part with two M3*30 screws and M3 nuts.

13
d) When completed, the assembly should look like the figure below.
Back Half Chassis + Copper Standoffs
a) Assemble 4 M3*24 copper standoffs
and 4 M3 nuts into the acrylic plate
part as shown below.
b) When completed, the assembly
should look like the figure below.

14
Servo Adjustment
a) The rocker arm can be placed onto and removed from the servo freely as
shown in the following figure.
b) Turn the rocker arm within an angle of about 180 degrees.
c) The rocker arm is placed in a random way at the beginning. You need to
adjust it to restrict its turning in an almost equal angle towards right and
left.

15
Remove the rocker arm and install it again in another angle. Turn right
and left to see whether the condition of the angle is met.
Repeat the step until the condition is met. It matters to the subsequent
installation.
d) After the adjustment, turn the rocker arm to the middle and remove it.
Note: Make sure the step is carried out for all servos and that the axis of the servos
is not moved accidentally in the subsequent installation. If the axes are moved,
adjust them again before the installation.

16
Steering Linkage + Servo Rocker Arm
a) Connect the following acrylic plate to the second hole of the rocker arm (see
the figure below) with an M2*8 self-tapping screw.
The M2*8 self-tapping screw is contained in the package of the servo; it
is one of the two longest screws.
Also the rocker arm is packaged together with the servo.
b) When completed, the assembly should look like the figure below.
Be careful not to tighten the screw too much. Keep a gap of about 1mm
between the two.

17
Steering Servo + Upper Plate
a) Connect the servo to the acrylic plate below with two M2*10 screws and M2
nuts.
Pay attention to the face of the plate. Refer to the small hole in the
plate as pointed by the arrow in the following figure.
b) When completed, the assembly should look like the figure below.
Note: The servo should be placed with its output shaft toward the front of the
plate (see the following figure).

18
Steering Servo + Steering Linkage
a) Connect the following parts with an M2*4 screw.
The M2*4 screw is contained in the package of the servo; it is the shortest
of the screws in the package.
b) When completed, the assembly should look like the figure below.
Pay attention to the orientation during the assembly. If you find any error in
the assembly, do not try to turn the axis of the servo; instead, you should
disassemble it and then assemble the parts again.
Table of contents
Other SunFounder Motorized Toy Car manuals
Popular Motorized Toy Car manuals by other brands

Kool Karz Playground
Kool Karz Playground Audi R8 Spyder Installation and user manual

Helion
Helion Criterion HLNA0301 owner's manual

DHK Hobby
DHK Hobby OPTIMUS 8383 User instruction manual

1RC Racing
1RC Racing 18th Midget 2.0 Quick Start Guide/Instruction Manual

Jamara
Jamara Mercedes-Benz Arocs Metal Meiller instructions

Xray
Xray XB8E 2017 instruction manual