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

measure height of snow
#1

Hello,

I search to measure the height of snow with an ultrasonic module HY-SRF05. Is it possible to integrate it into the program?

Using this type of sensor makes it easy to measure the height of snow for those who live in the Nordic countries. For those who never see snow, they will be able to measure the height of water in a tank for example.


[Image: INSTrument_cluster_1_576_768_80auto.jpg]
Reply
#2

I need that! :-)
Reply
#3

(08-06-2017, 06:12)danner Wrote:  I need that! :-)

the code is simple but I can not integrate it for lack of knowledge in programming

I reconstructed here my measure of the water level of the well currently in place and I added on the display the simulation of the height of snow that I prepare.
 
We have the distance between the SRF05 sensor and the well water in cm and the filling level in%.
For height of snow, simply remove the distance to the ground with the measure

Code:
//HC RS04 Ultrasonic ranging module
int triggerPort = 2;
int echoPort = 3;
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3A,20,4);


void setup() {

lcd.begin();                                  
lcd.clear();  
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;
float snow = 20 - distance ; //20 is distance in cm with ground
lcd.setCursor(0, 0);
lcd.print("time: ");
lcd.print(duration);
lcd.print("ms  ");

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

pourcent = map(duration, 1000, 10500, 100, 0);
lcd.setCursor(0, 2);
lcd.print("level:");
lcd.print(pourcent);
lcd.print(" %  ");
lcd.setCursor(0, 3);
lcd.print("height:");
lcd.print(snow);
lcd.print("cm  ");


delay( 1000 ); // wait for 1s
}

[Image: p_201712.jpg]

[Image: p_201711.jpg]
Reply
#4

(06-11-2017, 05:49)f4aii Wrote:  the code is simple but I can not integrate it for lack of knowledge in programming

I reconstructed here my measure of the water level of the well currently in place and I added on the display the simulation of the height of snow that I prepare.
 
We have the distance between the SRF05 sensor and the well water in cm and the filling level in%.
For height of snow, simply remove the distance to the ground with the measure

Smile

Good job, f4aii!

Best Regards
Zdenek

Brandys/L Weather
Reply
#5

I send a sensor to someone who wants to look into the integration of some lines of code in weatherduino's INO file
Reply
#6

It's not impossible but the "integration" will not be so simple as just adding some lines of code to the WeatherDuino code.
I supposed the "snow sensor" should be a wireless unit, so the first step would be  using a dedicated TX unit, and find a way (modifyng the software) to send the data from the "snow sensor" as it as data from a "Temp/Hum" sensor, then in the RX software will be possible mapping those data to an Extra Sensor.
Only two fields of data would be sent, one will be presente in the Temperature data field the other on the Humidity data field.
Remember, the weatherduino uses the Davis data structure.

This solution is similar to what we did with the Air Quality Monitor, which is mapped to Davis extra sensors 6 and 7.
I'm not seeing another way of doing it, without breaking the code and compromise future software upgrades.

Reply
#7

Werk,
Sounds like another “module” for the Weatherduino system is possible. It would be ideal if the code could be written to allow it to measure snow depth, water tank or farm dam level etc, to make it appealing to a wider range of users
Regards
Jim
Reply
#8

Hi Jim,

With my previous post, my intention is only pointing the route to anyone which wants to make a similar device, at present I haven't any intention (nor the time) to work with any extra add-on for the WeatherDuino system. For now, all my atention and free time, is focused in the improvement of the Air Quality Monitor (I'm sure no one imagine the ammount of work hours already spent with it).

Reply
#9

Werk,
I do appreciate your commitment and can only imagine the time you have spent on the forum and the project to date . I am away at the moment And will rebuild my AQM board when I return
Kind regards
Jim
Reply
#10

Hello,

concerning your snow depth sensor I would like to give you some input.
I already tried to measure the snow heigth with an ultrasonic measurement device and I failed.
Since I'm using a laser based measurement I get fairly good readings.
This winter I'm trying to get some ToF (Time of Flight) running to check if they give suitable measurements.

If someone is interested in measuring the snow depth with a laser based sensor just leave a quick note and I will give an overview of my tries in english.

regards,
engolling
Reply




Users browsing this thread: 4 Guest(s)