Support for ultrasonic Modul HC-SR04


#1

Hi all,

i would like to monitor a diesel fuel-tank for my poolheater which is controlled with Cayenne with a standard HC-SR04 Ultrasonic module ( http://www.micropik.com/PDF/HCSR04.pdf or http://www.netzmafia.de/skripten/hardware/RasPi/Projekt-Ultraschall/HC-SR04_2.pdf ).

It is cheap, universal and with a simple handling.
Maybe this one could get here in Chayenne!?

There are mouch sample codes on the net.

cheers

Benjamin


#2

Hi Benjamin,

We’re creating a process that will allow you to use your own code to integrate sensors that are on our current list of supported sensors. In this way, we are 'teaching a man to fish", as the saying goes :slight_smile:

-B


#3

Agreed, I would like to use this sensor to monitor water levels in a water feature to automatically kick a valve on to fill the pond. Will we see the HC-SR04 added to the list of devices anytime soon? Seems like a popular sensor out in the jungle.


#4

@benjaminkessler @josh1 Do you guys have an Arduino? Wanted to let you know you should be able to get the HC-SR04 going in Cayenne right now using Arduino. You can check out our docs page here. Let us know if you get if working!

-B


#5

Benjamin, Were you able to hook up a HC SR04 ? Im thinking of using one with cayenne. Thanks


#6

No, currently this sensor is not direct supportet on a raspberry with cayenne.
Maybe it would be possible via Arduino integration but i have no clue about that.

I have one working on another Raspberry without cayenne. It is simple and easy to implement.

Cheers

Benjamin


#7

Try to use Arduino uno and ethernet shield.


#8

Only problem with HC-SR04 - it “freezes” sometimes (actually it fails to catch the pulse it has sent) and you need to powercycle it from time to time - so adding some sort of relay to your project is a must


#9

I can’t say I’ve ever had this issue, are you getting any errors in your code?


#10

No, there are no errors. The issue happens if (for whatever reason) the emitted pulse doesn’t get back - 2 ways to fix it, actually - you can “clap your hands” - that is generate “something like the pulse” or power cycle the sensor.
How does it look like when HC-SR04 is stuck? Simply you stop hearing pulses (while it is “ultrasonic” you can still hear clicking sound).


#11

That sounds easy enough to fix with software. Can you post your code?


#12

Hello.

I’m trying a few days on an ESP8266 with a HC-SR04 Ultrasonic module, it works perfectly, one gauge is showing the calibration in millimeters and another in inches.

Greetings from Brazil to everyone!