Best ultrasound sesnor

Hi, which ultrasound sensor should use if I want to measure a water level in a well (max. 4 meters deep). I already tried the SR04 sensor, but it got either stuck on 4 cm or 800 cm (even before reaching 300 cm).

This might work, but it's expensive: Non-Contact Ultrasonic Water Level Sensor | ysi.com. There are many other options that could achieve what you're looking for.

What is the diameter?
How close can you get the sensor to the highest water level?

MaxBotix makes good sensors and has a line specifically for tanks...

Edit: and they have other IP67 and IP68 sensors with narrow beam profiles, which may be needed in a well (presumably smaller diameter than a tank...)

Diameter is 1 meter, the sensor might be about 1 meter at closest

Pure water is like concrete to ultrasound, but any debris floating on the water will effect the quality of reflection. Don't tell me there is nothing on the surface by water. Bugs and lots of other stuff will gather there, but not effect the water quality several feet down.

So the measuring distance to the bottom would be 5m. That would require a sensor with a beam angle of less than 11.7 degrees. To allow for misalignment, a beam angle of maybe 8.5 degrees may be required.

One of the MaxBotix sensors that @DaveEvans suggested would work.

Thank you, sorry for inactivity. How is it with software part and connection? How can I write a code for those sensors on Arduino?

Let's see the code that you've written in the past 5 weeks, and I'm sure folks will be happy to help you get over any difficulties you're having with it.

Properly formatted in a <CODE/> block, please.

Fairly easy.

This is the code I used for the SR04 sensor

const int trigPin = 2;  
const int echoPin = 3;  
float duration, distance;  

void setup() 
{
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
}

void loop() 
{
  //longduration,distance;
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2)/29,1;
  distance = (duration * .0343) / 2;
  Serial.print("Distance: ");
  Serial.println(distance);
  delay(100);
}

I chose the Maxbotix MB7850 sensor (MB7850 Ultrasonic Liquid Level Sensor – MaxBotix).
There is a coding guide on Maxbotix website, but this sensor has 7 pins, so I'm not sure how to use them.
The code from Maxbotix website:

const int anPin = 0;
long anVolt, cm;
void setup() {
  Serial.begin(9600);
}
  void read_sensor(){
  anVolt = analogRead(anPin);
  cm = anVolt/2;
}
  void print_range(){
  Serial.print(“Range = ”);
  Serial.print(cm);
  Serial.print(” cm “);
  Serial.print('\n');
}
void loop() {
  read_sensor();
  print_range();
  delay(100);
}

Your very best source of information is the sensor data sheet, available from the Maxbotix site:

I know, but I'm not sure which pins I need. I think I need only V+, GND and AV for simple distance measurement. Are serial receive and serial transmit necessary?

The doc says ALL interfaces are available simultaneously.

If that works as you expect, what more do you need?

The FREERUN/TRIGGER pin could be very useful.

I don't know if it works, I don't have the sensor yet. Now, I need to know how many pins on Arduino Uno I need for it

If you want to trigger the sensor when needed, you need four pins.

The ones I mentioned + FREERUN/TRIGGER?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.