I am working on installing 5 sensors around a workshop to measure the mass of different storage boxes.
I wish to use the same codebase to record and log all the data from each sensor setup.
One issue I am running into is how to account for different calibration factors for each sensor. My current solution is to have a separate settings file with all the calibration factors stored in it. When the main code is run, it looks up the serial number of the RPi currently running it, references what sensor IDs are connected to it in a database which is manually configured, and then reads the calibration factors from the setting file.
- Run main script
- Look up serial number of RPi running it and determines it is ‘ABC’
- Look at manually configured database and sees sensor X and Y is attached to RPi with serial number ‘ABC’
- Look up calibration factors for X and Y
- Use calibration factors to correctly scale sensors
For small scale deployments this would probably work fine. However, in a situation where you might install 100s of sensors, it doesn’t make sense to me that you would store the same database on every device. Alternatively you could have the database stored remotely but then you would need an internet connection simply to access these values.
Is there an industry standard way to address this problem?