Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

ultrasonic sensor SRF05
#1

Hello,
I have a well in the garden and I would like to take advantage of the weatherduino TX to transfer the water level. I use an ultrasonic sensor SRF05 which is very widespread.
Is it possible to integrate it as spudstrawb did on the thread: http://www.meteocercal.info/forum/Thread...light=case

I will not use a UV sensor, so I would like to have the well level at this location (as spudstrawb did) on the RX and WD. I do not have enough programming skills to change the code.

I will use a waterproof DS18B20 sensor to know the water T ° but this is already provided on the TX card so no worries.

Thanks


code for display on lcd 16,2 and serial. I use only %, others values are calculation. 


Code:
//HC RS04 Ultrasonic ranging module
int triggerPort = 2;
int echoPort = 3;
#include <LiquidCrystal.h>
LiquidCrystal lcd(8,9,4,5,6,7);

void setup() {
lcd.begin(16, 2);
Serial.begin(9600);
pinMode( triggerPort, OUTPUT );
pinMode( echoPort, INPUT );
}

void loop() {
digitalWrite(triggerPort, LOW);            // set to LOW trigger's output
digitalWrite(triggerPort, HIGH);        // send a 10us pulse to the trigger
delayMicroseconds( 10 );
digitalWrite(triggerPort, LOW);
long duration = pulseIn(echoPort, HIGH);
long r = 3.4 * duration / 2;            // here we calculate the distance using duration
float distance = r / 100.00;
float pourcent = duration;

Serial.print("duree: ");
Serial.println(duration);
Serial.print("distance: ");
if( duration > 38000 ) Serial.println("out of reach");        // if duration in greather than 38ms, the obstacle is out of reach
else { Serial.print(distance); Serial.print("cm  ");}

pourcent = map(duration, 1000, 10500, 100, 0); //1000 pour le niveau haut et 10500 pour le niveau bas
lcd.setCursor(0, 0);
lcd.print("niveau:");
lcd.print(pourcent);
lcd.print(" %  ");
delay( 1000 );                            // wait for 1s
}
Reply
#2

(04-03-2017, 16:48)f4aii Wrote:  Hello,
I have a well in the garden and I would like to take advantage of the weatherduino TX to transfer the water level. I use an ultrasonic sensor SRF05 which is very widespread.
Is it possible to integrate it as spudstrawb did on the thread: http://www.meteocercal.info/forum/Thread...light=case

I will not use a UV sensor, so I would like to have the well level at this location (as spudstrawb did) on the RX and WD. I do not have enough programming skills to change the code.

I will use a waterproof DS18B20 sensor to know the water T ° but this is already provided on the TX card so no worries.

Thanks
Hi f4aii
I can help you with this, but it's not straightforward. My system has a depth sensor in the water tank that outputs an ascii signal. The depth value is contained within an ascii string and the non-depth text has to be filtered out. The depth sensor is connected to a Win10 PC. I had tried to get it working with the depth sensor connected straight to the RPi 3 but it wasn't anywhere near reliable enough, so it's connected to a Win10 PC instead. This PC is a small low powered PC that I already had. It now does nothing else but work with the depth sensor. Consequently it is not connected to the web and therefore doesn't have to worry about reboots etc after windows update does its thing. Not being connected to the web means that it never gets updated. The Win10 PC takes the depth sensor ascii output and runs an AutoIt script over that output to calculate the depth. The AutoIt script output is a percentage value (ie 100% if the tanks are full), rather than an actual depth value. The percentage value is then fed to an Arduino Uno clone with a digital to analog converter. This provides a signal between 0 and 5V that is supplied to the TX board. There is a bit of tweaking of the WeatherDuino Pro2 arduino code as well.
So it's not particularly straightforward. Can you work within the constraints above? If so, I'm happy to provide further assistance to help you get things up and running.
Reply
#3

Hi,

Sorry, not an answer to your question, but how deep and wide is the well?  Have you already got the sensor working reliably?  I believe the general view is that ultrasonics are not very satisfactory for measuring the water level in a typical well.

On http://www.picaxeforum.co.uk/showthread.php?29471-Borehole-well-water-level-sensing  there was recently a long discussion on some methods (warning: it is a   L O N G  thread), from some real experts with practical experience on the topic.  The ultimate target was to use a completely different (i.e. non-arduino) microcontroller, but that thread was primarily concerned with the measurement practicalities.

Cheers,  Alan.
Reply
#4

Thank you for your answers.
I use the sensor only in the summer when I water the garden.
The depth of the well is 3m and the high level is 50cm from the ground, or 2.5m of water. The volume of water is 3m3. I empty it pretty quickly in summer but it fills up pretty quickly.
Apart from watering, I do not look at the water level, it is always sufficient for my daily needs.

I find this well integrated in the middle of other values displayed on the RX and WD.
It is known that this sensor seems to pose worries when it remains too long to moisture. So far, I have not encountered this problem.






http://www.dom-ip.com/wiki/R%C3%A9alisat...r_un_puits


spudstrawb, i will read your link tomorrow. Thanks.
Reply
#5

Your call sounds pretty good in CW. Big Grin
Reply
#6

f4aii,

I don't have any experience with the SRF05, and I don't have any idea about how many changes you have to do on the WeatherDuino Pro2 TX code (and on the RX code too) to allow the SRF05 to supply data, instead of a UV sensor. At first sight it seems possible, but you should consider that making changes on the code can turn the software updates a complicated task, and sometimes updates are absolutely required specially when they are to correct bugs.

Reply




Users browsing this thread: 1 Guest(s)