In this project we’re going to learn about servo motor and how to make robotic arm using it and also its connection with Arduino actually we need more than one servo motor 3 to be exact and Arduino shield.
Kit: Junkbot Edu kit.
- Arduino Uno
- Servo motors
- USB cable
- Connecting wires
Code brick program:
1.How to test servo motor:
- Connect the black wire (brown wire) of servo to the Vcc and red wire to the GND on Arduino.
- Connect the yellow wire to the pin 9 of Arduino.
- Connect your Arduino to your computer using USB cable.
2.How to control servo motor:
- Open the Junkbot software.
- Click on the events block, drag.
- Go to robots block, drag.
- Attach toto .so when the is clicked the servo motor turns 90 degrees.
- You can add the between the flag and the servo motor to make servo motor turning 90 degrees forever.
- And you add different angles to the servo motor.
- So you can give some delay between two different angles. .3.Robotic Arm: How to make the robotic arm using servo motors.
- So we’re using 3 servo motors each at different level of the arm.
- And we create a sprite for each servo motor to control it.
- For first servo motor we create up arrow sprite when you click this the angle of the servo motor will increase by 50 for each click.
- And we create down arrow sprite to decrease the angle by 50 degrees when it is clicked each time.
- A sprite can be created using the and select the sprite or you can create your one.
- So I created 3 pairs of up and down arrow sprites so that I can increase and decrease the degrees each time for each servo motor.
- And the amount of degree you want increase and decrease can be set by creating a variable.
- A variable can be created using and then use the block to create a variable.
- So when you click on the you can create a variable and I created 3 of them for each variable you’ll get 4 blocks like
- Since we want to change the degree when we click on the sprite so use the for changing the degrees.
- So when you click on the sprite the servo will rotate in that degree by how much you want change in this case 50 .
- Follow same steps for other two servo motors create variable and sprite and change the angle by some degrees.
- Attach Arm like structure to servo motor in this case we used spoon as the robotic Arm.
- So when you press the sprite the mechanism works like robotic arm.
- Even though you connected Arduino to your computer, it won’t start communicating with codebricks until you connect them manually.
- This is represented in codebricks, with dot to show status.
- If the colour of dot is red (as illustrated below), it means the communication is not started yet.
- Click connect.
- Select the corresponding serial port.
- The dot will turn from red to green, representing the connection established.
- Now click to make the servo motor on.
According to different keys used for different angles the servo motor will turn or angles.
With help of this project you can actually create a robotic arm and use it using the laptop keyboard.
- Lectures 0
- Quizzes 0
- Duration 50 hours
- Skill level All level
- Language English
- Students 3
- Certificate No
- Assessments Self