DeeEmm / DIY-Flow-Bench

Volumetric flow bench based on ESP32 and MAF sensor.
GNU General Public License v3.0
27 stars 8 forks source link

Review 10-12 bit conversion for all inputs #81

Closed DeeEmm closed 3 years ago

DeeEmm commented 3 years ago

Review all sensor inputs:

DeeEmm commented 3 years ago

Have already updated MAF sensor and board voltage reference (#79). Need to roll out for remaining inputs prior to unit tests (#76)

Example conversion (from MAF sensor)

int mafFlowRaw = analogRead(MAF_PIN);
double mafMillivolts = (mafFlowRaw * (_hardware.getSupplyMillivolts() / 4095.0)) * 1000;
return mafMillivolts;

NOTE:

_hardware.getSupplyMillivolts()

References 3.3 volt supply and integrates supply fluctuations into sensor calculations.

4095 bit resolution = 12 bits

DeeEmm commented 3 years ago

Remaining references to 10 bit / 5v replaced