Yes I realise that , I just wasn't sure at first where I needed to change things in the sketch. I think I've worked it out. I have zero experience in reading programming code so couldn't at first find the PiR^2h equation to change it, but now I've found it.
Huw Thomas
@Huw Thomas
Best posts made by Huw Thomas
-
RE: Round water tank level sensor
Latest posts made by Huw Thomas
-
RE: Round water tank level sensor
Yes I realise that , I just wasn't sure at first where I needed to change things in the sketch. I think I've worked it out. I have zero experience in reading programming code so couldn't at first find the PiR^2h equation to change it, but now I've found it.
-
RE: Round water tank level sensor
I've been searching online for a project like this and it looks great. I'm doing something similar with an oil tank and have everything up and running, but the sketch I'm using is really basic, it just returns distance to oil level. Is it possible to change your sketch to allow for a rectangular tank, rather than cylindrical?! I'm an absolute beginner when it comes to coding unfortunately so any advice would be great. Thanks.
-
RE: Adding NRF24 code to existing sensor sketch
@mfalkvidd Thanks, but I've gone through that and have managed to get sensors working (using existing sketches that have the NRF24 code built in) but as I'm a complete beginner here in terms of coding, I just don't know what to add to my sketch and where etc.
-
Adding NRF24 code to existing sensor sketch
If this has been asked before I apologise, but I've got a sketch that counts hourly and daily rainfall from a simple tipping bucket raingauge. I'd like to send this info to my Serial Gateway and MyController. The existing setup works as I've tried and tested them on a DHT11 and distance sensor. I am very new to coding however and am not sure how to go about adding the code necessary to work the NRF24 on my raingauge sketch. Any help appreciated
This is the sketch I'm using....
#include "RTClib.h" #include <Wire.h> #define RainPin 2 // The Rain input is connected to digital pin 2 on the arduino bool bucketPositionA = false; // one of the two positions of tipping-bucket const double bucketAmount = 0.01610595; // inches equivalent of ml to trip tipping-bucket double dailyRain = 0.0; // rain accumulated for the day double hourlyRain = 0.0; // rain accumulated for one hour double dailyRain_till_LastHour = 0.0; // rain accumulated for the day till the last hour bool first; // as we want readings of the (MHz) loops only at the 0th moment RTC_Millis rtc; // software RTC time void setup(void) { Serial.begin(9600); // start the serial port rtc.begin(DateTime(__DATE__, __TIME__)); // start the RTC pinMode(RainPin, INPUT); // set the Rain Pin as input. delay(4000); // i'm slow in starting the seiral monitor (not necessary) Serial.println("Ready!!!"); // not necessary too } void loop(void){ DateTime now = rtc.now(); // ++++++++++++++++++++++++ Count the bucket tips ++++++++++++++++++++++++++++++++ if ((bucketPositionA==false)&&(digitalRead(RainPin)==HIGH)){ bucketPositionA=true; dailyRain+=bucketAmount; // update the daily rain } if ((bucketPositionA==true)&&(digitalRead(RainPin)==LOW)){ bucketPositionA=false; } // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ if(now.minute() != 0) first = true; // after the first minute is over, be ready for next read if(now.minute() == 0 && first == true){ hourlyRain = dailyRain - dailyRain_till_LastHour; // calculate the last hour's rain dailyRain_till_LastHour = dailyRain; // update the rain till last hour for next calculation // facny display for humans to comprehend Serial.println(); Serial.print(now.hour()); Serial.print(":"); Serial.print(now.minute()); Serial.print(": Total Rain for the day = "); Serial.print(dailyRain,8); // the '8' ensures the required accuracy Serial.println(" inches"); Serial.println(); Serial.print(" : Rain in last hour = "); Serial.print(hourlyRain,8); Serial.println(" inches"); Serial.println(); first = false; // execute calculations only once per hour } if(now.hour()== 0) { dailyRain = 0.0; // clear daily-rain at midnight dailyRain_till_LastHour = 0.0; // we do not want negative rain at 01:00 } } // end of loop```