Open jerabaul29 opened 8 months ago
Have you ever had a broken wire?
No, never yet, but so far all my uses have been for testing and in the lab, the 35 instruments to come now will be the first large scale field deployment :) .
I'm considering adding this: https://www.analog.com/en/products/ds2482-100.html since getting 1-wire is more troublesome than first thought.
@gauteh to summarize:
I think the DS18B20 coated in epoxy are better / more robust, I have heard the ones with a metallic casing always end up rusting / leaking
the DS18B20 code: https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/main/legacy_firmware/firmware/steval_gps_waves_shortthermistors_drifter/thermistors_manager.h + https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/main/legacy_firmware/firmware/steval_gps_waves_shortthermistors_drifter/thermistors_manager.cpp
the AGT pins I am using:
you can see this in code at:
https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/571732ba2c071cdbb7dc6ea796b76cfc58d61451/legacy_firmware/firmware/steval_gps_waves_shortthermistors_drifter/board_control.h#L32-L36
(note I now use 47 Ohm, but was using around 100 before, this is quite robust)
The 47 Ohm resistors are just here to protect the AGT and the rest of the OMB in case some DS18B20 or its cable gets damaged / leakage / cable cut, so that there is no "hard" short circuit, the 47 Ohm will hopefully be enough to limit the currents to something ok.
the DS18B20 are daisy chainable
the way the code logics works:
https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/571732ba2c071cdbb7dc6ea796b76cfc58d61451/legacy_firmware/firmware/steval_gps_waves_shortthermistors_drifter/thermistors_manager.cpp#L125-L198
https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/571732ba2c071cdbb7dc6ea796b76cfc58d61451/legacy_firmware/firmware/steval_gps_waves_shortthermistors_drifter/thermistors_manager.cpp#L200-L220
https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/571732ba2c071cdbb7dc6ea796b76cfc58d61451/legacy_firmware/firmware/steval_gps_waves_shortthermistors_drifter/thermistors_manager.cpp#L222-L300
In addition I have some bookkeeping, pushing stuff to arrays, averaging, etc, but a lot of it is OMB specific / to fit within iridium SBD budgets.
Let me know if you have any questions :) .
A note: I needed to use a slightly tuned OneWire library (just in case you need to wrap the one I am using), because I had otherwise some issues with some timings that were too slow (all of this is a bit had hoc, I think the protocol has some expectations about some waiting times etc):
https://github.com/jerabaul29/OneWire/tree/feat/Artemis_compatible
(see the last 3 commits that were doing some tuning; may be "artemis core kind specific", and likely you will not have the issue in Rust: https://github.com/jerabaul29/OneWire/commits/feat/Artemis_compatible/ . For more information, see https://github.com/paulvha/apollo3/tree/master/OneWire_on_uart and specifically https://github.com/paulvha/apollo3/blob/master/OneWire_on_uart/1-wire_uart.odt for explanations if hitting timing issues).