0% found this document useful (0 votes)
65 views50 pages

003 en

Uploaded by

eo644673
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views50 pages

003 en

Uploaded by

eo644673
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

ArduBlock 2.

0
Block coding program for Arduino platform

Arduino
MOBILE ROBOT
30 projects

Robot assembly instructions


Block programming
Remote control

ardublock.ru
Components ArduBlock

Arduino Uno board ­ 2 pcs. 5mm LEDs ­ 1 pc. Active buzzer ­ 1 pc. TSOP1736 ­ 1pc.

IR Remote control ­ 1 pc. Dupont cable ­ 20 pcs. Радио модуль R433 L9110S DC driver ­ 1pc.

Driver L298N ­ 1 pc. Ultrasonic rangefinder ­ 1 pc. Two­axis XY joystick ­ 1pc. Line sensor ­ 2 pcs.

2WD robot cart ­ 1 pc. Expansion board ­ 1 pc.

Links to components from Aliexpress


http://ardublock.ru/ali/?ali=3 Arduino Uno board ­ 2 pcs.
http://ardublock.ru/ali/?ali=6 5mm LEDs ­ 1 pc.
http://ardublock.ru/ali/?ali=20 Active buzzer ­ 1 pc.
http://ardublock.ru/ali/?ali=21 TSOP1736 ­ 1pc.
http://ardublock.ru/ali/?ali=25 Dupont cable ­ 20 pcs.
http://ardublock.ru/ali/?ali=36 IR module Remote control ­ 1 pc.
http://ardublock.ru/ali/?ali=122 Radio module R433 ­ 2 pcs.
http://ardublock.ru/ali/?ali=46 L9110S DC driver ­ 1pc.
http://ardublock.ru/ali/?ali=49 Driver L298N ­ 1 pc.
http://ardublock.ru/ali/?ali=66 Ultrasonic rangefinder ­ 1 pc.
http://ardublock.ru/ali/?ali=69 Two­axis XY joystick ­ 1pc.
http://ardublock.ru/ali/?ali=116 2WD robot cart ­ 1 pc.
http://ardublock.ru/ali/?ali=32 Expansion board ­ 1 pc.
http://ardublock.ru/ali/?ali=141 Line sensor ­ 2 pcs.

2
Contents ArduBlock

1. Acquaintance with ArduBlock and the first start.


2. My first program: Flashing LED.
3. Set of First Robot + Drawings in 1: 1 scale.
4. First Robot ­ Installing motors on the robot platform.
5. First robot ­ Installing the front chassis.
6. First robot ­ Installation, Arduino UNO boards.
7. First Robot ­ Installing the battery compartment on the robot platform.
8. First robot ­ Installing the motor driver board + connection.
9. First robot ­ Program: First movements of the robot + speed.
10. First robot ­ Program: The movement of the robot in time.
11. Robot rangefinder ­ Installing the rangefinder on the robot + connection.
12. Robot rangefinder ­ Program: Ultra sound ruler.
13. Robot rangefinder ­ Program: Stop the robot when there is an obstacle.
14. Robot rangefinder ­ Program: Robot hunter. Attacks the target.
15. Robot rangefinder ­ Program: Field of Miracles. We spin the drum.
16. Robot rangefinder ­ Program: Robot vacuum cleaner.
17. Robot line ­ Installing the line sensor on the robot.
18. Robot line ­ Program: The robot is afraid of the black line.
19. Robot line ­ Program: Robot mine detector.
20. Robot line ­ Program: Robot sum. Battle of robots.
21. Robot line ­ Program: The robot moves along the line.
22. Robot line ­ Program: The robot drives along the line + stop.
23. Robot control ­ Joystick installation + Control.
24. Robot control ­ Installing the ik module + Scan the button code.
25. Robot control ­ Program: Robot movement from the remote control buttons.
26. Assembling the joystick ­ Remote control.
27. Assembling the joystick ­ Connecting the joystick and R433 to the Arduino board.
28. Assembling the joystick ­ Remote control program.
29. Robot control ­ R433 to the robot.
30. Robot control program.

