I have been testing and calibrating different soil moisture sensors over the past month. I understand Hydrosys4 assumes a linear trendline from the air to water measurement + an offset. The hydrosys4 linear equation is based on only 2 points (max and min). In reality to get true accuracy soil moisture sensors, i need to understand the trendline closer to the moisture level that i expect.. One example of a generic analog sensor, the linear equation is (-0.5339x) + 131.89 ; x being the reading from an adc port. The hydrosys4 would have (-0.6993x) + 171.33 --- based on range of 235 and 102. At a 114.2 reading hydrosys4 would calculate a moisture at 91% but in reality it is 71%. A simple offset of 20 would not work for other level of readings. The question that i have what python program(s) do i need to look at to modify such equation? Keep in mind each family of sensors will have its specific calibration equation while adding the complexity of the MCU / devices we used for the readings. For now i am using chirpstack to process the equation but would like to get hydrosys4 to do it.
top of page
bottom of page
thanks, i will look into it but your solution seems to be exactly what i am looking for.
Hello,
There are 4 parameters that are part of the calibration formula, MIN, MAX, Scale, Offset.
The calibration formula is the following:
den=Max-Min
calibratedValue=Scale*(readingvalue-Min)/den+Offset
By setting them properly you can create your linear formula, I don't think it is necessary to change the code.
In your case:
(-0.5339x) + 131.89 ;
you can put Min=0, Max=1, Scale=-0.5339, offset=131.89
The calibration is applied in the “hardwaremod.py” module under the “normalizesensordata” function.