SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By alex.sneedmiller
#200062
I am working on a project that involves 4 HC-SR04 ultrasonic distance sensors (https://www.sparkfun.com/products/13959).

Because I am using 4 sensors I need 8 data pins (one trigger pin and one echo pin for each sensor). I would like to use less pins. Is it possible to tie all of the trigger pins together and then just monitor each output pin individually? I'm running into weird issues where it seems like my microcontroller (Particle.io Photon) seems to stop working when I use too many sensors. Could it be that too much current is getting drawn from the pins?

I tried to tie all of the echo pins together, but then nothing works.

Does anyone have any suggestions of how to use less pins for this application?
By alex.sneedmiller
#200063
One of my issues appears to be that pin 6 on the Photon does not seem to work for some reason...has anyone else ever ran into an issue where a particular pin does not work? I am using mostly the same code that they show in the example https://github.com/sparkfun/HC-SR04_Ult ... xample.ino

Whenever I use pin 6 on the photon for trigger or echo the chip seems to halt.