RobTillaart / MS5611

Arduino library for MS5611 temperature and pressure sensor
MIT License
17 stars 5 forks source link

Investigate a device ID based upon the calibration numbers #26

Closed RobTillaart closed 2 years ago

RobTillaart commented 2 years ago

The readProm() reads 7 values, which can be combined to a 32 bit ID. Assuming these are unique per sensor, these could be combined in some hash (?) to form an unique ID.

RobTillaart commented 2 years ago

my ROM values (decimal)

0 42813 44132 26874 24506 32060 28365

RobTillaart commented 2 years ago

Created a develop branch which implements a simple SHIFT XOR hashing of the PROM values. PR = https://github.com/RobTillaart/MS5611/pull/27

Created an example MS5611_promHash.ino that generated

MS5611 found: D963A70D

not really happy with the function name getPromHash() Although it is correct it is less understandable than e.g. getDeviceID() which is in fact incorrect but more intuitive in its meaning...

ratio-x commented 2 years ago

my ROM values (decimal)

192 55102 52075 34758 31777 32430 28042

2120 58061 55931 36591 31881 32845 28228

+1 for naming this getDeviceID()

RobTillaart commented 2 years ago

Thanks. Numbers are different but also close so in HEX it might be more visible that the high byte is the same. This is no problem for the hash

RobTillaart commented 2 years ago
LyricPants66133 commented 2 years ago

What can this unique hash be used for?

RobTillaart commented 2 years ago

E.g. if you use offsets for the sensor to get correct figures, you can do that programmatically per sensor the right offset.