© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 1
Fire Bird V ATMEGA2560 Hardware Manual
FIRE BIRD V
HARDWARE MANUAL
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 2
Fire Bird V ATMEGA2560 Hardware Manual
Version 2.00
December 3, 2010
Documentation author
Sachitanand Malewar, NEX Robotics Pvt. Ltd.
Anant Malewar, NEX Robotics Pvt. Ltd. and M. Tech, IIT Bombay
Credits (Alphabetically)
Aditya Sharma, NEX Robotics
Amey Apte, NEX Robotics
Anant Malewar, EE, M.Tech, IIT Bombay
Ashish Gudhe, CSE, M.Tech, IIT Bombay
Behlul Sutarwala, NEX Robotics
Gaurav Lohar, NEX Robotics
Gurulingesh R. CSE, M.Tech, IIT Bombay
Inderpreet Arora, EE, M.Tech, IIT Bombay
Prof. Kavi Arya, CSE, IIT Bombay
Prof. Krithi Ramamritham, CSE, IIT Bombay
Kunal Joshi, NEX Robotics
Nandan Salunke, RA, CSE, IIT Bombay
Pratim Patil, NEX Robotics
Preeti Malik, RA, CSE, IIT Bombay
Prakhar Goyal, CSE, M.Tech, IIT Bombay
Raviraj Bhatane, RA, CSE, IIT Bombay
Rohit Chauhan, NEX Robotics
Rajanikant Sawant, NEX Robotics
Saurabh Bengali, RA, CSE, IIT Bombay
Vaibhav Daghe, RA, CSE, IIT Bombay
Vibhooti Verma, CSE, M.Tech, IIT Bombay
Vinod Desai, NEX Robotics
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 3
Fire Bird V ATMEGA2560 Hardware Manual
Notice
The contents of this manual are subject to change without notice. All efforts have been made to
ensure the accuracy of contents in this manual. However, should any errors be detected, NEX
Robotics welcomes your corrections. You can send us your queries / suggestions at
info@nex-robotics.com
Content of this manual is released under the Creative Commence cc by-nc-sa license. For legal
information refer to: http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode
Recycling:
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, CSE, IIT Bombay, INDIA 4
Fire Bird V ATMEGA2560 Hardware Manual
Important:
1. User must go through the Fire Bird V’s Hardware and Software manuals
before using the robot.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 5
Fire Bird V ATMEGA2560 Hardware Manual
Index
1. Introduction 7
4. Pin Functionality 66
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 6
Fire Bird V ATMEGA2560 Hardware Manual
1. Introduction
Thanks for choosing the Fire Bird V mobile robot platform. Fire Bird V will give you good
exposure to the world of robotics and embedded systems. Thanks to its innovative architecture
and adoption of the ‘Open Source Philosophy’ in its software and hardware design, you will be
able to create and contribute to complex applications that run on this platform, helping you
acquire expertise as you spend more time with them.
Safety precautions:
• Robot’s electronics is static sensitive. Use robot in static free environment.
• Read the assembling and operating instructions before working with the robot.
• If robot’s battery low buzzer starts beeping, immediately charge the batteries.
• To prevent fire hazard, do not expose the equipment to rain or moisture.
• Refrain from dismantling the unit or any of its accessories once robot is assembled.
• Charge the NiMH battery only with the charger provided with the robot.
• Never allow NiMH battery to deep discharge.
• Mount all the components with correct polarity.
• Keep wheels away from long hair or fur.
• Keep the robot away from the wet areas. Contact with water will damage the robot.
• To avoid risks of fall, keep your robot in a stable position.
• Do not attach any connectors while robot is powered ON.
• Never leave the robot powered ON when it is not in use.
• Disconnect the battery charger after charging the robot.
Inappropriate Operation:
Inappropriate operation can damage your robot. Inappropriate operation includes, but is not
limited to:
• Dropping the robot, running it off an edge, or otherwise operating it in an irresponsible
manner.
• Interfacing new hardware without considering compatibility
• Overloading the robot above its payload capacity.
• Exposing the robot to wet environments.
• Continuing to run the robot after hair, yarn, string, or any other item has become
entangled in the robot’s axles or wheels.
• All other forms of inappropriate operation.
• Using robot in areas prone to static electricity.
• Read carefully paragraphs marked with caution symbol.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 7
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 8
Fire Bird V ATMEGA2560 Hardware Manual
Fire Bird V Insect Fire Bird V Hexapod Fire Bird V 4WD with Gripper
Figure 2.3: Avatars of Fire Bird V Robot
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 9
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 10
Fire Bird V ATMEGA2560 Hardware Manual
Power:
9.6V, 2100mAh Nickel Metal Hydride (NiMH) battery pack and external Auxiliary power from
battery charger.
Battery Life:
2 Hours while motors are operational at 75% of time
Locomotion:
Two DC geared motors in differential drive configuration and caster wheel at front as support
• Top Speed: 24 cm / second
• Wheel Diameter: 51mm
• Position encoder: 30 pulses per revolution
• Position encoder resolution: 5.44 mm
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 11
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 12
Fire Bird V ATMEGA2560 Hardware Manual
3.1 Connections
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 13
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 14
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.6: Microcontroller adaptor board socket connection numbers on the main board
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 15
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.8: Connecting the battery on the Fire Bird V main board
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 16
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.7 shows the power switch. On the two sides of the power switch “BP” and “AP” is
marked. “BP” stands for Battery Power while “AP” stands for Auxiliary power. When robot is
powered by battery, it will turn on when power switch is moved towards “BP” and will get
turned of if switch is moved towards “AP”. Use of Auxiliary power to power the robot without
using onboard battery will be covered in subsequent sections.
For the safety during transportation, robot’s battery is disconnected. Before connecting battery to
the robot, make sure that robot is turned off. Move the power switch towards the “AP”. Figure
3.8 shows the battery connector. Insert the 10 pin FRC connector of the battery inside the
connector. To turn on the robot, move power switch towards the “BP”.
Fully charged NiMH batteries will get completely discharged with in a week. You need to charge
the robot batteries before using the robot. Robot is loaded with the program to move robot in
forward, backward, left and right.
Refer to section 3.4 for battery charging. For running the robot on battery power or auxiliary
power, refer to the section 3.5 and 3.6.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 17
Fire Bird V ATMEGA2560 Hardware Manual
3.3.1 Battery
Fire Bird V is powered by 9.6V, 2.1Ah rechargeable Nickel Metal Hydride battery pack. When
fully charged, battery pack gives 11.5V and when it is fully discharged, voltage drops to about
8.5V. Battery has built-in thermistor for monitoring battery temperature during battery charging.
The NiMH battery provided with Fire Bird V has 10 pin FRC connector which will fit into
the connector on the main board only in one orientation. Do not force the connection in any
other way.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 18
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 19
Fire Bird V ATMEGA2560 Hardware Manual
3. 5V System
“5V System” is used to power various modules of the robots which does not require high
current and where voltage stability is very important. It is used to power logic supply of the
ICs, sensing elements of the sensors, LCD etc. It is the most stable source of the supply on
the main board. It can source 400mA current for the external load.
4. 5V Sensor
“5V Sensor” is used to power the active elements of the sensor modules. Its voltage can
fluctuate by about 100mV, if sensors are turned on or off. In fully loaded Fire Bird V robot
this supply should not be used to power external load having current requirement more than
100mA.
Note: Apart from these three regulators Fire Bird V ATMEGA2560 has two voltage regulators
for powering microcontrollers and servo motors.
Sensor’s current sensing element is located between robot’s ground and the battery ground.
When no current is flowing through the sensor, it gives 2.5V output. This output value reduces
by 185mV / ampere of current flow if 5 Ampere type sensor is installed. If 20 Ampere type
sensor is installed value is reduced by 100mV / ampere. This sensor is an optional accessory.
When this sensor is absent its sensing path is shorted with 0 ohm resistor. For more information
on the sensor operation, refer to its datasheet which is located in the “Datasheets” folder of the
documentation CD.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 20
Fire Bird V ATMEGA2560 Hardware Manual
Fire Bird V robot uses 8 cell NiMH battery. When battery is fully discharged its voltage drops
below 8V. If robot is operated while battery is low, its performance will be inconsistent. To
prevent any abnormality in robot’s behavior battery low indication is used. When robot’s battery
voltage goes below 8V robot starts giving beeping sound.
Zener diode D1 produces stable 5.1V reference irrespective of change in the battery voltage. This
voltage is buffered by unity gain opamp module IC7B. Threshold value for the battery low
warning is set by the potentiometer R92. Its value is buffered using module IC7A. Reference
voltage and voltage form the potentiometer R92 are compared and difference is amplified with
the gain of 45.45 (100K / 2.2K) in the module IC7D. Output coming from the module IC7D is
buffered with IC7C unity gain opamp and given to the transistor Q5 which drives the battery low
warning buzzer.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 21
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.15 shows the smart battery charger for Fire Bird V robot. Battery charger checks state
of battery before initiating the charging process. If battery is deeply discharged it preconditions
the battery before starting full charging cycle. While charging the battery, by looking at battery
voltage, current and temperature it selects optimal charging algorithm.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 22
Fire Bird V ATMEGA2560 Hardware Manual
Important:
If you are using battery which is not used for long time then you have to charge it and
discharge it at least few times to bring the battery to its full storage capacity. To do this you
can load any motion program from the “Experiments” folder which is located in the
documentation CD and discharge the batteries after charging.
Note:
• If fault condition occurs, then wait for some time till battery is cooled down and start
battery charging again after some time. If problem persists then replace the battery.
• While battery is being charged robot will not turn on irrespective of the position of the
power switch.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 23
Fire Bird V ATMEGA2560 Hardware Manual
Warning:
Do not connect auxiliary power while battery is connected to the robot. In such case robot will
either run on the battery power or on auxiliary power depending on the position of the switch.
Robot will not get turned off.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 24
Fire Bird V ATMEGA2560 Hardware Manual
Motion control involves direction control and velocity control. Motors are controlled by L293D
dual motor driver which can provide up to 600mA of current to each motor. To change the
direction of the motor, appropriate logic levels (High/Low) are applied to L293D’s direction
control pins. Velocity control is done using Pulse Width Modulation (PWM).
LEDs are connected at the input and the output stage of the motor driver for quick interpretation
of the motion commands.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 25
Fire Bird V ATMEGA2560 Hardware Manual
Above figure shows the PWM waveforms for motor velocity control. In case (A), ON time is
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.
For the Fire Bird V ATMEGA2560 version, logic level for the motor direction control is given in
the table 3.4.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 26
Fire Bird V ATMEGA2560 Hardware Manual
PWM
LEFT LEFT RIGHT RIGHT PL3 (PWML) for
DIRECTION BWD (LB) FWD(LF) FWD(RF) BWD(RB) left motor
PA0 (L1) PA1 (L2) PA2 (R1) PA3 (R2) PL4 (PWMR) for
right motor
As per velocity
FORWARD 0 1 1 0
requirement
As per velocity
REVERSE 1 0 0 1
requirement
RIGHT (Left wheel
As per velocity
forward, Right wheel
0 1 0 1 requirement
backward)
LEFT(Left wheel
As per velocity
backward, Right wheel
1 0 1 0 requirement
forward,)
SOFT RIGHT(Left wheel
As per velocity
forward,, Right wheel
0 1 0 0 requirement
stop)
SOFT LEFT(Left wheel
As per velocity
stop, Right wheel
0 0 1 0 requirement
forward,)
SOFT RIGHT 2 (Left
As per velocity
wheel stop, Right wheel
0 0 0 1 requirement
backward)
SOFT LEFT 2 (Left
As per velocity
wheel backward, Right
1 0 0 0 requirement
wheel stop)
As per velocity
HARD STOP 0 0 0 0
requirement
SOFT STOP (Free
X X X X 0
running stop)
Table 3.4: Logic table for motor direction control
We can see all the commands given on the bargraph LED display which is located at the top
right side on the robot. Figure 3.21 shows the location and function of indicator LEDs related to
motion control.
Figure 3.21: Motion status LED indication on the Fire Bird V main board
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 27
Fire Bird V ATMEGA2560 Hardware Manual
Warning:
Auxiliary power can supply current up to 1 Ampere while Battery can supply current up to 2
Ampere. When both motors of the robot changes direction suddenly without stopping, it
produces large current surge. When robot is powered by Auxiliary power which can supply only
1 Ampere of current, sudden direction change in both the motors will cause current surge which
can reset the microcontroller because of sudden fall in voltage. It is a good practice to stop the
motors for at least 0.5seconds before changing the direction. This will also increase the useable
time of the fully charged battery.
Robot has two L293D motor drivers with four 6 pin relimate connectors for DC motors. Each 6
pin relimate connector provides connections for the DC motor and the associated position
encoder. Each connector can drive motor with up to 600mA current rating. Figure 3.19 shows the
locations of the two L293D dual motor drivers on the main board. Figure 3.22 shows the location
and pin numbers of the Motor connectors.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 28
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.23: Schematic of the motion control module and the position encoder
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 29
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.24: Motion status LED indication in terms of microcontroller adaptor socket pin
number
“5V system supply” is used for driving L293Ds logic circuits. “V Batt Mot” is used to supply
power for the motor. C22 – C25 and C29 – C32 is used for noise suppression. Logic signals to
drive the two L293D comes from the pins 47 to 55 and pins 66 to 68 of the microcontroller
adaptor board socket. Logic level on the pins 47 to 55 are also connected to the bar graph LED
display on the main board.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 30
Fire Bird V ATMEGA2560 Hardware Manual
L293D motor drivers on the main board can only provide current up to 600mA per motor. If you
want to drive bigger robot using Fire Bird V main board then remove L293D motor drivers from
the main board and connect high power external motor drivers to the External motor interface
port. Figure 3.22 shows the location of the external motor interface port. All the logic signals
coming from the pin 47 to 55 and ground pin is connected to this port. User can solder 20 pin
FRC connector at the bottom of the main board and interface these pins to the external motor
drivers. Up to 3 Hercules series 30Amp. Motor Drivers can be interface with this port. Logic
state on these pins can be observed on the bar graph LED display.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 31
Fire Bird V ATMEGA2560 Hardware Manual
Optical encoder MOC7811 is used for position encoder on the robot. It consists of IR LED and
the photo transistor mounted in front of each other separated by a slot in black opaque casing
with small slot shaped window facing each other. When IR light falls on the photo transistor it
gets in to saturation and gives logic 0 as the output. In absence of the IR light it gives logic 1 as
output. A slotted encoder disc is mounted on the wheel is placed in between the slot. When
encoder disc rotates it cuts IR illumination alternately because of which photo transistor gives
square pulse train as output. Output from the position encoder is cleaned using Schmitt trigger
based inverter (not gate) IC CD40106.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 32
Fire Bird V ATMEGA2560 Hardware Manual
Case 2: Robot is turning with one wheel rotating clockwise while other wheel is rotating
anti clockwise. Center of rotation is in the center of line passing through wheel axel and
both wheels are rotating in opposite direction (encoder resolution is in degrees)
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 33
Fire Bird V ATMEGA2560 Hardware Manual
Case 3: Robot is turning with one wheel stationary while other wheel is rotating clockwise
or anti clockwise. Center of rotation is center of the stationary wheel (encoder resolution is
in degrees)
In this case only one wheel is rotating and other wheel is stationary so robot will complete its
3600 rotation with stationary wheel as its center.
Radius of Circle formed in 3600 rotation of Robot = Distance between Wheels
= 15 cm
Pulses coming from the position encoders are indicated by position encoder LEDs on the
ATMEGA2560 board as shown in figure 3.28
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 34
Fire Bird V ATMEGA2560 Hardware Manual
* Connection of the position encoder input corresponding to Motor connector C1 to the INT 7
pin (Interrupt 7) of the microcontroller is disconnected by removing the pin no. 2 of the
CD40106 Schmitt trigger IC. Int. 7 pin is also used by Boot switch and TSOP1738 (if connected
by shorting the pad below TSOP1738.) This is done in order to simplify the shearing of this pin.
If you want to use position encoder of C1 motor then replace CD40106. In this case make sure
that pad which connects TSOP1738 with the pin INT7 is open.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 35
Fire Bird V ATMEGA2560 Hardware Manual
When light hits the obstacle and reflects back to the linear CCD array, depending on the distance
from the obstacle, angle of the reflected light varies. This angle is measured using the CCD array
to estimate distance from the obstacle. It gives same response to different colored objects as
measured distance is function of the angle of reflection and not on the reflected light intensity.
Figure 3.30 shows the internals of the sensor. Figure 3.31 explains how change in the distance
from the obstacle can be measured by measuring angle of reflection of the reflected light beam
from the obstacle. Since sensor measurement is based on triangulation and not on intensity of the
reflected light it is immune to disturbance caused by ambient light.
Sensor gives out analog voltage corresponding to angle of reflection. Relationship between the
angle of reflection and output voltage is not linear because of trigonometry involved. These
sensors have blind spot in the range of 0 to some specific distance depending on the type of the
sensor. In the blind spot region sensor gives incorrect readings. Table 3.9 gives information
about sensing range and the blind spot distance for the particular sensor.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 36
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.30: Infrared Range finder sensor and its inside view
Fire Bird V supports three types of IR range sensors from Sharp Microelectronics.
Figure 3.33: Distance Vs. Output voltage of GP2D120, GP2D12 and GP2Y0A02YK
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 37
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.33 shows the typical output character of the GP2D120, GP2D12 and GP2Y0A02YK
sensors. In these graphs X axis represents distance from the obstacle and Y axis represents the
output voltage. The sensor’s output characteristic is slightly logarithmic in nature hence to get
the distance in millimeters we have to use following formulas.
If a sensor emits some signal and senses any object based on the reflected signal then it is known
as active sensor. If many robots in the same field are using active sensors such as Sharp IR range
sensors, IR proximity sensors or ultrasound sensors then they will interfere with the sensors of
the other robots.
In order to avoid sensor interference between many robots, each Fire Bird V can switch all of its
active sensors on and off. This means that many Fire Bird series robots can work in same field
without causing interference with other Fire Bird robot’s sensor. Many robots can synchronize
when particular robot’s sensor should be turned on or off over wireless communication using
XBee wireless modules. Another advantage of this feature is that robot can turn off these sensors
when not in use to conserve power.
Figure 3.29 shows the location of the Sharp IR range sensors on the robot. They are numbered
from 1 to 5 in the clockwise direction. Figure 3.34 shows the schematics of the MOSFETs and
jumpers which controls switching on/off of the sensors. Sharp IR range sensor 1 and 5 are
controlled by the MOSFET Q4. Sharp IR range sensors 2, 3 and 4 are controlled by the
MOSFET Q2. These sensors can be permanently turned on by putting jumper J3 and J2 on the
main board. These jumpers short the drain and the source of the MOSFETs.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 38
Fire Bird V ATMEGA2560 Hardware Manual
In the normal case when input is less than 0.65V or there is no input at the Pin 35 and 40 of the
main board’s socket, corresponding transistors T16 and T9 are off. Gate of the MOSFETs Q4
and Q2 gets 5V which drives them in to saturation and sensors are turned on. When input voltage
more then 1V is applied at the Pin 35 and 40 of the main board’s socket, corresponding
transistors T16 and T9 goes in to saturation, there by grounding gates of the MOSFETs Q4 and
Q2 which turns off the MOSFETs and sensors are switched off.
Figure 3.35 shows the LEDs which indicates the power status of the active sensors.
Jumpers J2, J3 and J4 are shorted as the default factory setting. In order to enable sensor’s power
switching capability required jumpers should be removed.
Note:
• MOSFET Q2 also controls the turning on / off of the red LEDs of the white line sensors.
• If you are not going to switch sensors on / off using MOSFETs then corresponding
jumpers as per the table 3.10 should be shorted on to turn on sensors permanently.
• Sharp GP2Y0A02 sensors body is made up of conductive plastic. Hence foam tape is
added as an insulator between the sensor and the metal strip which holds the sensor in
place. If this isolation is not provided then sensor will get partially off when
corresponding MOSFET is turned off. In such case sensor will still consume power and
might give incorrect reading when sensor is turned off. To avoid this small insulator foam
is inserted between the sensor and the metal stripe which holds the sensor in place.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 39
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 40
Fire Bird V ATMEGA2560 Hardware Manual
In the absence of the obstacle there is no reflected light hence no leakage current will flow
through the photo diode and output voltage of the photodiode will be around 5V. As obstacle
comes closer, more light gets reflected and falls on the photo diode and leakage current flowing
through the photo diode starts to increase which causes voltage across the diode to fall.
IR photo diode consumes about 0.5mA when bright light drives the sensor in to saturation. IR
LED if enabled will consume about 30mA current each. When enabled 8 IR proximity sensors
combined together consumes about 250mA current. It is the biggest power consumer on the
robot after the motors. Refer to table 3.8, these sensors can be turned off by applying logic 1
(5V) to the pin no. 33 of the main board. To enable these sensors permanently connect the
jumper J4. For jumper location refer to figure 3.38. Operation of the sensor power switching
module is described in the previous section 3.10.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 41
Fire Bird V ATMEGA2560 Hardware Manual
To reduce interference with ambient light photo diode is cased in material which allows only IR
light to pass. While sensing obstacle in order to eliminate interference due to ambient light,
reading should be taken while IR LED is on and off. By comparing these two values effect of
ambient light can be nullified. To detect directional light intensity, IR LED is turned off and light
intensity at photo diode is measured.
Name Function
J1 LCD Backlight Enable/Disable
J2 Front Sharp and White line sensors Enable/Disable
J3 Side Sharp Sensors Enable/Disable
J4 IR Proximity(TCRT) Sensors Enable/Disable
M2 Front Sharp and White Line Sensors MOSFET
M3 IR Proximity (TCRT) MOSFET
M4 Side Sharp MOSFET
Table 3.12: Jumper functions
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 42
Fire Bird V ATMEGA2560 Hardware Manual
**For using Analog IR proximity (1, 2, 3 and 4) sensors short the jumper J2 on the
microcontroller adaptor board. For more details refer to section 3.19.6. To use JTAG via
expansion slot of the microcontroller socket remove these jumpers.
* MOSI, MISO, SCK and SS pins of ATMEGA2560 are associated to the ISP (In System
programming) port as well as the SPI interface to ATMEGA8. J4 needs to be disconnected
before doing ISP. To communicate with ATMEGA8 jumper J4 needs to be in place.
Note: IR Proximity sensor nos. 5, 6 and 7 are connected to the ADC pins of ATMEGA8 slave
microcontroller.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 43
Fire Bird V ATMEGA2560 Hardware Manual
When the robot is not on a white line, amount of light reflected is less hence less leakage current
flows through the photo transistor. In this case, the line sensor gives an output in the range of 2V
to 5V. When the sensor is on a white line, more light gets reflected resulting in considerable
increase in the leakage current which causes voltage across the sensor to fall between 2 to 0.1V.
Power to the red LEDs is controlled by MOSFET which can be turned off to extend robot’s
battery life. This feature is also very useful in advanced methods of line following in which
reflected light intensity from the surface is measured while red LEDs are on and off to nullify the
effect of the ambient light on the sensor reading. To turn on red LEDs permanently put jumper
on J4. J4 controls power to the red LED of white line sensors 1, 2 and 3 and Sharp sensors 2, 3
and 4. Refer to the table 3.12 and section 3.10 and 3.11 for more information on jumper settings.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 44
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.44: White line extension to mount 5 or 7 channel white line sensor
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 45
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 46
Fire Bird V ATMEGA2560 Hardware Manual
* MOSI, MISO, SCK and SS pins of ATMEGA2560 are associated to the ISP (In System
programming) port as well as the SPI interface to ATMEGA8. J4 needs to be disconnected
before doing ISP. To communicate with ATMEGA8 jumper J4 needs to be in place.
The EN line is called "Enable" and it is connected to PC2. This control line is used to tell the
LCD that microcontroller has sent data to it or microcontroller is ready to receive data from
LCD. This is indicated by a high-to-low transition on this line. To send data to the LCD, program
should make sure that this line is low (0) and then set the other two control lines as required and
put data on the data bus. When this is done, make EN high (1) and wait for the minimum amount
of time as specified by the LCD datasheet, and end by bringing it to low (0) again.
The RS line is the "Register Select" line and it is connected to PC0. When RS is low (0), the data
is treated as a command or special instruction by the LCD (such as clear screen, position cursor,
etc.). When RS is high (1), the data being sent is treated as text data which should be displayed
on the screen.
The RW line is the "Read/Write" control line and it is connected to PC1. When RW is low (0),
the information on the data bus is being written to the LCD. When RW is high (1), the program
is effectively querying (or reading from) the LCD.
The data bus is bidirectional, 4 bit wide and is connected to PC4 to PC7 of the microcontroller.
The MSB bit (DB7) of data bus is also used as a Busy flag. When the Busy flag is 1, the LCD is
in internal operation mode, and the next instruction will not be accepted. When RS = 0 and R/W
= 1, the Busy flag is output on DB7. The next instruction must be written after ensuring that the
busy flag is 0.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 47
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 48
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 49
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.54: Serial port connections with the main board socket
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 50
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.55: USB port connections with the main board socket
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 51
Fire Bird V ATMEGA2560 Hardware Manual
Important:
You can change XBee wireless module’s frequency, and Pan ID so that multiple XBee wireless
modules can coexist at the same time. For more information on this, refer to “Application Notes”
folder which is located inside the “Manuals and Application notes” folder in the documentation
CD.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 52
Fire Bird V ATMEGA2560 Hardware Manual
Power management block on the ATMEGA2560 microcontroller adapter board provides power
to the microcontroller, other devices and the power to the servo motor.
ATMEGA2560 microcontroller adapter board has two low drop voltage regulators:
1. “5V uC” supplies power to the microcontroller and its peripherals.
2. “5V servo” supplies power to the servo motor.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 53
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 54
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.62: Jumper to be shorted to connect TSOP1738 with INT7 (shorted jumper is
shown in the right image)
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 55
Fire Bird V ATMEGA2560 Hardware Manual
ATMEGA2560 is a featur rich microcontroller with lots of available I/O ports. Many of the
ports are available on the uC Expansion Socket. Table 3.21 lists the connection details of all the
pins of the socket.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 56
Fire Bird V ATMEGA2560 Hardware Manual
Note:
* In order to use these pins as JTAG or as ADC for external sensor interfacing, remove all 4
connectors for the jumper 2 of the microcontroller board. When jumpers are removed IR
Proximity sensor 1 to 4 will be disconnected from the robot.
** Pins can be used as SPI bus. These pins are already connected to slave ATMEGA8
microcontroller via J4 of the microcontroller board. Before using it as SPI bus for external device
interfacing, remove J4 to disconnect ATMEGA8 slave microcontroller or use different pin of the
microcontroller as SS (slave select).
*** All the pins of the PORTJ are connected to the bargraph LED display. While using these
pins as GPIO to turnoff this bargraph LED display, remove jumper J3 of the microcontroller
board.
**** PJ0 and PJ1 can be used as GPIO as well as TXD and RXD for UART 3. These pins are
also connected to bargraph LED display. While using these pins as UART 3, jumper J3 must be
removed to disable bargraph LED display in order to avoid loading on the TXD and RXD lines
of the device which is connected with the ATMEGA2560 microcontroller.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 57
Fire Bird V ATMEGA2560 Hardware Manual
Servo pod socket is used to connect external sensors / actuators which are mounted on pan / tilt
servo pod.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 58
Fire Bird V ATMEGA2560 Hardware Manual
Microcontroller board has 4 jumpers labeled from J1 to J4 as shown in Figure 3.58 and figure
3.66.
J1: Jumper J1 is used to select between the UART2 pins connections of ATMEGA2560 on the
expansion slot and to the onboard FT232 USB to serial converter circuit. When jumper is in
position as shown in the figure 3.66, it enables the onboard USB communication through
UART2 (default state).
J2: When J2 is on IR Proximity sensors 1 to 4 are connected to the ADC pins of the
ATMEGA2560. When J2 is open, same ADC pins can be used for JTAG on the uC expansion
socket or as ADCs for external sensor interfacing. In the default state J2 is on.
J3: If J3 is on, all the pins of the PORT J are connected to the LED bargraph display. It can be
used for quick message display for debug purpose. If J3 is off, LED connection is disabled. All
the pins of the PORT J are available on the uC expansion socket for use as GPIOs. In the default
state J3 is kept on.
J4: When J4 is on, SPI connection between ATMEGA2560 (master) and ATMEGA8 (slave)
enabled. Since SPI lines are connected together ISP programming of ATMEGA2560 and
ATMEGA8 can not be done. When J4 is off, Communication between ATMEGA2560 and
ATMEGA8 is disabled and ISP programming of ATMEGA2560 and ATMEGA8 can be done.
In the default condition J4 is kept open. If you use bootloader option then you don’t have to
remove the J4 while programming the ATMEGA2560 microcontroller.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 59
Fire Bird V ATMEGA2560 Hardware Manual
ATMEGA2560 microcontroller adapter board has ISP sockets for the ATMEGA2560 and
ATMEGA8 microcontrollers.
FT232 is a USB to TTL level serial converter. It is used for adding USB connectivity to the
microcontroller adaptor board. With onboard USB circuit Fire Bird V can communicate serially
with the PC through USB port without the use of any external USB to Serial converter. The
USBD- and USBD+ pins are connected to USB socket on the main board. TX and RX LEDs are
the indicator LEDs situated near the FT232 IC. Refer to figure 3.58 for LED locations. To enable
USB to serial communication jumper J1 should be configured in a particular way. Refer to
section 3.19.6 for correct jumper settings.
Note: Using bootloader from NEX Robotics Robot can be programmed directly via USB port
without any need of external ISP programmer.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 60
Fire Bird V ATMEGA2560 Hardware Manual
MAX202 IC is used for conversion of the TTL level signal of the UART 1 to the RS232 level. It
is connected to the DB9 female serial connector on the main board. For more details on the
hardware connections refer to section 3.16.
ATMEGA2560 microcontroller’s ADC channels require external stable voltage reference. In the
default state microcontroller uses “5V uC Supply” as a external reference voltage. In case if you
want to interface microcontroller with the sensors where precision is very important then
REF5050 external reference voltage generator can be added on the microcontroller board. In the
default state voltage reference is directly taken from “5V uC supply” by connecting pins 2 and 1
of the pads of SJ1 which is located just below the J2 on the microcontroller board.
To connect REF5050 with the microcontroller, pins 1 and 2 needs to be unsoldered and pins 2
and 3 needs to be shorted and REF5050 to be added.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 61
Fire Bird V ATMEGA2560 Hardware Manual
Figure 3.71: Left- Jumper shorted to use 5V uC as A Ref. Right- REF5050 is installed and
jumper shorted to use its 5V output as reference.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 62
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 63
Fire Bird V ATMEGA2560 Hardware Manual
Note: Firmware (ATMEGA8.hex ) for the ATMEGA8 microcontroller is located in the GUI and
Related Firmware folder in the documentation CD.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 64
Fire Bird V ATMEGA2560 Hardware Manual
ATMEGA2560 is interfaced directly to most of the onboard peripherals. Its schematic is shown
in the figure 3.78.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 65
Fire Bird V ATMEGA2560 Hardware Manual
4. Pin Functionality
Fire Bird V ATMEGA2560 microcontroller adaptor board has two microcontrollers.
ATMEGA2560 (master microcontroller) and ATMEGA8 (slave) microcontroller.
ATMEGA2560 communicates with ATMEGA8 using SPI bus.
ATMEGA2560 is interfaced to all the important modules for the robot while ATMEGA8
microcontroller is interfaced with non critical modules such as IR proximity sensors 6, 7, 8,
Robot current sensing (if ACS712 current sensor is installed), extended white line sensor
channels 4, 5, 6, 7 and pin on the servo expansion port.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 66
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 67
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 68
Fire Bird V ATMEGA2560 Hardware Manual
* Not used pins are by default initialized to input and kept floating. These pins are available on
the expansion slot of the ATMEGA2560 microcontroller adaptor board. Some pins are especially
reserved for servo motor interfacing for the Fire Bird V Hexapod robot.
** MOSI, MISO, SCK and SS pins of ATMEGA2560 are associated to the ISP (In System
programming) port as well as the SPI interface to ATMEGA8. J4 needs to be disconnected
before doing ISP. To communicate with ATMEGA8 jumper J4 needs to be in place. For more
details refer to section 3.19.6.
*** PORTB pin5, 6, 7 are OC1A, OC1B, OC1C of the Timer1. These pins are connected to the
servo motor sockets S1, S2, S3 on the microcontroller adaptor board.
**** External Crystal of 32 KHz is connected to the pins PG3 and PG4 to generate clock for
RTC (Real Time Clock).
***** For using Analog IR proximity (1, 2, 3 and 4) sensors short the jumper J2. To use JTAG
or interface external analog sensors via expansion slot of the microcontroller socket remove
these jumpers.
****** AREF can be obtained from the 5V microcontroller or 5V analog reference generator IC
REF5050 (optional). For more details refer to section 3.19.9.
******* Sensor’s switching can be controlled only is if corresponding jumpers are open. For
more details refer to section 3.11 and 3.12.
J2: Sharp IR range sensor 2, 3, 4 and red LEDs of white line sensors;
J3: Sharp IR range sensor 1, 5;
J4: IR proximity sensors 1 to 8;
******** External interrupt from the position encoder C1 is disabled by removing pin 2 of the
CD40106 Schmitt trigger inverter buffer to avoid its wire anding with the interrupt switch.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 69
Fire Bird V ATMEGA2560 Hardware Manual
* MOSI, MISO, SCK and SS pins of ATMEGA2560 are associated to the ISP (In System
programming) port as well as the SPI interface to ATMEGA8. J4 needs to be disconnected
before doing ISP. To communicate with ATMEGA8 jumper J4 needs to be in place. For more
details refer to chapter 3.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 70
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 71
Fire Bird V ATMEGA2560 Hardware Manual
Note:
* In order to use these pins as JTAG or as ADC for external sensor interfacing, remove all 4
connectors for the jumper 2 of the microcontroller board. When jumpers are removed IR
Proximity sensor 1 to 4 will be disconnected from the robot.
** Pins can be used as SPI bus. These pins are already connected to slave ATMEGA8
microcontroller via J4 of the microcontroller board. Before using it as a SPI bus for external
device interfacing, remove J4 to disconnect ATMEGA8 slave microcontroller or use different
pin of the microcontroller as SS (slave select).
*** All the pins of the PORTJ are connected to the bargraph LED display. While using these
pins as GPIO to turnoff this bargraph LED display, remove jumper J3 of the microcontroller
board.
**** PJ0 and PJ1 can be used as GPIO as well as TXD and RXD for UART 3. These pins are
also connected to bargraph LED display. While using these pins as UART 3, jumper J3 must be
removed to disable bargraph LED display in order to avoid loading on the TXD and RXD lines
of the device which is connected with the ATMEGA2560 microcontroller.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 72
Fire Bird V ATMEGA2560 Hardware Manual
Figure 4.2: Microcontroller adaptor board socket connections on the main board
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 73
Fire Bird V ATMEGA2560 Hardware Manual
11 SHARP IR Range Sensor 1 ATMEGA2560 ADC9 Analog output of Sharp IR range Sensor 1
12 IR Proximity Sensor 1 ATMEGA2560 ADC4 Analog output of IR Proximity sensor 1
13 XBee RXD UART0 of ATMEGA2560 XBee wireless module Serial data in
14 XBee TXD UART0 of ATMEGA2560 XBee wireless module Serial data out
15 SHARP IR Range Sensor 2 ATMEGA2560 ADC10 Analog output of Sharp IR range sensor 2
16 IR Proximity Sensor 2 ATMEGA2560 ADC5 Analog output of IR Proximity sensor 2
17 Not used
18 MOSI ATMEGA2560 Pin 21 SPI Communication lines for
19 MISO ATMEGA2560 Pin 22 communication with ATMEGA8 via
20 SCK ATMEGA2560 Pin 20 Jumper 4 and for programming
21 SSI ATMEGA2560 Pin 19 ATMEGA2560 in ISP mode
22 RS ATMEGA2560 PC0 LCD Register Select pin (Command)
23 RW ATMEGA2560 PC1 LCD Read Write pin (Command)
24 EN ATMEGA2560 PC2 LCD Enable pin (Command)
25 DB5 ATMEGA2560 PC5 LCD data bit 5
26 DB4 ATMEGA2560 PC4 LCD data bit 4
27 DB6 ATMEGA2560 PC6 LCD data bit 6
28 DB7 ATMEGA2560 PC7 LCD data bit 7
29 V Battery System ATMEGA2560 ADC0 V Battery System (9V to 11.4V depending
on battery status). Unregulated Supply for
additional module interfacing. Maximum
current capacity: 1Amp
32 White Line Sensor 1 ATMEGA2560 ADC3 Analog output of white line sensor 1
31 White Line Sensor 2 ATMEGA2560 ADC2 Analog output of white line sensor 2
32 White Line Sensor 3 ATMEGA2560 ADC1 Analog output of white line sensor 3
33 IR Proximity Sensor ATMEGA2560 PH3 TTL/CMOS input. Disable IR proximity
Disable sensors when V>2 is applied. When
V<0.65 IR proximity sensors are turned
on.
34 Sharp IR Sensors 1and 5 ATMEGA2560 PH2 TTL/CMOS input. Disable Sharp IR range
Disable sensors 1 and 5 when V>2 is applied.
When V<0.65 sharp sensors 1 and 5 are
turned on.
35 5V System Not connected 5V system Voltage. Can be used for
powering up any digital device. Current
Limit: 400mA.
36 White Line 4 ATMEGA8 ADC0 Analog output of white line sensor 4
37 White Line 5 ATMEGA8 ADC1 Analog output of white line sensor 5
38 White Line 6 ATMEGA8 ADC2 Analog output of white line sensor 6
39 White Line 7 ATMEGA8 ADC3 Analog output of white line sensor 7
40 Sharp IR Range Sensors ATMEGA2560 PG2 TTL/CMOS input. Disable Sharp IR range
2,3,4 and White Line sensors 2, 3, 4 and White line sensors
Sensors Disable when V>2 is applied. When V<0.65 sharp
sensors 2, 3, 4 and white line sensors are
turned on.
41 Sharp IR Range Finder 3 ATMEGA2560 ADC11 Analog output of Sharp IR range sensor 3
42 IR Proximity Sensor 3 ATMEGA2560 ADC6 Analog output of IR Proximity sensor 3
43 IR Proximity Sensor 4 ATMEGA2560 ADC7 Analog output of IR Proximity sensor 4
44 Sharp IR Range Finder 4 ATMEGA2560 ADC12 Analog output of Sharp IR Range sensor 4
45 Sharp IR Range Finder 5 ATMEGA2560 ADC13 Analog output of Sharp IR Range sensor 5
46 IR Proximity Sensor 5 ATMEGA2560 ADC8 Analog output of IR Proximity sensor 5
47 C1 1 ATMEGA2560 PA4 Logic input 1 for C1 motor drive
48 C1 PWM ATMEGA2560 OC5C PWM input for C1 motor drive
49 C1 2 ATMEGA2560 PA45 Logic input 2 for C1 motor drive
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 74
Fire Bird V ATMEGA2560 Hardware Manual
Note:
* CS will give output only if ACS712 hall effect current sensor is soldered on the main board
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 75
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 76
Fire Bird V ATMEGA2560 Hardware Manual
Figure 5.4: Set jumpers as per the requirements (for more details refer to chapter 3)
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 77
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 78
Fire Bird V ATMEGA2560 Hardware Manual
Figure 5.8: Remove front cover of the white connector of the Sharp IR range sensor
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 79
Fire Bird V ATMEGA2560 Hardware Manual
Step 2: Mount the 20mm studs on the main board on the position where sharp sensor is to be
fitted. In figure 5.10 area highlighted with the red border shows the mounted studs from the
Sharp IR range sensor mounting kit.
Figure 5.10: Mount 20mm studs from the Sharp sensor mounting kit
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 80
Fire Bird V ATMEGA2560 Hardware Manual
Figure 5.12: Fitting metal plate on top of the Sharp IR range sensor
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 81
Fire Bird V ATMEGA2560 Hardware Manual
Do not apply extreme pressure while pressing down the sharp sensors to fit into the
socket.
Make sure that you remove yellow paper before mounting the metal plate on the Sharp IR
range sensor.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 82
Fire Bird V ATMEGA2560 Hardware Manual
Table 6.1 shows the simple robot control protocol. Using this, robot can be moved in forward,
backward, left or right directions and its buzzer can be turned on or off. You can use any serial
port control software such as hyper terminal or terminal.exe etc. For user friendliness keys of the
numerical pad of standard 104 keys “querty” keyboards are used. When a particular number key
is pressed, its ASCII character value is transmitted over serial / USB port. Robot receives this
ASCII values and based on its value it actuates its motors, buzzer etc. Keys are mapped in the
intuitive way on the Numerical pad of the keyboard.
This communication protocol is covered in the following experiments which are located in the
“Experiments” folder in the documentation CD. All these experiments are exactly same only
UART port number is different.
Section 6.2 and 6.3 covers robot control using PC’s USB port and XBee wireless module.
Important:
While using “Numerical Pad” of the key board, make sure that “Num. Lock” is on.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 83
Fire Bird V ATMEGA2560 Hardware Manual
UART1 of the ATMEGA2560 microcontroller is connected to the serial port via MAX202
UART to RS232 converter. For robot control over RS232 serial port application example we
need to load “13A_Serial_Communication.hex” on the robot which is located in the
“Experiments” folder in the documentation CD.
For robot control over serial port we use Terminal software from NEX Robotics. It is located in
the “Software” folder in the documentation CD. Installation and the use of the terminal software
from NEX Robotics is covered in the section 6.7.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 84
Fire Bird V ATMEGA2560 Hardware Manual
FT232 USB to serial converter can be connected with UART 2 of the ATMEGA2560
microcontroller via Jumper J1. Figure 6.2 shows the correct jumper setting for connecting FT232
with the microcontroller.
Before using USB port we need to install the driver software for FT232 USB to serial converter.
The software is located in the “Software and Drivers \ CDM 2.06.00 WHQL Certified” folder.
For driver installation process refer to section 6.5.
For robot control over serial port we use Terminal software from NEX Robotics. It is located in
the “Software” folder in the documentation CD. Installation and the use of the terminal software
from NEX Robotics is covered in the section 6.7.
Important:
• When using USB port for the communication, for proper operation first turn on the robot
then insert the 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.
• Make sure that jumper is configured to enable USB communication. Jumpers should be
in the position as shown in the Figure 6.2.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 85
Fire Bird V ATMEGA2560 Hardware Manual
Fire Bird V ATMEGA2560 has onboard socket for XBee and XBee Pro modules from Digi
International. For robot to PC communication we need to install XBee wireless module on the
robot and XBee USB wireless module for connection with the PC. XBee wireless module is
connected to the UART 0 of the ATMEGA2560 microcontroller. For Robot control over
wireless link we need to load “13C_Serial_Communication_ZigBee_wireless.hex” on the robot
which is located in the “Experiments” folder in the documentation CD. For XBee wireless
module installation on the robot, refer to chapter 5.
XBee USB wireless module has onboard FT232 USB to serial converter. You need to install
drivers for FT232 USB to serial converter before starting communication. software is located in
the “Software and Drivers \ CDM 2.06.00 WHQL Certified” folder. For driver installation
process refer to section 6.5.
For robot control over serial port we use Terminal software from NEX Robotics. It is located in
the “Software” folder in the documentation CD. Installation and the use of the terminal software
from NEX Robotics is covered in the section 6.7.
Important:
• XBee wireless modules are factory set at the 9600 bps. While shipping with the robot
they are set at 115200 bps by NEX Robotics using XCTU software. Application example
“13C_Serial_Communication_ZigBee_wireless.hex” requires 9600 bps. For this
application you need to set baud rate at 9600 bps. How to change the baud rate of the
XBee wireless module using XCTU software is covered in the application note which is
located in the “Manuals and Application notes” folder in the documentation CD.
• Wait for at least 8 seconds to start the wireless communication after turning on the robot
and the USB wireless module.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 86
Fire Bird V ATMEGA2560 Hardware Manual
Figure 6.4
Step 4:
Check on the radio button “No, not this time” and then click on the next button.
Figure 6.5
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 87
Fire Bird V ATMEGA2560 Hardware Manual
Figure 6.6
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 6.7
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 88
Fire Bird V ATMEGA2560 Hardware Manual
Step 6:
On clicking next driver installation will begin.
Figure 6.8
Step 7:
On successfully installing the driver following window will appear. Click Finish to complete the
installation.
Figure 6.9
After installation of FT232 USB UART software, PC may ask for USB serial port software. To
install this software follow steps 1 to 7 of USB serial converter software installation.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 89
Fire Bird V ATMEGA2560 Hardware Manual
6.6 Identifying and changing COM Port number of the USB to serial
converter or XBee USB wireless module
In some software you may need to tell the COM port number before establishing
communication. Follow these steps to identify or change the COM port number. Don’t change
the COM port number unless it is absolutely necessary. It may result in making some of your
software unstable.
Step 1:
Right Click My Computer and click on properties. System properties window will appear.
Figure 6.10
Step 2:
Click on the Device manager in the Hardware tab.
Figure 6.11
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 90
Fire Bird V ATMEGA2560 Hardware Manual
Step 3:
Expand Ports (Com & LPT) tree. COM Port number is mentioned in the parenthesis next to USB
Serial Port.
Figure 6.12
Step 4:
You can change the port number by right clicking on “USB serial Port” and select properties.
Figure 6.13
In the Port settings tab click on the Advanced button, the following window will appear.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 91
Fire Bird V ATMEGA2560 Hardware Manual
Step 5:
Select the new COM port number and click ok.
Figure 6.14
6.7 Use of Terminal software from NEX Robotics for Robot control
Terminal is easy to use free software for serial communication written by NEX Robotics. It is
located in the “Software and Drivers” folder in the documentation CD. In the following example
we will be using Serial communication protocol covered in the section 6.
Connect Serial / USB cable between robot and PC or connect XBee wireless module on the robot
and connect XBee USB wireless module on the PC and load correct .hex file on the robot as
mentioned in the sections 6.2, 6.3 and 6.4. Pay special attention to the text highlighted as
“important”.
6.7.1 Terminal Software Installation
Step 1:
Copy Terminal software setup from the “Software” folder of the documentation CD to PC. To
start installation process click on the “Setup” thumbnail (not “Terminal Setup” thumbnail).
Step 2:
Go through the installation process and select correct options to complete the installation.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 92
Fire Bird V ATMEGA2560 Hardware Manual
Figure 6.15
Figure 6.16
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 93
Fire Bird V ATMEGA2560 Hardware Manual
Step 1:
Connect any device which is to be used to USB / serial port. Install its driver.
Go to Start menu and click on the Serial Terminal.
Figure 6.17
Terminal software will open.
Figure 6.18
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 94
Fire Bird V ATMEGA2560 Hardware Manual
Step 2:
Select the COM port. If required, identify the COM port (refer to section 6.6)
Set the baud rate at 9600bps, Data Mode as text and press connect.
Figure 6.19
Step 3:
Make the Num lock on for the keyboard.
Load proper firmware (.hex file) on the robot as per the mode of communication (refer to section
6.2, 6.3 and 6.4).
Turn on the robot. Connect the Serial / USB wire or XBee wireless link between robot and PC
Use number keys of the key pad to control the robot.
For control commands refer to table 6.1.
Figure 6.20
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 95
Fire Bird V ATMEGA2560 Hardware Manual
Refer to figure 6.20. Serial Terminal software has 3 windows. In the middle window you can
type data to be sent. You can also send a single number of the strings of numbers
To send the ASCII value of the character typed select Data Mode as text. It you want to send
HEX data then select hex button in the Data Mode frame.
In all three application examples mentioned in section 6.2, 6.3 and 6.4 robot sends back echo of
the received data apart from executing the motion commands.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 96
Fire Bird V ATMEGA2560 Hardware Manual
Step 1:
Following firmware (.hex file) needs to be loaded on the robot depending on the mode of
communication used.
RS232 serial communication: “GUI_ control_serial.hex”
USB communication: “GUI control USB.hex”
ZigBee wireless module based communication: “GUI_control_wireless.hex”
All these hex files are located in the “GUI and Related Firmware” folder.
For information on how to load hex file, refer to software manual.
Step 2: Connect serial / USB to serial converter cable between robot and PC or install ZigBee
wireless module on the robot and connect wireless ZigBee USB module to the PC. For
connections refer to section 6.2 to 6.6.
Step 3: Install GUI software
Step 3: Browse the location where set up will install or set the default location and click Next
Button to start the installation.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 97
Fire Bird V ATMEGA2560 Hardware Manual
Figure 7.1
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 98
Fire Bird V ATMEGA2560 Hardware Manual
Step 3: If serial port is used then select COM Port as 1. If USB to serial converter module from
NEX Robotics or USB ZigBee wireless module is used then GUI automatically identifies the
COM port number. To manually identify the COM port, refer to section 6.6. Select the correct
COM port number and click on connect.
Now robot can be controlled using GUI
Warning:
While using USB communication, ensure that the appropriate jumpers are in place. For more
details refer section 6.3 USB based communication.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 99
Fire Bird V ATMEGA2560 Hardware Manual
Step 4:
If you have Wireless camera pod from NEX Robotics and USB TV Tuner card then you can also
see the video on the GUI.
For more information on the installation and usage process, refer to documentation of the
wireless camera pod.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 100
Fire Bird V ATMEGA2560 Hardware Manual
• In case of XBee wireless module wait for atleast 8 seconds to establish the
communication after turning on the robot and connecting XBee USB wireless module
with the PC.
To control robot in wired or wireless mode load the respective firmware on the robot which are
located in the “GUI and Related Firmware” folder inside the documentation CD.
Read chapter 6 carefully for configuring the ports, setting correct jumpers, installing devices and
their device drivers.
This is a simple byte based protocol. Fire Bird V ATMEGA2560 robot uses more complex
packet based protocol which can also be used for efficient robot control.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 101
Fire Bird V ATMEGA2560 Hardware Manual
To set the speed of the left motor to 0xAB, follow the sequence of commands below. Attach
lower nibble “B” with command 1 and upper nibble A with command 2.
Step1: Send 0x1B Load the lower nibble of the left motor speed in the robot.
Step2: Delay of at least 3 milliseconds
Step3: Send 0x2A Load the upper nibble of the left motor speed in the robot and execute the
command
Step4: Delay of at least 3 milliseconds before loading next command
Note: It is very important that you send the byte containing command 1 first and then send the
byte containing command 2 for proper operation. The same rule is applicable for commands 3
and 4.
7.5.2 Commands to set direction of the robot:
LEFT
Command LEFT RIGHT RIGHT
BWD
( HEX ) DIRECTION FWD(LF) FWD(RF) BWD(RB)
(LB)
PA1 PA2 PA3
PA0
51 FORWARD 0 1 1 0
52 REVERSE 1 0 0 1
RIGHT (Left wheel
53 forward, Right wheel
0 1 0 1
backward)
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 102
Fire Bird V ATMEGA2560 Hardware Manual
LEFT(Left wheel
54 backward, Right
1 0 1 0
wheel forward,)
SOFT RIGHT(Left
55 wheel forward,,
0 1 0 0
Right wheel stop)
SOFT LEFT(Left
56 wheel stop, Right
0 0 1 0
wheel forward,)
SOFT RIGHT 2
(Left wheel stop,
57
Right wheel 0 0 0 1
backward)
SOFT LEFT 2 (Left
58 wheel backward,
1 0 0 0
Right wheel stop)
59 HARD STOP 0 0 0 0
Table 7.2
Example: To set left motor velocity to 0x84, right motor velocity to 0x65, and move
backward.
Step1: 0x14 Load the lower nibble ‘4’ of the left motor speed into the robot
Step2: Delay of at least 3 milliseconds
Step3: 0x28 Load the upper nibble ‘8’ of the left motor speed into the robot and execute the
command
Step4: Delay of at least 3 milliseconds
Step5: 0x35 Load the lower nibble ‘5’ of the right motor speed into the robot
Step6: Delay of at least 3 milliseconds
Step7: 0x46 Load the upper nibble ‘6’ of the right motor speed into the robot and execute the
command
Step8: Delay of at least 3 milliseconds
Step9: 0x52 move backward
Step10: Delay of at least 3 milliseconds before loading next command
7.5.3 Commands to access the Analog sensor data:
Command Data
(HEX)
60 Battery voltage
Robot sends back 8 bit battery voltage value. To convert this
value in to volts use the following conversion formula for 8
bit ADC resolution: Battery Voltage = ADC data x 0.069
62 Front Sharp IR range sensor data (Front distance)
The Robot will return 8 bit value which indicates distance
between the obstacle and front Sharp sensor.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 103
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 104
Fire Bird V ATMEGA2560 Hardware Manual
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.9.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 105
Fire Bird V ATMEGA2560 Hardware Manual
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA 106