using-multiple-ultrasonic-sensors
using-multiple-ultrasonic-sensors
When using a single ultrasonic sensor, typically it is possible to just let it range
continuously in free run mode. This method is easy and works well.
Please consult your sensor datasheet or Finding Distance Using Analog Voltage for
calculation formulas for analog voltage to distance.
Slowly the sensors will stop ranging at the same time. These frequency drifts will
likely cause interference between sensors for most applications. If looking at the
analog voltage output from the MaxSonar®, this will appear as voltage noise that
occurs at some regularly occurring rates. Additionally, the digital outputs will have
phantom readings at some regularly occurring rates.
(218) 454-0766
[email protected] MAXBOTIX (1)
This is because the sensor “noise” is actually interference from other sensors, not
actual noise. The sensors are just behaving the way they were designed to behave.
This describes the general results that you would be getting (as verified by a
voltmeter). This issue becomes more apparent at longer distances, to the point that
the sensor readings are very rarely reliable.
The reason the action is happening is because the sensors are not operating
synchronously with each other or at the same speed. One sensor may be operating
slightly faster than the other.
The closer the sensors are in synchronization, the longer the stable period is. The
farther out of synchronization the sensors are, eventually they may not even appear
to function properly. This happens because the stable period is extremely short or
there is no period of stability.
(218) 454-0766
[email protected] MAXBOTIX (2)
Figure 1 below shows a single sensor operating, detecting an object at 96 inches with
now other sensors present.
Figures 2 and 3 show the operating of a sensor if other sensors are operating in the
area in free-run operation. As the sensors become more unsynchronized the range
readings become more and more unstable.
Figure 1. Single Sensor Operation
Figure 2
Figure 3
To view a wiring diagram of what this set up should look like view figure 4.
Figure 4
(218) 454-0766
[email protected] MAXBOTIX (3)
For the MaxSonar sensors you can start all the sensors at the same time by pulling
the RX pins high for the 20uS. For the LV-MaxSonar sensors this can be done as often
as every 50ms. For the XL-MaxSonar sensors this can be done as often as every
100mS or more. This will sync the MaxSonar® sensors to take readings at the same
time.
The MaxSonar® sensors, because of continuously variable gain, will typically ignore
adjacent sensors when running simultaneously. This method is especially convenient
when using the analog voltage (AN output), as the analog voltage can be read at any
time.
This method works for all sensors lines. We used an LV-MaxSonar-EZ line to show the
diagram. As long as Pin 4 (RX) is connected to the same trigger device all the sensors
will range simultaneously.
Figure 5. LV-MaxSonar-EZ
and XL-MaxSonar-EZ/AE Diagram
(218) 454-0766
[email protected] MAXBOTIX (4)
Figure 6. HRLV-MaxSonar-EZ diagram
To start the commanded sequential reading for the MaxSonar sensors, trigger the
first sensor to range. This allows each device to range only after the previous has
finished (every 50mS for the LV-MaxSonar sensors or every 100mS for the XL-
MaxSonar sensors). This method will always work. There will not be any interference
between sensors, but ranging frequency drops by the factor of the number of sensors
used.
(218) 454-0766
[email protected] MAXBOTIX (5)
Continuous Looping
To have the circuit continuously loop so the chain is always giving an analog voltage
output, connect pin 5 of the last sensor in the sequence to pin 4 of the first sensor in
sequence with a 1K resistor in sequence between the pin 5 output and pin 4 input.
For a diagram of how the wiring should look for the MaxSonar sensors operating in a
Continous Loop please see figures 9 through 12 below.
(218) 454-0766
[email protected] MAXBOTIX (6)
Figure 11. XL-MaxSonar-WR and
XL-MaxSonar-WRC Constant Chaining Loop Diagram
With these sensor chaining methods, once pin 4 is pulled high for 20uS on the first
sensor, all sensors will chain sequencially. After the micro controller brings pin 4
high, the micro controller will have to return it’s pin to a high impedance state so
that after the sequence is complete the TX signal output from the last sensor will
trigger the RX of the first sensor.
(218) 454-0766
[email protected] MAXBOTIX (7)