Enabling the Ultrasonic range sensors
ATMEGA16 microcontroller has only 8 ADCs. 3 ADC pins are shared between Ultrasonic
Range sensors and IR Proximity sensors. At any given sensor location either IR Proximity sensor
or Ultrasonic range sensor can be used. Both sensors can not remain active at the same time.
Figure 3.19 shows J2, J3 and J4 settings for enabling Ultrasonic range sensors. Jumpers are
marked with red border. To use Ultrasonic range sensor, place the 2 jumper caps of the jumper
corresponding to particular sensor towards "URF". Out of these two jumpers one jumper
connects power to the sensor and other connects microcontroller's ADC pin to the sensor output.
Figure 3.20: 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.
Figure 3.20 shows sensor daisy chaining. Sensor 1's TX pin is connected to the Sensor 2's RX
pin. In this way all 4 sensors are daisy chained. To enable the daisy chaining mode, pin "BW" of
the each ultrasonic sensor is tied to Vcc.
A small pulse trigger (more than 100uS) is given to the "RX" pin of the Sensor no. 1 from the
microcontroller's PD6 pin. 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.
Ultrasonic Range Sensor ADC channel number
Left
Center
Right
Table 3.6 Ultrasonic Range Sensor connections with ADC of the ATMEGA16 (after correct
© NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA
SPARK V ATMEGA16 Hardware Manual
ADC channel no. 0
ADC channel no. 1
ADC channel no. 2
jumper settings)
27
Need help?
Do you have a question about the SPARK V ATMEGA16 and is the answer not in the manual?