HC-SR04 Ultrasonic Sensors

Hi all,

Working on a project that will end up using a load of ultra-sonic sensors.

The HC-SR04 echo pin works on 5V logic so I’ve had to implement a voltage divider to drop that down to 3V3 for the Pi. Since I don’t want to have to do this for every echo pin, I figured I could use a common echo pin and poll the sensors in a round-robin fashion.

This is the circuit I’m planning, but as a bit of an electronics newbie, it seems wrong that one of the echo pins can be at 5V whilst the rest are at 0V (hence the diodes). No idea how that affects the voltage divider and the input to the Pi.

Anyone care to shed some light or experience?

Cheers,
Tom

I think I’ve managed to convince myself that it’s ok. When one of the echo pins from the sensor is at 5V and the rest are at ground, current would ordinarily ‘flow’ to their echo pins, but the diodes prevent that and drop the voltage. So that point in the circuit is 5V, which correctly gets divided down to 3V3.

Will have to build and test this very carefully :)

Just thought I’d post an update of the completed board. Did a bit of probing with a multimeter and an oscilloscope just to make sure everything was working as intended.