3
Acquaintance and first start ArduBlock
1. Download ArduBlock.zip http://ardublock.ru/index.php?id=download­2 #ardu
block
2. Unpack the archive.
3. Installing the compiler Arduino ide.
The path to the file: \install\arduino­ide\arduino­1.8.5­windows.exe
4. Driver Installation for Chinese Boards with Chip CH341
The path to the file: \install\drive­arduino\SETUP.EXE
5. Installing Elevate script to connect ArduBlock to Arduino ide
The path to the file: \install\elevate\elevate.exe" Run as admin!
6. Launching the ArduBlock app.
The path to the file: \app\ArduBlock.exe
7. Build the program from blocks.
Please specify the board model and port before uploading.
8. Click Download on the toolbar.
9. The program is compiled and downloaded to the Arduino board.

Board model
Board port
Upload to board

Port monitor

Blocks

Program

Basket

4
My first program ArduBlock
­
My first Arduino program was Blinking LED.

+
Install the LED on the Arduino board.
The long leg of the LED is a plus at 13 pin.
Minus LED to GND.
lock
#ardub
Let's write a program ­ Blinking LED.
Let's open the ArduBlock application.

Before us is the main block and two global functions.

Setting function ­ Makes settingsprograms,


establishes a connection, etc.Executed only once
and only ifturning on the
power of the Arduino board.
Function program ­ This is the main part of the program,
this is where the endlessly executable program is
collected.The program runs endlessly until the
boardArduino, power is on.
Turn on the LED! Light­emitting diode
In the block menu, open the section
Output modules ­ LED

Install the LED block into the main program block


Pin 13 Switch on signal.

5
My first program ArduBlock
If we load our program onto the Arduino board, we will see a simpleLED glow.
And our goal is to achieve blinking of the LED so thatwe continue to work
on the program.

When the LED blinks, we first turn on the LED for sometime and then turn it
off for a certain time, and so on forever, untilthe board will be powered.
Go to the Blocks MenuTime ­ Delay ­ Milliseconds.

Set the block Milliseconds 1000 = 1 second after the LED is turned on.

We read the program:


Infinitely
The LED will be
onfor 1 second

The LED is on for 1 second, now turn off the LED.


Duplicate the block
(right click a menu will open)
Duplicate

6
My first program ArduBlock
Change LED signal, Disable.

Set the unit LED off after the on time.

We also turn off the LED for 1 second or 1000 milliseconds.


Duplicate the Milliseconds block and set it after turning off the LED.

We read the program:


Infinitely.

The LED will be


onfor 1 second

Turn off the LED


for 1 second.

All this is in an endless loop of the program and will be


executedinfinitely while the board is powered.

7
My first program ArduBlock
Let's download the program to the Arduino board. Click Load the program.

Loading: OK. The program is already on the Arduino board!

The LED is flashing.

lock
#ardub

Congratulations on your first Arduino program!

8
First robot kit ArduBlock
The basis of the robot:
1 PC.

Mounting motors:
4 PC.

M3x30mm screws:
4 PC.

Nuts m3:
4 PC.
Scale 1: 1 mm.
Outlined: For CNC or 3D printing.

9
First robot kit ArduBlock
Wheel: Motor reducer:
2 PC. 2 PC.

Racks m3x10: Front chassis:


8 PC. 1 PC.

M3x5,6 bolts:
16 PC.

Arduino Uno board: Motor driver: Motor driver:


1 PC. 1 PC. 1 PC.

or L298N
L9110S

Battery compartment:
1 PC.
Wires: 12 PC.
АА

АА АА

АА

10
Installing motors on the platform ArduBlock
1. Install the center motor holders on the robot platform:

2.Prepare Screw m3x30,


second holder, motor:

3. Install assembly: motor with holderto


the first carrier on the platform.

4. Tighten the nuts.

For convenient
workturn overplatform
robot.

5.Install the wheels.

11
Installing the front chassis ArduBlock
1. Screw the 4 m3x10 uprights onto the chassis with m3x5.6 bolts.

2. Screw the assembled chassis to the robot platform with m3x5.6 bolts.

The robot chassis is installed.

12
Installing the Arduino UNO board ArduBlock
1. Screw 2 m3x10 posts onto the board with m3x5.6 screws.

2. Install the Arduino board on


robo ­ platform.

3. Fix the Arduino board to


robo ­ platform, bolted m3x5.6.

13
Installing the battery compartment ArduBlock
1. Screw 2 m3x10 uprights onto the battery compartment with m3x5,6 screws.

2. Screw on the battery compartment,


to the platform, with m3x5.6 bolts.

Вкл/Выкл

3. The battery compartment is installed.


4. Connection:
Battery Board
+ (plus) + 5v
­ (minus) GND

14
Installing the motor driver ArduBlock
1. Install the motor driver on the base of the robot.

