Download Print this page
Arduino Mega2560 Manual

Arduino Mega2560 Manual

Mars explorer mecanum wheel robotic kit

Advertisement

Mars Explorer Mecanum Wheel Robotic Kit
(Arduino Mega2560)
More information: http://osoyoo.com/?p= 30176

Advertisement

loading
Need help?

Need help?

Do you have a question about the Mega2560 and is the answer not in the manual?

Questions and answers

Summary of Contents for Arduino Mega2560

  • Page 1 Mars Explorer Mecanum Wheel Robotic Kit (Arduino Mega2560) More information: http://osoyoo.com/?p= 30176...
  • Page 2 This Arduino Omini Direction Robot Car learning kit is developed our Japan and Canada engineer team. It has all features a traditional Arduino Robot car should have, including remote control by Bluetooth, IoT through Wifi, Line tracking and Obstacle Avoidance auto driving.
  • Page 3: Table Of Contents

    CONTEXT Lesson1 Assembling the Car ..................4 Lesson 2: Obstacle Avoidance Robot Car ..............17 Lesson 3: Tracking Line ....................23 Lesson 4: Bluetooth Imitation Robot Car ..............27 Lesson 5: Wifi IoT Control Robot Car ..............32...
  • Page 4: Lesson1 Assembling The Car

    Mecanum Omni direction wheel is a very interesting wheel which allows robot car make omni-directional movement( parallel shift to left and right). In this project, we will show how to use Arduino to control an Osoyoo Brand Mecanum wheel robot car to make some basic movement including go forward, backward, left turn, right turn, parallel left shift, parallel right shift etc.
  • Page 5 Picture 2: Chassis screw location map (view from top) Step 1) Install Cooper standoff on the chassis If your motors have already connected with a copper standoff, please skip this step and directly go to Step 2 Follow the picture below to install 4 copper standoff on the positions of the blue lines first, then fasten the 4 motors onto the 4 standoffs.
  • Page 6 Picture 4: Motor installation guide map Step 2) If you have already installed motor and standoff in Step 1, please skip this step and go to Step 3 If your motor comes with pre-installed standoff, please follow the pictures below to install them onto the chassis.
  • Page 7 Picture 6: Type A and Type B motors location map in chassis. Picture 7: Wheel installation map...
  • Page 8 Step 3) Connect wheels to the motors The Mecanum wheel has some sub-wheels on the main wheel. The four Mecanum wheels have two types by the sub-wheel directions. Check the type A wheel and type Wheel by following picture 8 left side . You must 100% sure that correct type of wheel is installed into correct position as per picture 8 right side, the rolling direction of each wheel will determine the whole car moving directions showed in the picture.
  • Page 9 Picture 9: different rotation combination of 4 wheels will result in different car movement directions. Following pictures shows how they works. Step 4) Install Mega2560, Model X boards(L298N),Wifi shield onto the chassis Picture 10: MEGA2560, Model X, voltage meter guide...
  • Page 10 Picture 12: Wifi shield installation guide...
  • Page 11 Picture 13: Connect Model X board (L298N) to front motors Picture 14: connect another model X board(L298N) to rear motors. Picture 15: Connect Front Model X pins to MEGA2560...
  • Page 12 Note: wire (purple wire) is connected to D22 which is located on the SECOND female hole from right in following picture 10. Many people treat the first hole as D22. THIS IS WRONG. Picture 16: Front Model X board IN1,IN2,IN3,IN4 pin connect to D22,D24,D26,D28...
  • Page 13 Picture 17: Connect Rear model X control pins to Mega2560 Picture 18: Connect Model X to Voltage meter...
  • Page 14 Open-source Arduino Download Arduino IDE here: Software(IDE) https://www.arduino.cc/en/Main/Software?setlang=en...
  • Page 15 . Step 3: Connect mega2560 board to PC with USB cable, Open Arduino IDE -> click file -> click Open -> choose code “lesson1.ino” in lesson1 folder, load the code into arduino.
  • Page 16 After running Lesson 1 code, the car will move forward,backward, left turn, right turn, left shift, right shift. If the car does not move as per this sequence , you need check the wire connection. Youtube Video Link: https://www.youtube.com/embed/15qYSh9M5AE...
  • Page 17: Lesson 2: Obstacle Avoidance Robot Car

    OSOYOO Mecanum Wheels Robotic Car Chassis x1(2xleft-wheels/2xright-wheels and Motor x 4) OSOYOO Mega2560 board fully compatible with Arduino OSOYOO V1.0 Wifi shield x 1 OSOYOO Model X motor driver x 2...
  • Page 18 Step 3: Remove screws on copper pillars and install servo motor at the front of upper car chassis with 2pcs M2.2*8 Self Tapping Screws. Step 4: Install mount holder for Ultrasonic Module on servo motor with M2*4 Self Tapping screw. (Please note: please upload code to adjust servo motor direction before fixing this screw)
  • Page 19 If you just finishes Lesson 1, please keep all lesson 1 connections same as it is. STEP5:Connect Servo 3-pin head to any Model X board servo slot(yellow to S pin, red to 5v,brown to G pin), then connect another S pin to Wifi board D13. STEP6:Connect Ultrasonic sensor module to wifi board as following graph.
  • Page 20 . Step 3: Connect mega2560 board to PC with USB cable, Open Arduino IDE -> click file -> click Open -> choose code “lesson2.ino” in lesson folder, load the code into arduino as...
  • Page 21 Step 4: Choose corresponding board/port for your project, upload the sketch to the board. Step 5:Ultrasonic sensor servo initial direction alignment After turning on the battery, the servo will make some movement and finally stops at a direction for 5 seconds. During this first 5 seconds, you must make sure the Ultrasonic sensor(two eyes) is facing straight forward.
  • Page 22 and make your Ultrasonic sensor position change, you must remember to do sensor direction alignment again. Youtube Video Link: https://www.youtube.com/embed/5VRMH276oas...
  • Page 23: Lesson 3: Tracking Line

    OSOYOO Mecanum wheels robotic car chassis x1 (2xleft-wheels/2xright-wheels and Motor x 4) OSOYOO Mega2560 board fully compatible with Arduino UNO/Mega2560 x1 OSOYOO V1.0 Wifi shield x1 OSOYOO Model X motor driver x2...
  • Page 24 7 zip is a free zip Download 7zip here for free utility that un-zips zip https://www.7-zip.org/ files 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.
  • Page 25 . Step 3: Connect mega2560 board to PC with USB cable, Open Arduino IDE -> click file -> click Open -> choose code “lesson3.ino” in lesson folder, load the code into arduino as following: Step 4: Choose corresponding board/port for your project, upload the sketch to the board.
  • Page 26 Prepare a black track (the width of the black track must be between 20mm and 30mm) in white ground. Please be noted that the bend angle of track can’t be too sharp otherwise the car will move out of the track. Turn on the car and put the middle of tracking sensor module facing over black track, and then the car will move along the black track automatically.
  • Page 27: Lesson 4: Bluetooth Imitation Robot Car

    In this lesson,Mecanum Omni wheel will allows robot car make omni-directional movement( parallel shift to left and right). OSOYOO Mecanum Wheels Robotic Car Chassis x1(2x left-wheels/2x right-wheels and 4x motor) OSOYOO Mega2560 board fully compatible with Arduino OSOYOO V1.0 Wifi Shield x 1 OSOYOO Model X motor driver x 2...
  • Page 28 STEP2: Bluetooth Module should be inserted into bluetooth 6-pin slot in OSOYOO Wifi Board...
  • Page 29 . Step 3: Connect mega2560 board to PC with USB cable, Open Arduino IDE -> click file -> click Open -> choose code “lesson4.ino” in lesson4 folder, load the code into arduino.
  • Page 30 Power on the robot, and open APP. 1) If you have not paired Bluetooth module with your cell phone, please pair the bluetooth module first before open the APP. In your cell phone Setting->Bluetooth ,find a Bluetooth device called HC02, pair it with password 1234 2) After bluetooth HC02 device is paired, open the APP.
  • Page 31 4) Click Speed +/- button to accelerate or reduce speed 5) Rotate the mobile phone to change direction(steering wheel will rotate while you are turning the phone). 6) Click Gear button to change gear to Forward or Backward direction. 7) Press F1 to Shift to left way, F5 to shift to right way, F3 to up left diagonal, F4 to up right diagonal.
  • Page 32: Lesson 5: Wifi Iot Control Robot Car

    Internet. This is a typical Internet of Things(IoT) Application. OSOYOO Mecanum Wheels Robotic Car Chassis x1(2x left-wheels/2x right-wheels and 4x motor) OSOYOO Mega2560 board fully compatible with Arduino OSOYOO V1.0 Wifi Shield x 1 OSOYOO Model X motor driver x 2 OSOYOO Battery box x 1 18650 Batteries(3.7V) x 2...
  • Page 33 Download 7zip here for free utility that un-zips zip https://www.7-zip.org/ files 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. STEP2: Please download the library zip file from WiFiEsp-master .Open Arduino IDE ->click...
  • Page 34 Store, and then install this APP. STEP4: Arduino Sketch code Installation: Robot Car can work in two Wifi modes:AP mode and STA mode. The Arduino sketches for these two modes are different. Let’s explain these two modes one by one.
  • Page 35 Arduino (2) Open your Arduino Serial monitor and set 9600 baud,then you will see a similar result as AP mode. A new Wifi SSID “osoyoo_robot” with IP address 192.168.4.1 will show up in the window.
  • Page 36 (4) Connect your cell phone to “osoyoo_robot” wifi hot_spot,you can use Mobile phone control the robot car. (5)You can click the “< " ">” ” ^” ” v ” direction keys to make the car move. Use “||” pause key to stop the car movement. Click Obstacle to shift left side, Click Tracking to shift right side.
  • Page 37 LAN. You need tell Arduino sketch what is your local router’s Wifi SSID and password, then Arduino talks to router and get its own LAN IP address from DHCP server. You can use Mobile APP to access the robot car’s IP address and control its movement.
  • Page 38 (3) Upload the sketch to Arduino. Finally, click the Serial monitor window in upper right corner of Arduino IDE and set 9600 baud,then you will see following result: (4)In this mode, your will see an IP address which is our LAN IP address assigned by my router.
  • Page 39 (6)You can click the “< " ">” ” ^” ” v ” direction keys to make the car move. Use “||” pause key to stop the car movement. Click Obstacle to shift left side, Click Tracking to shift right side. Click F1 to make upper-left diagonal movement, Click F3 to make upper-right diagonal movement Click F4 to make back-left diagonal movement, Click F6 to make back-right diagonal...