HC-SR04 and FreeBSD

Evandro Nunes evandronunes12 at gmail.com
Sat Aug 30 00:51:24 UTC 2014


hello luiz, it looks promissing!
i will try it by the weekend
thank you very much
it seems like a begining for a libary, or at least an examples collection,
a sonar sensor utility, a relay which you helped me before, the temperature
sensor patrick mentioned and you seem to have it working... I guess they
are the basic and popular stuff



On Fri, Aug 29, 2014 at 3:07 PM, Luiz Otavio O Souza <lists.br at gmail.com>
wrote:

> Okay, so i got my hands on one HC-SR04 and got it working quite
> easily. Two consecutive GPIO readings takes from 15 to 30 usec which
> gives a good precision for this case (readings above 116 usec).
>
> I written a simple C program to program the GPIO pins, trigger the
> sensor and read back the duration of echo pulse, it give me good
> readings using the datasheet formula, so i'm happy with it. Build it
> with: cc -o hc-sr04 hc-sr04.c
>
> I'm using the wiring suggested at (voltage divisor on echo pin):
>
> https://www.modmypi.com/blog/hc-sr04-ultrasonic-range-sensor-on-the-raspberry-pi
>
> The trigger and echo pin is connected to pins 2 and 3 respectively.
> The module is powered from DGND and VDD_5V.
>
> This maybe a good candidate to be on Wiki.
>
> Luiz
>


More information about the freebsd-arm mailing list