Presentation is loading. Please wait.

Presentation is loading. Please wait.

Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.

Similar presentations


Presentation on theme: "Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology."— Presentation transcript:

1 Robotics Grant Agreement No 518656-LLP-1-2011-1-UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology

2 Mobile robots with Arduino – Lesson 1 Grant Agreement No 518656-LLP-1-2011-1-UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology

3 Mobile robots with Arduino This is a step-by-step tutorial on how to control a mobile robot using Arduino, an open source development platform. Fig. 1: Mobile robot controlled with Arduino

4 Mobile robots with Arduino Materials needed 1 x Arduino uno/duemilanove. The Arduino Uno is a microcontroller board based on the ATmega328. Fig. 2: Arduino Uno

5 Mobile robots with Arduino Materials needed 1 x Standard servo Servos are basically Dc motors with position feedback that means you can tell the microcontroller through your code to move the servo to the desired position. In Arduino a standard servo can be moved between 0 to 180 degree and 90 is the servo center(makes sense).Most of the hobby servos run happily between 4.8V to 6V.Supplying more than 6V may damage your servo. Servo has three wires i.e. Brown, Red, Yellow or the color maybe Black, Red, White. Brown or black wire is to be connected to ground of the microcontroller. Red wire is to be connected to Vcc (4.8V to 6V). Yellow or white wire is to be connected to the digital output of the microcontroller and is called signal wire.

6 Mobile robots with Arduino Materials needed 1 x Standard servo Fig. 3: Servo

7 Mobile robots with Arduino Materials needed 1 x Breadboard Half sized breadboard is enough for this robot. Fig. 4: Breadboard

8 Mobile robots with Arduino Materials needed Gauge wires or male to male jumper wires For making connections on the breadboard one needs either gauge wire or male to male jumper wires. Best deal would be gauge wire as it is available in local electronics/hobby shop. Male to male jumper wires are sometimes hard to find. Fig. 5: Gauge wires or male to male jumper wires

9 Mobile robots with Arduino Materials needed 1 x L293D motor driver L293D is a 16 pin chip and is a popular motor driver which can be used for small motors that have low output current. Fig. 6: 1 x L293D motor driver

