-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
XIAO NRF52: Support for DS18B20 Temp Sensor + Improved battery readings #8723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
… improved measurements and logic for analog battery (ADC): initial support for charging/discharging flags. TBD: Report USB charger is connected somehow else without using 101% battery level
… improved measurements and logic for analog battery (ADC): initial support for charging/discharging flags. TBD: Report USB charger is connected somehow else without using 101% battery level
|
|
I would suggest splitting this into separate pull requests. With regard to DS18B20 sensors (which I know relatively well, and use a number outside of the Meshtastic project) I believe 1-wire sensors were removed at one point to save on pins and to reduce flash consumption - the functionality is replicated by I2C sensors and they're a similar order of cost. Do you have any idea of how this will affect flash consumption? |
|
Dallas sensors were removed because they can't be auto connected and configured, not really sure what moving away from 101 as the powered value does, would make graphs worse and require rework in both clients |
Agree. Will do.
Can leave it only on specific platforms like XIAO NRF52 if any concerns. So compiler will skip if not enabled.
@garthvh could you please elaborate, what do you mean "they can't be auto connected and configured". Once sensor connected to proper pin and telemetry enabled, it will work. This code particularly can support even many on the same pin, like environment, components, etc.
The 101% reading was initially a workaround, but now I've encountered this historically developed issue. The battery is one entity, and the power line is another. It can't be called 'warm' because it's more like 'milk'. |
|
Not sure where you got the workaround info, but it is not correct. |
|
Support for this i2c conversion for the Dallas 1-wire sensors is on my list. As @garthvh said, we only support i2c sensors unless something is baked into the hardware. It gives us the most options without complicating the configuration with pin definitions |
|
I just double-checked the XIAO NRF52840: the SDA/SCL pins are used for NSS and RF_SW.
@thebentern I agree. We need to make sure it doesn’t interfere with the main project while still being useful on specific platforms, and it should be easy to enable without requiring new code. This isn’t only about the code itself - it also involves testing and everything around it.
|
The NRF is capable of moving most functions around. If you look at the list of build environments, you'll see there's an i2c variant of the seeeeeeeeeeed NRF52 kit, using the back 2 pins for i2c. It's my preferred arrangement, actually. I've been discussing this with TheBen on the discord (where the conversation is quicker!). While I'm a fan of the ds18b20 (not sure if I've mentioned it, but I'm a big fan!), given the current limitations and the comparable cost between the ds18b20 and e.g. AHT20 or SHT40 which provide the same function, I can see that incorporating the extra library, even behind a build flag, is adding a future support issue. As for building special variants, I'm working on a solution to that, as well, because I like to move pins around to suit my own needs, and I don't want to have to mess around any more than I have to. You're more than welcome to pop over to the discord to discuss what is on the to-do list for the project right now. |
|
One huge advantage of onewire is the amount of sensors you can connect. No address clashes. |
I think it's outweighed by the fact that there's not much more than temperature sensors that are suitable for Meshtastic use, and current telemetry protobufs don't support more than one sensor of that type. I agree in general that they're a good sensor type to support, but here it's a case of "not now". |


Hello, Team.
New: XIAO NRF52: Added support for DS18B20 temperature sensor (1 sensor for now).
New: XIAO NRF52: Added battery status reporting (connected/not connected).
New: XIAO NRF52: Initial support for battery charging status (based on voltage levels to detect if the battery is charging or discharging).
Affect: All platforms: Devices with 101% battery will no longer show as "Line Powered." This will be migrated to a separate metric once the feature is fully implemented. #8711
Tested on XIAO NRF52.