Compare commits

...

2 Commits

Author SHA1 Message Date
interfisch 4e87434b61 swap raingauge 2024-03-26 16:11:17 +01:00
interfisch 496a72255d add interrupt mode define 2024-03-26 14:44:41 +01:00
3 changed files with 12 additions and 6 deletions

View File

@ -13,7 +13,7 @@ void Sensor_Raingauge::init() //Things to be done during setup()
init_ok=true; init_ok=true;
pinMode(pin,INPUT_PULLUP); pinMode(pin,INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(pin),interrupt_raingauge,CHANGE); //anemometer interrupt attachInterrupt(digitalPinToInterrupt(pin),interrupt_raingauge,SENSOR_Raingauge_interruptmode); //anemometer interrupt
} }
//Also called during setup() //Also called during setup()

View File

@ -26,12 +26,17 @@ private:
//value in [mm] or [L/m^2] //value in [mm] or [L/m^2]
//#define RAINGAUGE_FLIPAMOUNT 0.38888 //how much mm rain (L/m^2) per gauge flip. mL (rain to flip) / A (opening area) //#define RAINGAUGE_FLIPAMOUNT 0.38888 //how much mm rain (L/m^2) per gauge flip. (rain to flip) [L] / A (opening area) [m^2]
//was 0.69292 until 201702 //was 0.69292 until 201702
/* Calibration: /* Calibration 2018:
* Test1: 1000mL -> 259 Flips * Test1: 1000mL -> 259 Flips
* Test2: 1000mL -> 256 in ca 10min * Test2: 1000mL -> 256 in ca 10min
* -> 3,9mL per Flip, opening diameter =113mm -> A=0,010028749 * -> 3,9mL per Flip, opening diameter =113mm -> A=0,010028749 m²
* -D RAINGAUGE_FLIPAMOUNT=0.29914
*
* Calibration 2024:
* 60 Flips = 100mL => 1.66mL / Flip. Opening area 110mm*50mm = 0,005 m²
* -D RAINGAUGE_FLIPAMOUNT=0.332
*/ */
void updateRaingauge(); void updateRaingauge();

View File

@ -25,7 +25,7 @@
data_dir=data_sensoratd03 data_dir=data_sensoratd03
#Outdoor #Outdoor Weatherstation
[env:sensoresp0] [env:sensoresp0]
platform = espressif8266 @ 2.5.0 #using old esp version, because of "obsolete API, use ::begin(WiFiClient, url)" error. Try again if fix available in platformio over vscode platform = espressif8266 @ 2.5.0 #using old esp version, because of "obsolete API, use ::begin(WiFiClient, url)" error. Try again if fix available in platformio over vscode
board = d1_mini board = d1_mini
@ -68,9 +68,10 @@ build_flags =
-D SENSOR_RAINGAUGE -D SENSOR_RAINGAUGE
-D SENSOR_Raingauge_PIN=D7 -D SENSOR_Raingauge_PIN=D7
-D RAINGAUGE_FLIPAMOUNT=0.29914 -D RAINGAUGE_FLIPAMOUNT=0.332
-D SENSOR_Raingauge_readdelay=1000 -D SENSOR_Raingauge_readdelay=1000
-D SENSOR_Raingauge_senddelaymax=1000*60*60 #also used for rain waiting timeout -D SENSOR_Raingauge_senddelaymax=1000*60*60 #also used for rain waiting timeout
-D SENSOR_Raingauge_interruptmode=RISING
# Cable from Anemometer: Black=GND, Blue=3v3, Brown=Signal (needs pullup (internal)) # Cable from Anemometer: Black=GND, Blue=3v3, Brown=Signal (needs pullup (internal))
#Cable colors from anemometers sensor (before longer able): blue=gnd, brown=vcc, white=signal #Cable colors from anemometers sensor (before longer able): blue=gnd, brown=vcc, white=signal