Hello Tim:We are using a HC-SR04 to measure the water level in a nutrients tank.Tank is 12.75in diameter with open top.Depth of the tank is 15inThe HC-SR04 is installed at the top in the center of the tankThere is no obstruction of the sensor beam on 11 in diameter from the center.Then, we have a few 3/8" poly tubes on the periphery of the tank.Currently, we get maximum distance variation measurement of about 2" for the reading (Usually correct distance to 2" less)I have attached the code we are using.From your experience, can we get more stable readings from the sensor?Thank you in advance.Best regards, Serge
Two wires works great on my esp32 to my hc-sr04. But when I try with one pin it doesn't work. I define the same pin number in TRIGGER_PIN, ECHO_PIN.I created a "y" connector to take the pinout of the esp32 into trigger and echo of the sr04. I have NOT done any voltage conversions from 3.3 of the esp TRIGGER_PIN, ECHO_PIN . I power the sr04 with 5v from the vcc off the esp32. Could that be the issue? Or is it due to timers being removed off non avr chip.
Now I have another problem in my 3-sensor setup. The sensors I use are HC-SR05. but they return a lot of "0"..And strange values.. Sometimes it also returns the good value:0=0cm 1=0cm 2=0cm 0=0cm 1=0cm 2=0cm 0=0cm 1=0cm 2=0cm 0=0cm 1=0cm 2=0cm 0=0cm 1=0cm 2=0cm 0=0cm 1=0cm 2=0cm 0=0cm 1=0cm 2=0cm 0=0cm 1=145cm 2=0cm 0=0cm 1=145cm 2=0cm 0=0cm 1=0cm 2=0cm 0=0cm 1=145cm 2=0cm 0=0cm 1=0cm 2=190cm 0=0cm 1=0cm 2=0cm 0=0cm 1=146cm 2=0cm 0=0cm 1=0cm 2=0cm 0=0cm 1=0cm 2=0cm 0=21cm 1=0cm 2=0cm 0=0cm 1=0cm 2=0cm 0=0cm 1=144cm 2=0cm 0=22cm 1=0cm 2=0cm 0=0cm 1=0cm 2=0cm 0=0cm 1=0cm 2=189cm Is it the power usage? The box says: 4.5 -> 5.5 Volts and 10 to 40 mA.Does anyone have a proper solution?
I tried to use this library with Makeblock MegaPi board.When I try to include NewPing library in Arduino IDE I received errors from the attached image.How to solve this problem?Thank you.
Hello Tim,When using a JSN-SR04T water proof sensor, its required PING_MEDIAN_DELAY is longer than the 29000 which specified in the #define statement. This causes the sensor to ill-behaved resulting in improper operation.If this #define constant was converted to a pre-settable value through a user command, then it would accommodate proper operation with a broader range of sensors making the library even more flexible.Of course if no value was set by the command the default of 29000 would be used.Might you consider this change in your next update?Sincerely,The Beer Drinkers at Andrews Brewing CompanyAndrews, North Carolina
I cannot get Newping (v1.9)to provide data with the sample sketches. The "distance = sonar.ping_cm(200);" command returns nothing on the serial monitor. No errors on compile. I tried both a Leonardo and a 101, same result. The HC-sr404 works fine without the library commands. I have followed the instructions on the web to the letter. Any tips? ThanksAlex