Electronic – arduino – Connecting multiple ultrasonic sensors to one Arduino

arduinopower supplysensorultrasound

I'm trying to connect five ultrasonic sensors (HC-SR04, to be exact) to an Arduino board to detect obstacles in five directions (four cardinal + one Z-axis). I read the datasheet on the HC-SR04s and the Arduino Uno as well, and found that the ultrasonic sensor draws 15mA when active, and the Uno can supply a max of 40mA through each pin and a total of 200mA from all pins.

Now since I don't have ten PWM I/O pins, I've thought that since I'll be firing the sensors all at once, one trigger pin is enough. The ECHO pins will go to a separate PWM pin for each module.

I have two concerns here (I'm just a beginner in electronics :)):

  1. I'm going to supply power to each sensor off a 5V/2A BEC. So will this cause current overdraw from the Arduino PWM pins? If so, is there a workaround? Maybe a transistor-driven solution? (I've done a basic electronics course in college, but never had a chance to design one on my own.)

  2. The second concern is regarding my trigger pin design. Will one pin be able to pulse five of the sensors, or will the current drop not let them fire (since they're all in parallel)? My guess is that it's only the voltage that's firing them up (assumption) and in parallel it would all be the same so it should work, right?

I searched around, but I only found information on connecting one sensor to the Arduino. I read something about running high-amp motors with Arduino by supplying the current through a battery so I think my first concern should be fine? But I'm not sure, and so I thought I'd ask here. Thanks!

Best Answer

The problem with hobby related solutions is documentation is limited and not spec'd like commercial components or modules.

It is possible that it may work but make a block wiring diagram and consult with the OEM is advised. Mind you I don't know if they have adequate support for your question as these are built in China.

Hobby Services 3002 N. Apollo Dr. Suite 1 Champaign, IL 61822 (217) 398-0007 E-Mail: hobbyservices@hobbico.com Internet Address: www.supertigre.com

It appears that your ultrasonic load is TTL so there is no problem switching 5 at the same time with a BEC, but I wonder if you have considered the effects of crosstalk on firing all at the same time. They indicate a 15deg detection angle but this would depend on the reflection angle of objects you wish to detect. There may be phasing issues with reflection cancellations like having 5 tweeters directed in a room. Reading the response of each echo in parallel with a time interval count won't be a simple textbook result with non-smooth objects with 5 senders. enter image description here

YOu can test your orthogonal array design with any signal pulse generator and look at the signal on a parallel port logic analyzer or scope to ensure what you are design will work.

Power drive is the least of your concerns from these low power devices. Noise avoidance from conducted and radiated sources will be paramount and design of the transponder array must come first. I would spend some time on testing this part 1st to identify all the electrical, physical, acoustic, EMI, thermal, vibration both conducted and radiated sources of interference and how each affects your SONAR expectations with different objects. Will it be microphonic with vibration or loud pulse noises. How well does it reject other ultrasound sources of noise? Will the TTL Echo output change in pulse width with signal strength or just the delay time.

Will you get echos from the wrong sender due to corner refection effects.