Download Print this page

NEX ROBOTICS SPARK V ATMEGA16 Hardware Manual

Robotic research platform

Advertisement

Quick Links

SPARK V ATMEGA16 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA
1

Advertisement

loading
Need help?

Need help?

Do you have a question about the SPARK V ATMEGA16 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for NEX ROBOTICS SPARK V ATMEGA16

  • Page 1 SPARK V ATMEGA16 Hardware Manual © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 2 SPARK V ATMEGA16 Hardware Manual SPARK V HARDWARE MANUAL © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 3 SPARK V ATMEGA16 Hardware Manual Version 1.12 November 06, 2010 Documentation author Sachitanand Malewar, NEX Robotics Pvt. Ltd. Vinod Desai, NEX Robotics Pvt. Ltd. Credits: All the team of NEX Robotics © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 4 Almost all of the robot parts are recyclable. Please send the robot parts to the recycling plant after its operational life. By recycling we can contribute to cleaner and healthier environment for the future generations. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 5 Introduction SPARK V ATMEGA16 Using SPARK V Robot Programming Spark V ATMEGA16 Robot Pin Functionality PC Based Control Using Serial Communication Robot Control using ‘GUI’ for SPARK V ATMEGA16 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 6: Safety Precautions

    • Using robot in areas prone to static electricity. • Read carefully paragraphs marked with caution symbol. Note: For Spark V accessories refer to Chapter 10: Spark V Accessories © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 7 Spark V is a low cost robot designed for robotics hobbyists and enthusiasts. It is jointly designed by NEX Robotics with Department of Computer Science and Engineering, IIT Bombay. Spark V will help you get acquainted with the world of robotics and embedded systems. Thanks to its innovative architecture and adoption of the ‘Open Source Philosophy’...
  • Page 8 2.1 SPARK V Block Diagram: Figure 2.2: Spark V ATMEGA16 robot block diagram 2.2 SPARK V ATMEGA16 technical specification Microcontroller: ATMEL ATMEGA16 Programming: Using NEX Robotics Boot loader via USB port (no need of separate programmer) Sensors: Three white line sensors...
  • Page 9 GUI Based control, AVR studio, WINAVR Microsoft robotics studio Visual Programming Language (will be launched shortly) Requires: AC adaptor with exact 12VDC with 1Amp. current rating for battery charging. 6 NiMH rechargeable batteries © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 10 Spark V robot contains 6 modules: 1. Power management 2. Sensing 3. Actuation (locomotion) 4. Other peripherals 5. Communication 6. Intelligence (microcontroller) Figure 3.1: SPARK V ATMEGA16 robot top view © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 11 SPARK V ATMEGA16 Hardware Manual 3.1 Connections Figure 3.2: Spark V component layout top view © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 12 SPARK V ATMEGA16 Hardware Manual Figure 3.3: Spark V component layout bottom view © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 13 1. Battery low warning in case battery is below critical level 2. Regulated supply for onboard payload. 3. Battery charging when robot is powered off and external battery charger is connected. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 14 7V, it starts giving beeping sound and battery status indicator led blinks with red color. When robot is off and 12V DC is applied to the battery charging socket, Smart battery monitoring circuit charge the battery. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 15: Battery Charging

    Now smart battery controller will sense the presence of the battery charging supply and will start charging the battery. It will terminate the battery charging once battery is fully charged. During © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 16 To run the robot on the external supply, remove the 4 pin relimate battery connector from its socket and use another 4 pin relimate connector to give external supply. External supply should © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 17: Battery Maintenance

    PWM the motor reacts to the time average of the signal. PWM is used to control total amount of power delivered to the load without power losses which generally occur in resistive methods of power control. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 18 90% of time period. This wave has more average value. Hence more power is delivered to the motor. In case (B), the motor will run slower as the ON time is just 10% of time period. Figure 3.10: Motion Control © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 19 (Left wheel stop, Right wheel backward) SOFT LEFT 2 (Left wheel backward, Right wheel stop) HARD STOP SOFT STOP (Free running stop) Table 3.3: Direction and PWM LED indications © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 20 SOFT LEFT 2 (Left wheel As per velocity backward, Right wheel requirement stop) As per velocity HARD STOP requirement SOFT STOP (Free running stop) Table 3.4: Logic levels for setting direction and velocity © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 21: Position Encoders

    Output from the position encoder is cleaned using Schmitt trigger based inverter (not gate) IC CD40106. CD40106 also drives left and right position encoder status LEDs. For more details, refer to figure 3.13. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 22 Case 1: Robot is moving forward or backward (encoder resolution is in mm) Wheel diameter: 7cm Wheel circumference: 7cm * 3.14 = 21.980cm = 219.80mm Number slots on the encoder disc: 17 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 23 = Number of slots on the encoder disc / Number of wheel rotations of in 360 rotation of robot = 17 x 3.312 = 56.304 (approximately 56) Position Encoder Resolution in Degrees = 360 /56 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 24 Sensors are numbered as 1, 2 and 3 from left to right in clockwise direction. In all the manuals this numbering convention will be used for addressing the particular IR sensor. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 25 ADC channel no. 0 Center ADC channel no. 1 Right ADC channel no. 2 Table 3.5 IR Proximity Sensor connections with ADC of the ATMEGA16 (after correct jumper settings) © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 26 Figure 3.19 shows locations of the ultrasonic sensors. They are numbered as 1, 2, and 3 from left to right. Number “4” marks connector for the 4 ultrasonic range sensor which can be mounted on the servo motor for taking 180 degrees range scan. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 27 ADC channel no. 0 Center ADC channel no. 1 Right ADC channel no. 2 Table 3.6 Ultrasonic Range Sensor connections with ADC of the ATMEGA16 (after correct jumper settings) © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 28 Spark V robot supports EZ0 to EZ4 sensors from MaxBotix. All these sensors are available on NEX Robotics website. Other sensors from MaxBotix having compatible pin mapping can also be used instead of these sensors. For more details on compatibility, refer to the respective sensor’s datasheet.
  • Page 29 IR LED for the illumination. Due to the directional nature of the photodiode it does not get affected with ambient light unless it is very bright. Figure 3.24: White line sensor © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 30 In such case it will be difficult for the robot to differentiate between white and black surface. Figure 3.26: White Line Sensor © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 31 3 control signals with 4 data lines. In this mode higher nibble and lower nibble of commands/data set needs to be sent separately. Figure 3.28 shows LCD interfacing in 4 bit mode. The three control lines are referred to as EN, RS, and RW. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 32 Contrast of the LCD can be adjusted by adjusting the potentiometer. To save power its backlight can also be turned off by removing jumper J1. For jumper and potentiometer location, refer to figure 3.27. Figure 3.30: LCD schematics © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 33 Robot has 3 KHz piezo buzzer. It can be used for debugging purpose or as attention seeker for a particular event. The buzzer is connected to PC3 pin. Figure 3.31: Buzzer Figure 3.32: Buzzer Schematic © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 34: Usb Interface

    You can also use other pins of the serial ports which are marked by red border for implementing advance flow control. Figure 3.34: USB to Serial converter Schematic © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 35 For more details, refer to XBee wireless module’s datasheet from the datasheet folder of the documentation CD. Figure 3.36: USB XBee Wireless Module Schematic © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 36 Sharp or Ultrasonic range sensor from MaxBotix. Servo motor can be connected to standard 3 pin servo connector while range sensor is connected to 4 pin relimate connector. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 37 SPARK V ATMEGA16 Hardware Manual Figure 3.39: Servo motor and Sensor connector Figure 3.40: Servo motor and sensor connections 3.18 Battery voltage sensing Figure 3.41: Battery voltage sensing © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 38: Power Port

    3. V Batt: Output from the battery. Maximum output current is dependent on the battery capacity. Figure 3.42: Power Port Figure 3.43: Power Port connections © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 39 Spark V robot has ATMEGA16 microcontroller running at 7.3728MHz. .hex file is loaded using boot loader software from NEX Robotics. In the bootloading process Reset and Boot switches are used together. To know more about the boot loader, refer to section 4.6. Robot can also be programmed by ISP (In System Programming) using AVR USB programmer from NEX Robotics or ATMEL’s AVR ISP mkII.
  • Page 40 SPARK V ATMEGA16 Hardware Manual Figure 3.45: Microcontroller Schematics © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 41 SPARK V ATMEGA16 Hardware Manual 3.21 Spark V Schematics © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 42 SPARK V ATMEGA16 Hardware Manual © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 43: Ide Installation

    Insert the Spark V documentation CD and from the “Software and Drivers” folder copy “WIN AVR 2009-03-13” on the PC and click on WinAVRxxxx.exe file. Figure 4.1 WIN AVR installation package will open. Choose language as “English”. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 44 SPARK V ATMEGA16 Hardware Manual Figure 4.2 Click next in the WIN AVR setup wizard. Figure 4.3 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 45 SPARK V ATMEGA16 Hardware Manual Press “I Agree” after going through license agreement. Figure 4.4 Make sure that you select drive on which operating system is installed. Figure 4.5 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 46 SPARK V ATMEGA16 Hardware Manual Select all the components and press “Install”. Figure 4.6 Click “Finish” to complete WIN AVR installation Figure 4.7 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 47 Go to “Software and Drivers” folder from the documentation CD, copy folder “AVR Studio 4.17” on the PC and click on “AvrStudio417Setup.exe” to start the installation process. Figure 4.8 Click on “Run” Figure 4.9 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 48 SPARK V ATMEGA16 Hardware Manual Click “Next” to start installation of AVR Studio 4 Figure 4.10 After clicking “Next” go through the license agreement. If it is acceptable then click “Next” Figure 4.11 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 49 Select for the “Install / upgrade Jungo USB Driver” to support In System Programming (ISP) by AVRISP mkII Figure 4.13 Important: If “Install / upgrade Jungo USB Driver” is not selected then AVRISP mkII programmer will not work with the AVR Studio. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 50 SPARK V ATMEGA16 Hardware Manual Click “Next” to start the installation process. Figure 4.14 Click “Finish” to complete the installation process. Figure 4.15 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 51 1. Open AVR Studio. If any project is running it can be closed by clicking on Project in the menu and select Close Project. 2. To create new project click on Project in the menu and select “New Project”. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 52 “buzzer_test”. Also check on Create folder check box. This will create all the files inside the new folder. In the Location window select the place where would like to store your project folder and then click “Next”. Figure 4.18 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 53 5. Now we are almost ready to write our first code. Before we start coding we will check other setting to make sure that they are set properly. Figure 4.20 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 54 Stack variables may change location, or be optimized away, and source level debugging may "skip" statements because they too have been optimized away. The levels of optimization are: © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 55 8. Make sure that in the External Tools, proper path for avr-gcc.exe and make.exe are given and press ok. Now we are ready to write our first code. Figure 4.23 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 56 SPARK V ATMEGA16 Hardware Manual 4.4 Writing your first code in AVR Studio We are going to write our first code for our Spark V ATMEGA16 robot. This program will make robot’s buzzer beep. Copy the following code in window “code area”. We will see how this code works in the next chapter.
  • Page 57 “buzzer_test.c” code and will generate “buzzer_test.hex” file for the robot’s microcontroller. Figure 4.24 You can verify successful compilation in the bottom most “Build” window of the AVR Studio. Figure 4.25 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 58 Click on Debug tab in the menu and click on “Start Debugging”. Figure 4.26 Now debugging mode is started and an arrow is visible at the first line of our main function from where the debugging will start. Figure 4.27 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 59 PORTC bits changes as per our commands and these changes can be seen in right window. After debugging is done select “Stop Debugging” from Debug tab. Figure 4.29 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 60 PC. Bootloader software from NEX Robotics which is installed on the PC communicates with the microcontroller. Boot loader software loads the .hex file on the microcontroller.
  • Page 61 The software is located in the “Software and Drivers \ CDM 2.06.00 WHQL Certified” folder. provided in the SPARK V CD or can also be downloaded from the NEX Robotics’ website. Important: Make sure that jumper is configured to enable USB communication. Jumpers on J5 should be in the position.
  • Page 62 Select the second option manually to install the drivers and click on next button. Step 5: Now check the second option and set the location of folder containing drivers E.g.(C:\CDM 2.06.00 WHQL Certified). Figure 4.34 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 63 USB cable in the robot. We have to follow this sequence because USB to serial converter chip is powered by USB. If any fault occurs then turn off the robot and remove the USB cable and repeat the same procedure. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 64 Step 1: Right Click My Computer and click on properties. System properties window will appear. Figure 4.37 Step 2: Click on the Device manager in the Hardware tab. Figure 4.38 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 65 “USB serial Port” and select properties. Figure 4.40 In the Port settings tab click on the “Advanced” button, the following window will appear. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 66 Insert the Spark V documentation CD and from the “Software and Drivers” folder copy “AVR Bootloader” on the PC and click on “setup” application file. Figure 4.42 It will pop-up with the “AVR Bootloader Setup wizard” © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 67 SPARK V ATMEGA16 Hardware Manual Figure 4.43 Click on the “Next” button. Figure 4.44 Select the installation location and click on the “Next” button. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 68 Step4: To start the Bootloader you can click on the desktop icon which is created while installation or you can open it by going to “Start” menu using following path. "C:\Program Files\Nex Programmer\AVR Bootloader Setup\" © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 69 Select the COM port, in this case COM3 is selected. Set he baud rate at 115200bps Select Microcontroller as Atmega16 Select the .hex file to be loaded by clicking on the brows button Figure 4.47 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 70 This is the second option for loading the program. We are going to use “USBasp”, USB port based programmer from NEX Robotics to load the “1_buzzer_test.hex” file on the robot. This programmer requires avrdude.exe file which comes with WINAVR. So installation of WINAVR is necessary for this programmer.
  • Page 71 Step1: Connect your programmer to the USB port, computer will show that a new device has been found. It asks you to install the appropriate software (driver). Select "Install from a specific location". Figure 4.50 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 72 With WinAVR version 20080512 or greater, use libusb_0.1.12.1. Use libusb_0.1.10.1 with older WinAVR versions. Figure 4.51 Figure 4.52 Step 3: After the driver is successfully installed. Click “Finish” to complete the installation process. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 73 Insure that AVR USB programmer is connected to the computer Step 1: Go to My Computer, right click and select Properties. Figure 4.53 Step 2: Click on the Hardware tab. Figure 4.54 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 74 SPARK V ATMEGA16 Hardware Manual Step 3: Click Device Manager. Figure 4.55 Step 4: Verify that an icon called LibUSB-Win32 Devices with USBasp appears in it. Figure 4.56 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 75 SPARK V ATMEGA16 Hardware Manual Step 6: Now hex file can be loaded on the microcontroller. Go to Start menu. Figure 4.57 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 76 SPARK V ATMEGA16 Hardware Manual Step 7: Click run Type ‘cmd’ and press enter. Figure 4.58 Step 8: The command window appears. Figure 4.59 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 77 Step10: Copy the file “1_buzzer_test.hex” to desktop and type this command to transfer the file to the ATMEGA16 microcontroller. avrdude -c usbasp -p m16 -P Usb -U flash:w:1_buzzer_test.hex And wait for program to upload. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 78 SPARK V ATMEGA16 Hardware Manual Figure 4.61 After successful loading of the “1_buzzer_test.hex” you will hear beeping sound being ON-OFF continuously after some delay. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 79 AVR Studio. For more details refer to figure 4.13. Start AVR Studio Go to “Tools tab and click on “Program AVR”. Select connect option. Following window will open. Figure 4.63 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 80 SPARK V ATMEGA16 Hardware Manual Figure 4.64 Step 2: Select “AVRISP mkII”, select “USB port” and press “Connect”. Following window will open. Figure 4.65 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 81 We need to use AVR ISP adaptor to convert 6 pin to 10 pin connector which is available on NEX Robotics website. It comes free with the AVRISP mkII programmer if it is purchased from NEX Robotics website.
  • Page 82 Browse and select the desired hex file in the flash section Press “Program” button Look at the comments at the bottom to verify that hex file is loaded in the flash. Figure 4.69 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 83 Do not change them unless you have very clear understanding of the fuse settings. This information is only given for the reference. Figure 4.70 Figure 4.71: Fuse settings of ATMEGA16 microcontroller © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 84 SUT_CKSEL is set at External crystal greater than 8MHz with startup time of 64ms If needed you can set appropriate Fuse setting and write it by pressing “Program” button. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 85: Pin Functionality

    ADC input for battery voltage monitoring Input***** PA5(ADC5) ADC input for white line sensor Right Input***** PA4(ADC4) ADC input for white line sensor Center Input***** PA3(ADC3) ADC input for white line sensor Left Input***** © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 86 *** Ultrasonic sensors are connected in daisy chain for trigger synchronizing. For more details refer to chapter 3. **** AREF can be obtained from the 5V microcontroller ***** All the ADC pins must be configured as input and floating © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 87 PCs simultaneous communication. A more bit advanced communication protocol for the robot control and sensor data acquisition is covered in the chapter 7. Spark V ATMEGA16 robot can communicate with the PC using USB or XBee wireless module.
  • Page 88 USB. If any fault occurs then turn off the robot and remove the USB cable and repeat the same procedure. 6.3 Robot control using ZigBee wireless communication module Figure 6.2: Xbee Wireless USB Module from NEX Robotics © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 89 SPARK V ATMEGA16 Hardware Manual XBee USB Wireless Module from the NEX Robotics enables wireless transmission of serial data through PC’s USB port. It uses Xbee module for wireless communication. The Xbee module can be configured via PC’s USB port easily using X-CTU utility to change frequency, baud rate etc.
  • Page 90 COM port number is more than 10 then to change it refer to section 4.6.4. Specify the COM port in the terminal software Set the baud rate at 9600 bps © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 91 Now you are ready to transmit the data. Type the data into the text box and click send. For more information about using terminal software click help. Figure 6.7 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 92 Turn on the robot. Connect Robot’s USB cable or XBee USB wireless module to the PC. Make sure that Num lock of the keyboard is on. Use Numerical keypad to control robot. Figure 6.7 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 93 7. Robot Control using ‘GUI’ for SPARK V ATMEGA16 SPARK V ATMEGA16 robot can be controlled by GUI using USB cable or XBee USB wireless module. You need to load “GUI control.hex” on the robot and depending on the mode of communication (USB / Wireless) set the Jumper J5 in correct setting.
  • Page 94: Using Gui

    7.3 Using GUI Step 1: After successful installation go to Start -> All Programs -> SPARK V Atmega16 -> SPARK V Atmega16 or click on SPARK V Atmega16 on your desktop location, GUI will open. Figure 7.2: Selecting correct COM Port Step 2: Connect Robot with the PC via USB cable or XBee wireless communication module.
  • Page 95 USB or over wireless communication. It’s a simple byte based protocol in which upper nibble is command and lower nibble can be data or command. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 96 7.3.2 Commands to set direction of the robot: LEFT Command LEFT RIGHT RIGHT ( HEX ) DIRECTION FWD(LF) FWD(RF) BWD(RB) (LB) FORWARD REVERSE RIGHT (Left wheel forward, Right wheel backward) © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 97 The Robot will return an 8 bit analog value of the IR Proximity sensor 1 IR Proximity sensor 2 (Centre) The Robot will return an 8 bit analog value of the IR Proximity sensor 2 © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...
  • Page 98 Note: To get an actual pulse count, combine the lower byte and upper byte to get a 16 bit value. For more information on the position encoder resolution refer to the section 3.8. © NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA...