I'm looking for a low power, inexpensive system to read an SR04 ultrasonic sensor and have the output available on a built-in web server on a WIFI connection. I am hoping to do this using a system running OpenWRT.
I've come across a GL-AR150 board (based on the Atheros 9331) which claims to have 5 GPIO pins, and I'm hoping I can wire an SR04 compatible sensor up to these, although if there are other more suitable boards I'm certainly happy to use a different one if it meets my needs.
The issue I have is that timing is quite critical - the SR04 sends a pulse and measures how many microseconds it takes to return, from which distance can be calculated. I would thus assume that scripting something in BASH is not a viable option. Does anyone know of a library or way I can send a trigger and then read the output of one of these sensors?
I've found a couple of hints how this could be achieved on a Raspberry Pi - http://ananddrs.com/2014/03/11/raspberry-pi-ultrasonic/ and https://github.com/wdalmut/libultrasoni … /hc_sr04.c but both of these seem to call or relate to "bcm" - is there an equivalent way I can do this with on a basic OpenWRT based board with built in WIFI ?
Thanks,
David