10 Mobile robots with Arduino Materials needed 2 X Plastic gear motors Plastic gear motors are very lightweight, small in size and easy to mount. The motors are available in many RPM(revolutions per minute).You can buy the motor between 60 to 100 RPM for this robot. The lower the RPM,the greater will be the torque (doesn't matter much for this robot). Fig. 7: 2 X Plastic gear motors

11 Mobile robots with Arduino Materials needed 2 x Wheels compatible with plastic gear motors Two screws are used for attaching the wheels to the plastic gear motors. Fig. 8: Wheels compatible with plastic gear motors

12 Mobile robots with Arduino Materials needed 1 x Castor wheel Fig. 9: Castor wheel

13 Mobile robots with Arduino Materials needed 1 X Sharp GP2D12 analog distance sensor. The sensor consists of two eyes. One eye sends the infrared light and the other eye sees the reflection of that infrared light and measures the distance which is then sent to the microcontroller through analog input to perform further operations based on the distance(the operations should be defined in the code). It is possible that you may not get GP2D12 model. Another option is Sharp GP2Y0A02YK. The only difference between both the model is the range of distance measurement. GP2D12 measures distance from 10cm to 80 cm. GP2Y0A02YK measures distance from 20cm to 150cm. There is also GP2D120 (i think it is discontinued) which measure distance from 4cm to 30cm. Make sure you get a JST 3-pin connector with these sensors for easy interfacing. There are three wires coming from the sensor. i.e. Red, Black and White or it can be Red, Brown and Yellow. Red is connected to 5V of Arduino. Black or brown to Ground of Arduino. White or yellow to analog input pin of Arduino i.e. in this case to analog pin 0.

14 Mobile robots with Arduino Materials needed 1 X Sharp GP2D12 analog distance sensor Fig. 10: Wheels

15 Mobile robots with Arduino Materials needed Batteries Arduino itself needs 9V(recommended).So it is better to use two different battery packs. 1 x 9V PP3 battery for Arduino and 4 AA batteries i.e. 6V for motors and servo. Make sure you buy good quality batteries like Duracell or so. Fig. 11: Batteries

16 Mobile robots with Arduino Materials needed 1 x 4 AA Battery Holder Fig. 12: Battery holder

17 Mobile robots with Arduino Materials needed 2 x Battery connector Fig. 13: 2 x Battery connector

18 Mobile robots with Arduino Materials needed 1 x Acrylic sheet Fig. 14: 1 x Acrylic sheet

19 Mobile robots with Arduino Materials needed 1 x USB cord The sketch(code) will be downloaded to the Arduino with this USB cord from the PC. Fig. 15: 1 x USB cord

20 Mobile robots with Arduino Materials needed 1 x double sided tape The components are attached on the acrylic plate using double sided tape. Fig. 17: 1 x double sided tape

21 Mobile robots with Arduino Materials needed Soldering Iron Fig. 18: Soldering Iron

22 Mobile robots with Arduino Steps to assembly

23 Mobile robots with Arduino Materials needed Step 1. First solder the wires to the motor leads. In our case, it is cut the male to male jumpers in half and soldered them to the motor leads. It helps in easy connections on the breadboard. Fig. 19: Step 1

24 Mobile robots with Arduino Materials needed Step 2. Mount the wheels to the motor shaft with the help of screw that you got with the wheels. Fig. 20: Step 2

25 Mobile robots with Arduino Materials needed Step 3. The castor wheel usually comes with holes in it for easy mounting using small nuts and bolts but if you don't want to drill holes on the acrylic sheet (robot base) then you can simply stick it with double sided tape. Fig. 21: Step 3

26 Mobile robots with Arduino Materials needed Step 4. The distance between the front castor wheel and the rear wheels should be as less as possible. Fig. 22: Step 4

27 Mobile robots with Arduino Materials needed Step 5. Place a servo in the front using double sided tape. The servo should come above(roughly) the castor wheel. Fig. 23: Step 5

28 Mobile robots with Arduino Materials needed Step 6. Place a 9V battery with the connector (with DC plug) and 4 AA batteries with the connector (without the DC plug) on the robot base. Fig. 24: Step 6

29 Mobile robots with Arduino Step 7. Fig. 25: Step 7

30 Mobile robots with Arduino Step 8. Programming The first thing you need to do is install Arduino IDE and setup your Arduino. #include // includes the servo library Servo myservo; // creates a servo object void setup() { myservo.attach(8); // attaches the servo to digital pin 8 } void loop() { myservo.write(90); // moves the servo to 90 degree. delay(700); // wait for the servo to finish its rotation }

31 Mobile robots with Arduino Step 8. Programming int sensorpin = 0; // analog pin used to connect the sharp sensor int val = 0; // variable to store the values from sensor(initially zero) void setup() { Serial.begin(9600); // starts the serial monitor } void loop() { val = analogRead(sensorpin); // reads the value of the sharp sensor Serial.println(val); // prints the value of the sensor to the serial monitor }

32 Mobile robots with Arduino Step 8. Programming int motor_pin1 = 4; //define the pins to which motor wires are connected int motor_pin2 = 5; void setup () { pinMode(motor_pin1,OUTPUT); // set the motor pins as output pinMode(motor_pin2,OUTPUT); } void loop() { digitalWrite(motor_pin1,HIGH); digitalWrite(motor_pin2,LOW); }

33 Mobile robots with Arduino Step 9. Completed robot

34 Mobile robots with Arduino Step 9. Completed robot

35 Mobile robots with Arduino Step 9. Completed robot


Download ppt "Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology."

Similar presentations


Ads by Google