Вкл/Выкл Вкл/Выкл

0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13

2. Connect the motor driver to the Arduino board.

ML MR Motor B Motor A

0
1
2
3
4 0
5 1
6 2
7 VIN 3
GND 4
8 GND 5
9 +5V 6
10 VIN
7
11 GND
12 8 GND
13 9 +5V
10
11
12
13

15
Scheme ArduBlock

Connecting the L9110 motor driver.

Connecting the L298N motor driver.

16
The first steps of the robot ArduBlock
1. Robot movement: Forward.

L R

2. Robot movement: Back.


L R

3. Robot movement: To the right.

L R

4. Robot movement: Left.

L R

5. Stopping the robot.

L R

17
Robot movement functions ArduBlock
1. To work with the movement of the robot, let's create the movement functions:

2.Rename
function name

Functions:

18
The movement of the robot in time ArduBlock
1. Robot movement in time: The robot performs an action every minute.

В
В А В
А

А
А В

В А

2. Forward function
3. Moving forward
for 1 second

4. Right turn

5. To the right 1 second


(turning time is selected when testing the robot)

19
Installing an ultrasonic rangefinder ArduBlock
1. On a piece of double­sided tape, glue the connectors.

2. Install
rangefinder.

3. Glue
rangefinder
to the
compartment
batteries.
Вкл/Выкл
13
12
11
10
9
8
7
6
5
4
3
2
1
0

+5V
pin8 ­ Trig
pin7 ­ Echo
GND

4. Connect the rangefinder


to the Arduino UNO board.

20
Scheme ArduBlock

21
Ultrasonic Sound Ruler ArduBlock
1. Place an object in front of the robot.

1 СМ 2 СМ 3 СМ 4 СМ 5 СМ 6 СМ 7 СМ

2. Let's send the received values to the serial monitor:

Set the communication speed of the port monitor

Each time, on a new line, we will display the values


from an ultrasonic rangefinder:

The update period for sending the value is set to 200 ms.
Download the program to the Arduino board!

3. Let's open the serial port monitor:

Let's see the result.

Start:

22
Остановка робота при препятствии ArduBlock
1. If the value on the rangefinder is less than 10, then the robot stops.

10 СМ
STOP

2. All received values will be sent to the com port monitor.

3. If the value on ultrasonic rangefinder will be


less than 10, thenstopping the robot, "and if false"
then: otherwise, the robot drives forward.

23
Hunter robot, attacking the target ArduBlock
1. If the value on the rangefinder is less than 10, the robot starts moving.

STOP 10 СМ

2. If the value is less than 10, then move forward, if not, then stop.

24
Robot spinning a drum ArduBlock
1. If the value on the rangefinder is less than 10, the robot starts moving.
100 $ lock
#ardub

START Game:

500 $ 10 СМ

0$

STOP 20
0$
50 $
lock
#ardub

2. If the value on the Ultrasonic Rangefinder is less than 10, then the robot
starts turning, with a random value of time from 2 to 5 seconds.

25
Robot, vacuum cleaner ArduBlock
Variable i for storing rotation!

10

STOP
10 СМ

STOP

10 СМ

10 СМ

26
Installing the sensor line on the robot ArduBlock

L R

pin 4 pin 3
+5V +5V 1 Type 1 0
GND GND
0 Type 2 1

m3

m3x40
Вкл/Выкл

L
13
12
11
10
9
8
7
6
5
4
3
2
1
0

27
Scheme ArduBlock

28
The robot is afraid of the black line ArduBlock

2. If one of the line sensors recorded a black line, then we produce


turn the robot, otherwise we continue to move on to the obstacle.

If the second type of


sensors, then set the
value 1.

29
Robot ­ Mine Finder ArduBlock
1. Install the Buzzer on the robot. Зуммер
+ + 9pin
2. The buzzer will signal that the black GND
mark is on the table. GND + 9pin

PIP STOP +

13
12
11
10
9
8
7
6
5
4
3
2
1
0
+

#ardub
lock

If one of the line sensors gets a black mark then:


If the second type of sensors
then set the value to 1.
The robot stops
Signal

Passes the mark

And again moves in a spiral


looking for a new label

New function for the movement of the robot in a spiral.

30
Scheme ArduBlock

31
Robot ­ Sumo ArduBlock
1. The robot pushes the cups over the black line.

If the second type of


sensors, then set the
value 1.

4. The robot touches the


