I have 2 BMP280 sensors using I2C on an EXP8266
using the CactusIO.h library
one one pair, with them both next to each other, the readings are:
29.7515106201 - 29.7553424835 = 0.0038318634
29.7506294250 - 29.7550907135 = 0.0044612885
29.7498531342 - 29.7539787292 = 0.0041255950
29.7497386932 - 29.7532691956 = 0.0035305024
29.7481060028 - 29.7523212433 = 0.0042152405
these are readings taken about 2 minutes apart,
the raw values are converted to inches of water.
as you can see the difference is in the last 8 decimal places.
my needs are only for the first 6
when the fan in the greenhouse starts, the numbers separate to show that the fan is running.
on my second unit, subtracting P1 from P2 I get :
0.020081 // fan off
0.018320 // fan off
0.018597 // fan off
0.019386 // fan off
0.108194 // fan running
0.118654 // fan running
0.116537 // fan running
0.115227 // fan running
what I want to do is to ignore the errors when the two units are on the bench next to each other.
my thoughts are to run on the bench
let them run for 100 cycles take the highest reading
put the highestReading in EEPROM
the running program would be something like
unsigned long deltaP = P1 - P2 ;
if (deltaP < highestReading )
deltaP = 0.00 // assume if less, then the fan is not running and report 0
then datalog deltaP.
it would either be 0,0 or it would be any value over highestReading
Another thought is to set in the greenhouse, let run for an hour, average the readings and just create a threshold at startup and use that value.
I was thinking about creating a menu and putting an initialize loop in so I would not have to do this on the bench.
since I need to make 2 more units, the errors are becoming annoying.
and any readings below a certain point are parts errors, not actual process differences, I do not want to log them.
suggestion ?
is there a better practice ?