Close

OctoSonar 2.0 prototype works

A project log for HC-SR04 I2C Octopus "octosonar"

Connect up to 16 ultrasonic range sensors to an Arduino with I2C bus and one pin

alastair-youngAlastair Young 05/31/2017 at 01:070 Comments

I have a new prototype board undergoing testing and it comes with new code

I really don't like not being able to handle the sensors that lock up (see previous log) nor do I like that even the "good" ones make you wait 200ms when they get no echo. So I reworked the echo circuitry replacing the 8-way OR gate with 8 tri-state buffers. The trick is to ignore the spec sheet where it says the trigger pulse must be 10us and assume that that is a minimum - we're already doing 240us with the I2C flap. Instead we assume that the important thing to the HC-SR04 is the falling edge, and then hold the pin down for the duration. We then use that signal to enable the tri-state buffer attached to the matching Echo signal.

So far, it seems to work - both the "good" and "bad" sensors can by cycled through on a 50ms rotation - with or without echo returns.

The really good news is that the "bad" sensors come back to life after they get a good trig-echo cycle.

Bonus feature: it *should* work with 3.3V controllers e.g. Raspberry PI, with a 3.3V VCC and separate 5V feed to power the sensors. Untested as yet, but soon....


Discussions