Académique Documents
Professionnel Documents
Culture Documents
Book 5
Bizchip ® Technology Centre 3363-2, JALAN 18/31, TAMAN SERI SERDANG, 43300 SERI KEMBANGAN, SELANGOR.
TEL: 012-297 9320 FAX: 03-8948 7451 WEB: http://www.magnetcode.com EMAIL: info@magnetcode.com
Page 1 of 41
2- AXIS ROBOT ARM
Table of Content
Ref. Content Page
1 List of Equipment 3
2 List of Materials 4
3 Drilling Part 6
4 Installing Part 11
5 Wiring Part 15
6 Install Magnetcode 20
Page 2 of 41
2- AXIS ROBOT ARM
Page 3 of 41
2- AXIS ROBOT ARM
Page 4 of 41
2- AXIS ROBOT ARM
Box with Lead (h:2.5cm, Box with Lead (h: 5cm, Connector Wire
w:4cm, l:7cm) w:9.5cm, l:16cm)
Quantity: 2 Quantity: 1
Page 5 of 41
2- AXIS ROBOT ARM
1. Take the acrylics with the length 11cm and width 3cm.
2. First hole with diameter 3mm, from left to right in distance 1.5cm and 2.5cm from above to
below
3. Second hole in distance 0.9cm to the below from the first hole with the same diameter,
3mm.
4. Third hole is below of the second hole in 0.9cm with 3mm diameter.
5. For the fourth hole, 1.3cm from above and 2cm from right side. Follow by another hole
which is 0.8cm from right side with same height from above, 1.3cm.
6. Another hole is on the bottom, first hole is 0.8cm from below and 1.5cm from right side,
which is on center line of the acrylic.
7. Then, other hole is 1.2cm above from the previous hole and at the center too.
8. Repeat the step 1-4 with the others acrylic.
2cm
2.5cm 1.3cm
0.9cm
0.9cm
2cm
0.8cm
1.5cm 0.8cm
9. Then, take a servo motor horn.
10. One the servo motor horn, make a hole on the third tiny hole using 3mm diameter from
center to the left and right. Refer the picture below as a reference.
Page 6 of 41
2- AXIS ROBOT ARM
2. Make a hole with diameter 16mm from the left 2cm and from above 2cm of the box, for a
led.
3. From the first hole, to the right 2.6cm make another hole with diameter 5mm.
4. Refer the diagram below:
2cm
2cm
2.6cm
5mm
16mm
5. Then, on the both side of the box, right and left make a hole with diameter 6mm on the
center which is from left 2cm and from above 1.3cm.
1.3cm
6mm
2cm
Page 7 of 41
2- AXIS ROBOT ARM
Body Drill
3. Then, second hole is on the right of the first hole which in distance 0.5cm from right with
same diameter, 4.5mm.
4. For the last hole on center of the lead which is 4.75cm from left to right and 1.5cm from
above to below, make a hole with diameter 12mm.
1.5cm
1.5cm
1.5cm 4.75cm
12mm
4.5mm
0.5cm
Page 8 of 41
2- AXIS ROBOT ARM
5. On the top of the body, hole must be made 4.7cm from the left to right with a length 2.5cm
from above to below with the diameter 14mm.
2.5cm
4.7cm
14mm
6. The first hole with diameter 6mm for left side of the body is from bottom to the upper in
distance 2.5cm and from left to the right in 2.5cm.
Page 9 of 41
2- AXIS ROBOT ARM
7. The second hole is above the first hole, 2cm from it in center line with diameter 5mm. Refer
the diagram below:
2.5cm
2cm
5mm
2.5cm
6mm
Page 10 of 41
2- AXIS ROBOT ARM
Body
1. First, on the left of the body, install yellow led in the upper hole through inside the box.
2. Glue the LED to avoid it from remove.
3. The hole below, install the switch and make sure the toggle is outside the box.
4. Then, on top of the box install the servo motor. Let the shaft out through the hole.
5. Put glue around the servo motor and avoid the glue from shaft. Refer the picture below.
Page 11 of 41
2- AXIS ROBOT ARM
Arm
1. Take three acrylics and construct it like in the picture below. Screw it so that it cannot be
removed.
2. Then, glue the servo motor to the ‘L’ bracket using hot glue gun and screw it to arm. Refer
the picture below and make sure the wire of the servo motor is on upper
Page 12 of 41
2- AXIS ROBOT ARM
3. Take another ‘L’ bracket and screw it to the other end of the arm. Also screw the box to the
‘L’ bracket so it will be the same like in the picture below:
4. On the middle of arm, screw the servo motor horn under it. Refer the picture below:
Page 13 of 41
2- AXIS ROBOT ARM
5. Screw another servo motor horn on the outside of the mini box and assemble it to the
motor’s shaft.
Page 14 of 41
2- AXIS ROBOT ARM
SIG
5V
SERVO1
GND
Step2: Connect the servo motor at the arm to the project board
SIG
5V
SERVO2
GND
ONOFF2
5V
ONOFF3
Page 15 of 41
2- AXIS ROBOT ARM
DIN1
GND
DOUT1
GND
Page 16 of 41
2- AXIS ROBOT ARM
DIN2
GND
GND
DOUT2
POWER 3
Page 17 of 41
2- AXIS ROBOT ARM
POWER 1
Page 18 of 41
2- AXIS ROBOT ARM
Page 19 of 41
2- AXIS ROBOT ARM
Step 1: Download the latest Step 2: In the Android phone Step 3: Click the downloaded
version of Magnetcode at:
magnetcode.com/app.html Magnetcode app (.apk
‘Setting’ app . Access
file) to start installation.
‘Security’ page and tick
‘Unknown sources’.
Page 20 of 41
2- AXIS ROBOT ARM
Graphic design page is important for user interfacing. User can control his / her phone or
project board features through the graphic design page.
User can set title, background, buttons and LCD components in the graphic design page by
using related commands.
Title Background
Button
LCD
There are 9 buttons in
There is 1 LCD in the the graphic design
graphic design page. page. The buttons are
arranged in 3 rows (1,
LCD is used to show
2, 3) x 3 columns (A,
system status and
B, C).
message.
The buttons are used
to execute the preset
User can use commands.
command to hide or
show it. They can
also set LCD text, User can use
text size, text command to hide or
alignment, show each button.
background color, They can also set
image, text color. text, text size,
background color,
text color for each
button.
Page 21 of 41
2- AXIS ROBOT ARM
For project 1, we will design a project to deliver candy from left to right. Then pow the
candy and back to the left side.
Start
No
Red button is
pressed?
Yes
Page 22 of 41
2- AXIS ROBOT ARM
Command Related
Page 23 of 41
2- AXIS ROBOT ARM
Program Description
LINE 4: If C_Din1= 1
If red button is pressed, red LED will turn
LINE 5: Dout1=on
on and the machine will turn to the right
LINE 6: Servo1= 180 side. Pause for 1 second.
LINE 7: Timer=1sec
Page 24 of 41
2- AXIS ROBOT ARM
Program Operation
The diagram below shows the flow of the program when no button is pressed.
LINE 1: Servo1= 0
LINE 2: Servo2= 0
LINE 3: Read_Controller
LINE 4: If C_Din1= 1
LINE 5: Dout1=on
LINE 7: Timer=1sec
LINE 8: Servo2=180
Page 25 of 41
2- AXIS ROBOT ARM
The diagram below shows the flow of the program when red button is pressed.
LINE 1: Servo1= 0
LINE 2: Servo2= 0
LINE 3: Read_Controller
LINE 4: If C_Din1= 1
LINE 5: Dout1=on
LINE 7: Timer=1sec
LINE 8: Servo2=180
Page 26 of 41
2- AXIS ROBOT ARM
Exercise
Upgrade the program when press red button, delivery machine will pow candy at right hand side.
When press green button delivery machine will pow at middle side.
Answer
Servo1= 0
Servo2= 0
Read_Controller
If C_Din1= 1
Dout1=on
Servo1= 180
Timer=1sec
Servo2=180
Timer=1 sec
Servo2= 0
Timer=1 sec
Servo1=0
Dout1= Off
End If
If C_Din2= 1
Dout2=on
Servo1= 90
Timer=1sec
Servo2=180
Timer=1 sec
Servo2= 0
Timer=1 sec
Servo1=0
Dout2= Off
End If
Goto= 3
Page 27 of 41
2- AXIS ROBOT ARM
For project 2, Swing robot arm accordingly to sequence 0 degree -> 90 degree ->
180 degree -> 90 degree repeatedly for 5 times. Player can throw candy in the
swinging container. Player with higher score will be winner of the game.
Start
Initial value 0
Yes
Value1< is less No
The robot arm will swing
than 5?
Page 28 of 41
2- AXIS ROBOT ARM
Command Related
LCD_Align= Middle Graphic Design Set the alignment of the LCD content.
Servo1= 0 Controller I/O Control servo motor angle on the project board.
Value1= Value2+1 Variable Set the first variable value with calculation
result of the second variable value and an
integer.
LCD_Show_Var= Time Graphic Design Clear and save new variable in the memory of
LCD.
LCD_Update Graphic Design Display the memory content of the LCD.
Page 29 of 41
2- AXIS ROBOT ARM
Program Description
LINE 2: LCD_Show= On
To display LCD on user interface. Also to
LINE 3: LCD_Align= Middle align the text to the middle of the LCD
with text size 80. The container will face
LINE 4: LCD_Text_Size= 80
up.
LINE 5: Servo2= 0
LINE 11: Servo1= 180 Then the arm will swing to 180 degree
for 1 second.
LINE 12: Timer=1 sec
LINE 13: Servo1= 90 Then the arm will swing to 90 degree for
1 second.
LINE 14: Timer= 1 sec
LINE 16: LCD_Show_Var= Value1 Add the current value by 1 and display
on LCD.
LINE 17: LCD_Update
Page 30 of 41
2- AXIS ROBOT ARM
Program Operation
The diagram below shows the flow of the program when the condition is false.
LINE 1: Value1= 0
LINE 2: LCD_Show= On
LINE 4: LCD_Text_Size= 80
LINE 5: Servo2= 0
LINE 6: If Value1<5
LINE 7: Servo1= 0
LINE 9: Servo1= 90
Page 31 of 41
2- AXIS ROBOT ARM
The diagram below shows the flow of the program when the condition is true.
LINE 1: Value1= 0
LINE 2: LCD_Show= On
LINE 4: LCD_Text_Size= 80
LINE 5: Servo2= 0
LINE 6: If Value1<5
LINE 7: Servo1= 0
LINE 9: Servo1= 90
Page 32 of 41
2- AXIS ROBOT ARM
Exercise
Change the counter to down counter.
Answer
LINE 1: Value1= 5
LINE 2: LCD_Show= On
LINE 4: LCD_Text_Size= 80
LINE 5: Servo2= 0
LINE 6: If Value1<0
LINE 7: Servo1= 0
LINE 9: Servo1= 90
Page 33 of 41
2- AXIS ROBOT ARM
For project 3, we will program to move robot arm left right using smartphone.
Start
No
No
Page 34 of 41
2- AXIS ROBOT ARM
Command Related
LCD_Align= Middle Graphic Design Set the alignment of the LCD content.
ButtonA1_Show_Text = Text Graphic Design Clear and save new text in the memory
LCD_Show_Text= Text Graphic Design Clear and save new text in the memory of LCD.
Use ‘#’ symbol to skip a line.
LCD_Update Graphic Design Display the memory content of the LCD.
Servo1= 0 Controller I/O Control servo motor angle on the project board.
Page 35 of 41
2- AXIS ROBOT ARM
Program Description
LINE 4: ButtonA2_Show= On
LINE 6: ButtonA2_Update
LINE 7: ButtonC2_Show= On
Page 36 of 41
2- AXIS ROBOT ARM
Program Operation
The diagram below shows the flow of the program when no button is pressed.
LINE 1: LCD_Show= On
LINE 3: LCD_Text_Size= 80
LINE 4: ButtonA2_Show= On
LINE 6: ButtonA2_Update
LINE 7: ButtonC2_Show= On
LINE 9: ButtonC2_Update
Page 37 of 41
2- AXIS ROBOT ARM
The diagram below shows the flow of the program when “Left” button is pressed.
LINE 1: LCD_Show= On
LINE 3: LCD_Text_Size= 80
LINE 4: ButtonA2_Show= On
LINE 6: ButtonA2_Update
LINE 7: ButtonC2_Show= On
LINE 9: ButtonC2_Update
Page 38 of 41
2- AXIS ROBOT ARM
The diagram below shows the flow of the program when “Right” button is pressed.
LINE 1: LCD_Show= On
LINE 3: LCD_Text_Size= 80
LINE 4: ButtonA2_Show= On
LINE 6: ButtonA2_Update
LINE 7: ButtonC2_Show= On
LINE 9: ButtonC2_Update
Page 39 of 41
2- AXIS ROBOT ARM
Exercise
Upgrade to program to move left and right and up and down using smartphone.
Answer
LINE 1: LCD_Show= On
LINE 3: LCD_Text_Size= 80
LINE 4: ButtonA2_Show= On
LINE 6: ButtonA2_Update
LINE 7: ButtonC2_Show= On
LINE 9: ButtonC2_Update
Page 40 of 41
2- AXIS ROBOT ARM
Page 41 of 41