hi, is this suitable for river water level detection>?
JaneYu 2020-07-05 12:10:43 33 Views16 Replies hi, is this suitable for river water level detection>?
Hi, i'm trying this sensor with a raspi but can't make it work. Always get the same error when try to run de code given in python. OSError: [Errno 25] Inappropriate ioctl for device
JaneYu Hi, how can the angle of the measuring beam be made more narrow? I need 20°. Would removing the bell-mouth help?
JaneYu Same, trying to know if it's possible to control the measurement frequency. For your application you could probably use a transistor to power it up every 15 minutes, and once you get your measurement shut it down again.
JaneYu Hey. I tried with a delay but it just stuffs up the readings. Are you suggesting using a transistor as a switch controlled by one of the digital outs to switch power on and then off?
Is it possible to "trigger" this device or is it constantly going to be measuring ? I need to use two of these pointing at the same surface and if they measure at the same time the data is probably going to be erroneous :/
JaneYu Hi, does anyone know what the library for this sensor is? I'm trying to geting to work with it in an esp32.
JaneYu Hi,
I've a question about this sensor. Before, you tell that the temperature effect has a compensation, but how can it be compensiated without thermometer ? thank for your help.
JaneYu Thank you for the reply. Can the compensation be switched off or the temperature be read? The black ** is causing false readings at times when it is exposed to the sun. The device measures higher temperature than the surrounding air, thus malcompensating.
JaneYu Is the measured range temperature compensated?
Or, if not, for which air temperature is the distance calculated from time of flight?
That would be important to know to properly correct for temperature using an external thermometer.
JaneYu I wanted to use the sensor in a (Dragino LDDS75) to measure snow depth. Unfortunately that doesn't work properly. Is the ultrasonic attenuation in the snow too great?
JaneYu I'd like to make a correction regarding the max distance that i previously posted. My previous comment stated that the sensor range appears to be 3.2m. I was able to test up to 7m and the sensor reads perfectly fine.
JaneYu Hi there! The product comes with a removable bell-mouth and the effective measuring distance is 7.5m when the bell-mouth is installed. Did you install the bell-mouth before measuring the distance?
JaneYu Sorry, the supplier of this product didn’t provide us with any further information regarding your problem. We don’t have the
example code for it.
JaneYu int medirSensor(){
long promedio;
int medicion;
uint8_t medicion_ok;
digitalWrite(A01NYUB_PWR, LOW);//Turn On Ultrasonic Sensor
delay(250);
promedio = 0;
medicion_ok = 0;
for(int index=0; index<5; index++)
{
medicion = lecturaSensor();
if(medicion > 0){
medicion_ok++;//cuento las mediciones correctas
promedio += medicion;
/////////////////////////////////////////
/*
Serial.print("index: ");
Serial.print(index);
Serial.print(" - medicion: ");
Serial.println(medicion);
*/
//////////////////////////////////////
}else{
//Serial.print("Error: ");
//Serial.println(medicion);
;
}
delay(250);
}
if(medicion_ok != 0)//si existieron al mas de una medicion exitosa
{
//Serial.print("Valor promedio: ");
//Serial.print((int)(1.0*promedio/medicion_ok));//calcula el promedio en base a las mediciones exitosas obtenidas
//Serial.println(" cm");
medicion = (int)(1.0*promedio/(medicion_ok));//cm
}else//ninguna medicion exitosa, problema con el sensor
{
//Serial.println("Verifique conexion del sensor");
medicion = 0;
}
digitalWrite(A01NYUB_PWR, HIGH);//Turn off Ultrasonic Sensor
return medicion;
}
int lecturaSensor(){
int distance;
int sum;
//clearSoftwareSerialBuffer();
//delay(250);
while(mySerial.available() > 4 && mySerial.read()!=0xFF);//lee hasta encontrar el Header 0XFF mientras haya datos en el buffer
if(mySerial.available() > 3){//Si despues del Header existen al menos 3 datos mas
data[0] = 0xFF;
data[1]=mySerial.read();
data[2]=mySerial.read();
data[3]=mySerial.read();
sum=(data[0]+data[1]+data[2])&0x00FF;
if(sum==data[3])
{
distance=(data[1]<<8)+data[2];
if(distance < 280)
distance = -1;//ERROR DE DISTANCIA PEQUENA
}else
distance = -2;//ERROR DE VALIDACION DE DATOS
}else{
distance = -3;//ERROR DE LONGITUD DE DATOS
}
while(mySerial.available() > 0) mySerial.read();//EN TODOS LOS CASOS VACIO EL BUFFER
//mySerial.close();
return distance;//RETORNO EL VALOR
}
void clearSoftwareSerialBuffer(){
while(mySerial.available() > 0) mySerial.read();//EN TODOS LOS CASOS VACIO EL BUFFER
}


