Enabling the Ultrasonic range sensors
The analog output of sharp sensor and analog output of Ultrasonic sensor is connected to the
same ADC channels of the microcontroller. Therefore at any given sensor location either Sharp
sensor or Ultrasonic range sensor can be used. Both sensors can not remain active at the same
time.
Figure 3.44b: Ultrasonic range sensor daisy chaining (courtesy: MaxBotix website)
If many of the sensors transmit ultrasound simultaneously their reading will get mixed-up. In
order to prevent this, all the ultrasonic sensors are connected in the daisy chain. Microcontroller
sends a trigger to the first ultrasonic sensor. First sensor takes the distance reading and sends
trigger to the second sensor. Second sensor follows the same process. This makes sure that at any
given time only one sensor transmits ultrasound.
Above figure shows sensor daisy chaining. Sensor 1's TX pin is connected to the Sensor 2's RX
pin and so on. In this way all 5 sensors are daisy chained. To enable the daisy chaining mode, pin
"BW" of the each ultrasonic sensor must be tied to Vcc. All sensors are powered at 3.3V sensor
supply.
To start taking reading a small trigger pules of more than 100uS needs to be given to the "RX"
pin of the first sensor. This pin is connected to the pin PH4 of the ATMEGA2560
microcontroller via pin 17B* of the main board socket. "RX" pin of the 5
sensor is left open. After triggering a Sensor 1, Sensor 1 transmits ultrasonic pulse and gives out
distance reading within 49mS. Sensor 1 triggers the Sensor 2 by transmitting a small pulse on its
TX pin to the RX pin of the second sensor. Now Sensor 2 takes reading. In this way sensor in the
daisy chain takes distance reading one at a time and triggers the next sensor connected. After all
5 sensors takes reading this process stops. You need to give trigger at the 1
You can trigger 1
st
sensor at the interval of 49ms x 5 sensors = 245ms if you want to insure that
only one sensor remains active at a time. This is the most recommended time interval. It is also
possible to keep more than one sensor preferably 90 degrees apart active by giving trigger at the
interval of 49ms x 2 sensors = 98mS for faster refresh rate but readings may get affected in small
room because of echos from other sensors. Figure 3.44c shows the schematics of the ultrasonic
ranges sensors.
*. We need to cut the track of 17B to PH4 pin at bottom side of microcontroller board, please refer the errata section
in this manual.
Important
1. You need to connect pin BW of the ultrasonic range sensor to the 3.3V manually.
2. If you want to install only one ultrasonic sensor, say sensor number 3 then you need to
short(hard wire) the pins "TX" and "RX" of the sensors which comes before this sensor
(in this case 1 and 2), so that trigger from microcontroller can reach the installed sensor.
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA
Fire Bird V ATMEGA2560 Hardware Manual
st
sensor again.
th
ultrasonic range
55
Need help?
Do you have a question about the FIREBIRD V ATMEGA 2560 and is the answer not in the manual?