lemme know pls if you have any tip
I'm working on a solution for this. The current MaxsonarXL implementation uses a generic analog source reader with a default median filter. The interface returns centimeters, so a simple wrapper around i.e. the New-Ping library might work, but I'm worried about the delay of measurement and how it might effect the control loop. To get around this I'm building a simple integrator circuit to convert the pulse width from the HC-SR04 into a voltage. This requires an extra pin to clear the voltage between readings, but if it works then it will just be another implementation of the AP_RangeFinder interface.
My first design gives a signal between ~.3V and 3.3V out to about four meters https://www.circuitlab.com/circuit/4etd6v/integrator-for-hc-sr04-ul...
though that design is based on components I had on hand, it really should have a (forward bias) diode between the source and the pull down transistor, and the signal would be much cleaner with a FET. And the transistor's base should be the "clear" pin. And adding a timer and a buffer would make the functionality very similar to the maxsonar devices.
... it's a work in progress ^_^;;
though it may be less accurate, it is the fastest output to read. It also requires fewer pins. And in this particular case the HC-SR04 doesn't have a digital output, it's just analog in the time domain.
also, this deserves a cross reference here I think:
So just to see if i guet this right.... i have buy two of this (one as spar parts) to use in my quad with APM2... will it work???!
short answer: no.
long answer: check back in about a month and I may have a solution for you. or someone may have done it already and I simply haven't been able to find it.
I currently have a testing problem as I broke one of the motor mounts on my quad and jdrones is refusing to ship me a replacement, and I also haven't finished the software. so right now it's vapor, don't depend on it.
Ok i will get back to you, thanks.
I am also interested in this. I have both types of sonar, but I am trying to encourage my local community to build rovers and I am trying to get the price point down as far as possible. As I can get the HC-SR04 down to $1.50 in volume, I would like to be able to use this.
I am working with these on another project, so soon I may be able to help.