Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Pololu Zumo Shield for Arduino User’s Guide https://www.pololu.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.a. Contacting Pololu . . . . . . . . . . . . . . . . . . . . . . . . . . 1.b. Included components . . . . . . . . . . . . . . . . . . . . . . . . 2. Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.a. What you will need . . . . . . . . . . . . . . . . . . . . . . . . . 2.b. Assembling the Zumo Shield and chassis . . . . .
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 1. Overview The Zumo Shield provides a convenient interface between our Zumo chassis [https://www.pololu.com/ product/1418] and an A-Star 32U4 Prime [https://www.pololu.com/category/165/a-star-32u4-prime], Arduino Uno [https://www.pololu.com/product/2191], or Arduino Leonardo [https://www.pololu.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation The Zumo Shield is available by itself, as part of a kit, or in a complete robot: • Zumo Shield [https://www.pololu.com/product/2521] • Zumo robot kit for Arduino [https://www.pololu.com/product/1418] [https://www.pololu.com/product/2509] with a Zumo chassis and a stainless steel Zumo blade [https://www.pololu.com/ product/1410] • Zumo robot for Arduino motors [https://www.pololu.com/product/2510], [https://www.pololu.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation We would be delighted to hear from you about your experiences with the Zumo Shield for Arduino [https://www.pololu.com/product/ 2521], Zumo robot kit for Arduino [https://www.pololu.com/product/ 2509], or Zumo robot for Arduino [https://www.pololu.com/product/ 2510]. If you need technical support or have any feedback you would like to share, you can contact us contact] directly or post on our forum support/robots/16].
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation • two 25-pin 0.1″ straight breakaway male headers [https://www.pololu.com/product/965] • four blue shorting blocks [https://www.pololu.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation You will receive the black acrylic spacer and mounting plates with protective paper masking on both sides. You can peel this masking off to expose the acrylic surface, or you can leave it on to increase the thickness of the plates. The shield and chassis kit include extra parts like jumper wires, screws, nuts, and washers, so do not be concerned if you have some leftover hardware after assembling your Zumo.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 2. Assembly If you have a Zumo robot kit for Arduino [https://www.pololu.com/product/2509] or a separate Zumo Shield [https://www.pololu.com/product/2521] and chassis [https://www.pololu.com/product/1418], this section will guide you through assembling them into a complete robot. If you purchased an assembled Zumo robot for Arduino [https://www.pololu.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation [https://www.pololu.com/category/123/pololu-qtr-reflectance-sensors] • Connectors and jumper wires [https://www.pololu.com/category/19/connectors], for connecting additional sensors and components • Battery charger (such as the iMAX-B6AC [https://www.pololu.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Through-hole parts 1. Solder the included through-hole components to the shield: ◦ buzzer ◦ charging connector (1×2-pin female header) ◦ power switch (original and v1.2 only) ◦ reset pushbutton (original and v1.2 only) ◦ user pushbutton (original and v1.2 only) 2.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation one 1×10 header, two 1×8 headers, and one 1×6 header; older Arduino boards use two 1×8 headers and two 1×6 headers (the two pairs of pins highlighted above in red should not be populated if you are using this board with an older Arduino that does not support these additional pins).
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Jumpers and additional connections 5. Optional: If you want to enable the buzzer, enable the battery level input, or disable the compass, now is a good time to add and/or cut jumper connections to configure the shield to your liking.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 6. Optional: At this point, you might consider soldering additional components (such as sensors), or headers or wires for connecting them, to the shield. If you do this, please check to make sure your part placement does not interfere with the shield’s ability to mate with the Arduino or the chassis.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 8. Cut two of the included jumper wires in half to form four segments, and trim off the ends that are covered in adhesive (the adhesive could interfere with making a good electrical connection to the motor). These wire segments will be used as motor leads. 9. Solder a pair of leads to each motor in the orientation described below.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Each motor’s positive terminal is indicated by a plus sign (+) in the black plastic end of the motor, as indicated in the picture below. The motors should be soldered into the shield with the positive terminal closest to the front, so you should attach the leads to allow the motors to be oriented this way. (However, don’t worry if you accidentally get the orientation of one or both motors wrong.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Chassis and shield To assemble the chassis with the Zumo Shield, you should use the two-piece acrylic spacer plate that is included with the shield. You will not need the one-piece mounting plate that is included with the Zumo chassis. 11. Place an M3 nut in each of the two side slots near the rear of the chassis. The slots are sized so that nuts will not be able to rotate within them.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation holes in the spacer plate should line up with the through-holes in the shield resting on top of it, and the motor leads should be aligned so they pass through the slots in the spacer as shown in the picture below. There is only one correct orientation for these plates. (The plate consists of two separate pieces to make it possible to disassemble the Zumo without having to desolder the motors or battery terminals.) 14.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation mounting a sumo blade; otherwise, you can use the shorter 1/4″ screws for all four mounting holes. If you are also adding a basic sumo blade, you can either mount it now or add it later after you are done soldering the motors and battery contacts.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation the shield so that the holes line up with the two front mounting holes and insert the two longer (5/16″) #2-56 machine screws (included with the shield) through the blade, shield, spacer plate, and chassis. Be careful when adjusting the angle of the sumo blade while it is mounted to the chassis, as this can crack the acrylic spacer plate if you apply sudden or excessive force.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Battery contacts 16. Turn the chassis over and install the battery terminal contacts as shown in the picture below. The three double-contact pieces should be firmly pressed into place until they are flush with the interior surface of the battery compartment.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 17. Solder the two individual contacts to the shield from the top. Note that if you are using a battery to hold the contact in place during soldering, the battery might act as a heat sink, making it more difficult to solder or requiring a higher soldering iron temperature. The battery terminal slot in the PCB should be completely filled with solder as shown in the picture below. Idler Sprockets and track 18.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 20. At this point, you can add the silicone tracks by stretching them around the sprockets on each side of the chassis. Your Zumo Shield and chassis are now complete; just add batteries and an Arduino to get your Zumo robot moving! 2.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Disassembly If you later decide you want to solder additional parts to the Zumo Shield, it is possible to remove it from the chassis with some careful effort. 1. Remove the tracks from the chassis. 2. Remove the battery cover and batteries from the chassis. 3. Unscrew all four sets of machine screws and nuts holding the shield to the chassis. 4.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Assembling the sensor array The Zumo reflectance sensor array ships with all of the components you need to connect it to a Zumo shield: • sensor array PCB with the surfacemount parts pre-populated • 2×12 extended 0.1″ male header (will be soldered to sensor PCB) • 2×12 0.1″ female header (will be soldered to Zumo shield) • 1×3 0.1″ straight male header (optionally soldered to sensor PCB) • 1×3 0.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation We recommend using the right-angle header mounted as shown in the picture below, but the straight 3-pin header will also work if you do not have anything already soldered to the Zumo shield’s front expansion area that would interfere. If you choose to install this header, please make sure you are doing it in a way that will not prevent installation of the sensor array (e.g.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation With the female header in place, the assembled sensor array can be plugged directly into the Zumo shield. 2.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation The reflectance sensor array features two visible (red) LEDs in series with the IR emitter LEDs, so you can use the red LEDs to tell when the emitters are on and off. Array pinout The Zumo reflectance sensor array gets all the necessary power and I/O connections from the 12 header pins that are circled on the silkscreen: The default I/O connections are to pins that are otherwise unused by the Zumo shield.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Disabling or remapping sensors Many applications do not require all six reflectance sensors, and you might want additional I/O lines for other things (e.g. obstacle detectors). In such cases, you can disable specific sensors and free up their associated I/O lines. The array PCB has six pairs of through holes, each of which corresponds to a different sensor. The order of the pairs matches the order of the sensors.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Now you effectively have a four-sensor array and analog pins A2 and A3 are available for generalpurpose use. To configure the ZumoReflectanceSensorArray object to use this new configuration, call init with these arguments: 1 2 ? byte pins[] = {4, 11, A0, 5}; reflectanceSensors.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 3. The Zumo Shield in detail 3.a. Features and components The main features of the Zumo Shield (v1.3) are labeled in this diagram: Power The Zumo chassis has an internal compartment for four AA batteries. We recommend using rechargeable AA NiMH cells [https://www.pololu.com/product/1003], which results in a nominal voltage of 4.8 V (1.2 V per cell). You can also use alkaline cells, which would nominally give you 6V.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation After passing through reverse protection, the battery voltage is connected to the rest of the shield by the power switch. The switched battery voltage is designated VBAT and provides power to the motors through the DRV8835 motor driver. An on-board boost regulator, also supplied from VBAT, generates 7.45 V to power the Arduino through its Vin pin. In turn, the Arduino’s regulated 5V and 3.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Motor driver An integrated DRV8835 [https://www.pololu.com/product/2135] dual motor driver on the Zumo Shield drives the Zumo’s two micro metal gearmotors. Four Arduino pins are used to control the driver: • Digital pin 7 controls the right motor direction (LOW drives the motor forward, HIGH drives it in reverse). • Digital pin 8 controls the left motor direction.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation • The original Zumo Shield features an LSM303DLHC 3-axis accelerometer and magnetometer. The inertial sensors are detailed in Section 3.d. 3.b. Front expansion The pins in the front expansion area of the Zumo Shield are shown in the following diagram: This diagram is also available as a downloadable PDF: Zumo Shield front expansion pinout [https://www.pololu.com/file/0J592/zumo_shield_front_expansion_pinout.pdf] (552k pdf).
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation board compass module. Depending on the Arduino model, digital pin 3 or 6 is used to control the buzzer if you install the buzzer control jumper. If you are using an Uno, pin 6 will be available for general-purpose I/O. If you are using a Leonardo or A-Star, pin 3 will be available if you are not using I²C.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation allows you to monitor the Zumo’s battery voltage. This jumper is disconnected by default and can be connected by soldering a short length of wire between the two holes. The divider outputs a voltage equal to two-thirds of the battery voltage, which will always be safely below the Arduino’s maximum analog input voltage of 5 V. For example, at a battery voltage of 4.8 V, analog pin 1 will be at a level of 3.2 V.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Instead of making a wire connection, you can solder a 1×3 male header to the buzzer jumper holes to allow the use of a shorting block for connecting the buzzer (note: this header is already installed if you got the assembled version of the Zumo robot, but the shorting block must be positioned in the appropriate place for the Arduino model you are using).
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Using the sensors Level shifters built into the shield allow the inertial sensors, which operate at 3.3 V, to be connected to the 5 V logic level pins of the Arduino. The sensors, level shifters, and I²C pull-up resistors are connected to the SCL and SDA pins on the Zumo Shield by default, but they can be disconnected by cutting traces to allow those pins to be used for other purposes.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 4. Schematics and dimensions Schematics Schematic diagrams of the Zumo Shield are available as a downloadable PDF: • v1.3 Zumo Shield v1.3-schematic.pdf] • v1.2 Zumo diagrams [https://www.pololu.com/file/0J1767/zumo-shield- (183k pdf) Shield v1.2-schematic.pdf] • Original schematic schematic diagrams [https://www.pololu.com/file/0J779/zumo-shield- (449k pdf) Zumo Shield zumo_shield_schematic.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Pololu Zumo chassis, assembled front view with dimensions. Pololu Zumo chassis, assembled top view with dimensions, shown with motors. 4.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 5.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 6. Zumo Shield Arduino library Our Zumo Shield Arduino library makes it easy to get started writing Arduino sketches to control your Zumo. A link to download the library and installation instructions can be found on the library’s GitHub page [https://github.com/pololu/zumo-shield-arduino-library]. The Zumo Shield Arduino library documentation [https://pololu.github.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation to generate pulse width modulation at a 20 kHz frequency. (See Section 3 for more details about the motor driver and its connections.) If you accidentally soldered a motor to the Zumo Shield backwards (opposite the orientation indicated in the assembly instructions [https://www.pololu.com/docs/0J57/2.b]), you can simply call and/or directions in your code.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation PololuBuzzer PololuBuzzer [https://github.com/pololu/pololu-buzzer-arduino] enables playing notes and songs on a buzzer. For boards based on the ATmega328P, this library uses Timer 2 and pin 3 (PD3/OC2B). For boards based on the ATmega32U4, this library uses Timer 4 and pin 6 (PD7/OC4D). This library will conflict will other libraries that use the same timer or pin. Pushbutton Pushbutton [https://github.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 7. Example sketches These examples demonstrate how to program an Arduino-controlled Zumo to perform more complex and interesting tasks. The source files for the examples are included in the download for the Zumo Shield Arduino Library [https://www.pololu.com/docs/0J57/6]. Once the library is installed, the examples can be accessed in the Arduino environment under File > Examples > ZumoShield. 7.a.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation Diagram of an RC receiver connected to pins on a Zumo Shield. This program uses Arduino’s PulseIn library [http://arduino.cc/en/Reference/PulseIn] to read the signals from the receiver. By default, it assumes the throttle and steering channels are connected as the diagram shows on pins 4 and 5, respectively.
Pololu Zumo Shield for Arduino User’s Guide A Zumo robot preparing to attack a Parallax SumoBot. © 2001–2022 Pololu Corporation Zumo reflectance sensor array on a Zumo robot, bottom view. This example demonstrates how to program an Arduino-controlled Zumo equipped with a reflectance sensor array to drive around and stay within a sumo ring. Note that it only uses the two outermost sensors on the array, which are sufficient for border detection. With the Zumo Shield Arduino library [https://www.pololu.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation • If you do not hear any sound from the buzzer, make sure you have the buzzer control jumper [https://www.pololu.com/docs/0J57/3.c] configured correctly for your Arduino. The ability to wander around while staying inside a sumo ring is enough to allow a Zumo to compete as a basic sumo robot, but a more advanced robot might be able to detect its opponent and drive toward it directly.
Pololu Zumo Shield for Arduino User’s Guide [https://www.pololu.com/product/975], © 2001–2022 Pololu Corporation and the concepts and strategies involved are explained in detail in Section 8 of the 3pi robot user’s guide [https://www.pololu.com/docs/0J21]. 7.f. Coordinating turns with the compass This example program demonstrates using the Zumo Shield’s 3-axis magnetometer (described in section Section 3.d) to help the Zumo coordinate ninety-degree turns and drive in squares.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation 8. Controlling a servo This section explains how to control a hobby RC servo [https://www.pololu.com/category/23/rc-servos] from an Arduino Uno, Arduino Leonardo, or A-Star 32U4 Prime that is connected to the Zumo Shield. The Arduino IDE includes a Servo [http://arduino.cc/en/Reference/Servo] library that generates the pulses needed to control an RC servo.
Pololu Zumo Shield for Arduino User’s Guide 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 © 2001–2022 Pololu Corporation /** Arduino Uno Timer 2 Servo Example This example code for the Arduino Uno shows how to use Timer 2 on the ATmega328P to control a single servo. This can be useful for people who cannot use the Arduino IDE's Servo library.
Pololu Zumo Shield for Arduino User’s Guide 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 © 2001–2022 Pololu Corporation // The servo pin is currently high. // Check to see if is time for a falling edge. // Note: We could == instead of >=. if(servoTime >= highTimeCopy) { // The pin has been high enough, so do a falling edge.
Pololu Zumo Shield for Arduino User’s Guide © 2001–2022 Pololu Corporation with ZumoMotors, making it possible to simultaneously control servos and the motors. Warning: The modifications described here will affect any sketch for the Arduino Leonardo or A-Star that uses the Servo library. 1. First, you will need to locate the Arduino IDE’s Servo library, and find the file inside it named ServoTimers.h. For the 1.6.x versions of the IDE, this file can be found in libraries/Servo/src/ avr/ServoTimers.h.