Smart Car DIY Lesson 1: Using Infrared Receiver to control car

Objection

SMARTCAR

In this tutorial, we will use Osoyoo Smart DIY kit to make a simple remote controlled smart car. Once the car installation is completed, we will use a Infrared Remote to control the car movements including go forward, go back, left turn and right turn

Parts and Devices

建议实际出货产品电机需要预焊导线,电池盒预焊DC头,方便不懂电焊的用户使用

Device Name
picture
qty
Arduino UNO
补部件图片100 x 100
1
IR receiver(VS1838)
补部件图片100 x 100
1
IR controller
补部件图片100 X 100
1
Motor with wires
补部件图片100 x 100
4
L298N MOTOR driver module
补部件图片100 X 100
1
power switch
补部件图片100 X 100
1
Box for 18650 3.7V battery+
DC power connector
补部件图片100 X 100
1
voltage meter
补部件图片100 X 100
1
Jumper wires(male-male,male-female,female-female)
补部件图片100 X 100
a bunch

Installation

solder wires on motors. 建议电机预焊导线,导线颜色固定位置,面对转轴 红左白右,方便编写教程和说明书

4

以下部分原图片和说明不太清楚,建议重新做详细安装教程,视频,动画

小车底盘采用亚克力材质,分上下两块

1

电机安装在下面一块亚克力板上,每片电机有两个固定片,将电机夹在两片之间,再用M3*30螺丝和螺帽固定,再把4个码盘套在电机轴上;同时用4颗M2*10螺丝加螺帽以及塑料垫片将电机驱动模块L298N固定在中间的螺丝孔上

5

电机与电机驱动模块接线如图所示

6

3.2 安装电源开关

用两颗M2*10螺丝和螺帽将电池盒固定在较短的一块亚克力板上

9

把电源开关扣进亚克力底盘上面

10

将电池盒的红色线用电烙铁焊接到电源开关一个脚上,开关另一个脚用另外一段导线一端焊接

12

3.3 安装控制板

用4颗M2*10螺丝配螺帽及塑料垫固定Arduino UNO板

13

3.4 安装红外接收器

用一颗M2*10螺丝及塑料垫将红外接收器固定在较短的一块亚克力板上。

3.5 系统电源线连接

将DC电源头的正极、电源开关的另一脚还有三线电压表的红黄两线一起接到L298N的+12V输入口;将DC电源头负极、电池盒黑色线以及三线电压表黑色线一起接到L298N的GND上。将DC头插进Arduino UNO里。

Pin connection:(以下引脚连接已与样本代码验证成功)

ARDUINO Pin Peripheral Pin
D5 L298N IN2
D6 L298N IN1
D9 L298N IN3
D10 L298N IN4
D2 VS1838 Data(S pin)
5V VS1838 VCC
GND VS1838 GND

3.7 安装铜柱

用5跟M4*50铜柱将上面两块亚克力底盘支撑起来,至此安装完毕!

Software Installation:

Step 1: Install latest Arduino IDE (If you have Arduino IDE version after 1.1.16, please skip this step)

Download Arduino IDe from https://www.arduino.cc/en/Main/Software?setlang=en , then install the software.

Step 2: Install IRremote library into Arduino IDE (If you have already installed IRremote library, please skip this step)

Down load IRremote library from  http://osoyoo.com/wp-content/uploads/samplecode/IRremote.zip, then import the library into Arduino IDE(in Arduino IDE->Sketch->Import Library->Add Library)

Step 3: Download IRremote small car sample code and run the car with a remote controller.

Sample code download url:http://osoyoo.com/driver/car_IRremote.ino

Download above file and load it into Arduino IDE.

Press IR controller keys to control the car movements as per following instruction table:

IR remote key Car activity
+ Go forward
- Go backward
CH+ Left turn
CH- Right turn
CH Stop

 

Posted in IOT, 测试

Leave a Reply

WordPress spam blocked by CleanTalk.

Meta