black line. Backward movement.
5. Robot again
3. The robot ejects the cup in search of a
outside the field. new goals.

2. In sight
robot hit
target: a glass.

1. The robot is
spinningin the
search for a goal.

32
Robot ­ Follow the line ArduBlock
1. The robot is moving along the black line.

3 stage
ч
Leftline Rightline

откл б sensor
pin 4
sensor
pin 3

S
V ­ +5V
G ­ GND

вкл
вкл

ч 2 stage
вкл

откл
б
б б 1 stage

вкл

If the second type of sensors


then set the value to 1.

33
Robot ­ Follow the line + stop ArduBlock
1. The robot moves along the black line, if there is an obstacle, then stop.

вкл

1 stage
STOP

вкл

б
б

б
вкл

откл
ч

2 stage
3 stage

ч
откл

вкл
б

If the second type of sensor


sthen set the value to 1.

34
Robot ­ Joystick Connection ArduBlock

Вкл/Выкл
GND ­ GND
Vcc ­ +5V
X ­ Pin A1
Y ­ Pin A0

13
12
11
10
9
8
7
6
5
4
3
2
1
0

X ­ Pin A1 = 0
Y ­ Pin A0 = 500

X ­ Pin A1 = 500 X ­ Pin A1 = 500


Y ­ Pin A0 = 1023 Y ­ Pin A0 = 0

1. Let's read the values from A0 and A1. X ­ Pin A1 = 1023


Y ­ Pin A0 = 500
2. Let's send the obtained values to the port monitor.

35
Scheme ArduBlock

36
Robot ­ Joystick Control ArduBlock
Joystick axes
X ­ Pin A1 = 0
Y ­ Pin A0 = 500

1. Check each axis and


we perform the action. X ­ Pin A1 = 500
Y ­ Pin A0 = 1023 STOP
X ­ Pin A1 = 500
Y ­ Pin A0 = 0

X ­ Pin A1 = 1023
Y ­ Pin A0 = 500

X ­ Pin A1 = 0

X ­ Pin A1 = 1023

Y ­ Pin A0 = 0

Y ­ Pin A0 = 1023

STOP

37
Robot ­ Remote Control ArduBlock
1. Install the ik module on the Arduino board.

Вкл/Выкл
13
12
11
10
9
8
7
6
5
4
3
2
1
0
GND ­ GND
Vcc ­ +5V
S ­ Pin 12

2. Let's send the value c ik to


Serial USB and see under 16712445
# a r dublock
what code each button on
the remote control. Write 16769055
down the code for each 16754775

button for future reference. 16750695


Each remote control has a 16748655
different key code.

38
Scheme ArduBlock

39
Robot ­ Remote Control ArduBlock
16712445
lock
#ardub
16769055
Вкл/Выкл
16754775
16750695

16748655

0
1
2
3
4
5
6
7
8
9
10
11
12
13

Button code

40
Printing / Cutting ArduBlock
1. Remote controller:

Scale 1:1 mm.


Outlined: For CNC or 3D printing.

41
Robot ­ Control by R433 ArduBlock
1. Install the joystick on the base of the Console:

2. Connect joystick and R433 module to Arduino board:


GND ­ GND
Vcc ­ +5V
Pin ­ 2
9v

GND ­ GND
Vcc ­ +5V
X ­ Pin A1
Y ­ Pin A0

3. Place the Arduino board on the base of the console.

42
Robot ­ Control by R433 ArduBlock
1. Let's write a program for the remote control. Joystick axes
1
X ­ Pin A1 = 0
Y ­ Pin A0 = 500
X ­ Pin A1 = 500
Y ­ Pin A0 = 1023

4 STOP
3
X ­ Pin A1 = 500
STOP 0 Y ­ Pin A0 = 0

X ­ Pin A1 = 1023
Y ­ Pin A0 = 500

STOP

43
Robot ­ Control by R433 ArduBlock

1 ­ GND ­ GND
2 ­ Vcc ­ +5V
3 ­ pin2

13
12
11
10
9
8
7
6
5
4
3
2
1
0

44
Robot ­ Control by R433 ArduBlock

45
Scheme ArduBlock

46
For notes ArduBlock

47
For notes ArduBlock

48
For notes ArduBlock

49
ArduBlock 2.0
Block coding program for Arduino platforms
Arduino mobile robot
30 projects

Publisher: ArduBlock
Site: ardublock.ru
Author: Vitaly Nikolaevich
Email: [email protected]

You might also like