-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Feature request: I²C temperature sensor support #3844
Comments
Do you have some kind of hardware to suggest? |
I was thinking of this the other day. It would be logical to use the same sort of temperature probes used in Spektrum telemetry, EagleTree telemetry etc as these are available everywhere and for cheap. It wouldn't make any sense to use up a digital UART for this, just an ADC pad would do I should think. |
I would think an i2c temp sensor would be better. They're more accurate than an analog sensor that needs calibration and using i2c means you wouldn't use a dedicated port (just share the i2c with whatever). I've done this with Arduino and it's super straight forward and cheap. |
This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. |
Automatically closing as inactive. |
I bought some LM75A sensors. Cheap and seems like a good solution for on board temperature measurements. Up to 8 can be used on the same bus, 2.8 to 5.5V power supply, temperature range from -55°C to 125°C with 0.125°C resolution. I will try to add support for it |
@shellixyz another popular one which can be had REALLY cheap is the venerable DS18B20. I know it's not I2C but it only requires 1 pin (outside of power/Ground) and can be purchased in a TO92 case which makes them perfect for sticking in small places https://cdn-shop.adafruit.com/datasheets/DS18B20.pdf |
Probably 1-wire is even easier to implement using an UART - https://www.maximintegrated.com/en/app-notes/index.mvp/id/214 |
@digitalentity REALLY easy to implement and the good thing is, those DS1820B's can be parasitically powered so you literally only need, data and ground |
@wx4cb It is an interesting sensor. Not as cheap as the LM75A but the possibility to only use 2 wires in total to connect the sensor is really nice. We would have to implement the 1-wire protocol though. |
@digitalentity We could also add support for the DS2482 I²C bus master |
most of the work has already been done: https://stm32f4-discovery.net/2014/05/13-reading-temperature-with-dallas-ds18b20-on-stm32f429-discovery-board/ |
@shellixyz it would be nice to see DS2482 put on the FC itself 😄 |
@digitalentity Indeed. Suggestion for Matek for their next FC ? 😄 |
@digitalentity I realise that, if i was a better coder with more understanding of STM32s i could help lol and i agree a bus master would be nice on board. no need to worry about - oh crap how do i connect this LOL |
Any idear how far it is? |
@sniperxnl I'll start working on it when I get the sensors. I bought some LM75 and DS18B20. They have been shipped but I'm still waiting for them. If you want to contribute some MCP9808 chips I can add support for it too. |
@shellixyz was searching and stumbled on this feature. I'm brand new to iNav. I think it's an important addition. Look forward to your work! |
I look forward to the support release for the DS18B20 Dallas sensor. Constructively, the LM75, being a SOIC 8. Needs to be board mounted. As most are. Any reason that an NTC Thermistor isn't considered to connect to a spare ADC? |
@kardon18
That's why the DS18B20 in TO92 package is nice. And only 3 wires needed instead of 4 for the LM75. For some applications using a LM75 is fine though. The PCB doesn't need to be larger than 10x10mm. Would be fine for measuring the air or battery temperature. But as you said not ideal for measuring the motor or VTX temperature for example.
It would be possible and would be pretty easy. The downsides are that there are often not a lot of analog inputs on the FCs and electrical interference can have a big impact on analog signal. Also you need one signal wire per sensor so if you want say 4 sensors then you need 2 wires for power and 4 wires for signal (and also 4 resistors or 4 caps). 6 wires in total. The DS18B20 has the disadvantage to need an interface chip but it is very small and can be put close to the FC then you only need 3 wires total for the bus whatever the number of sensors used. |
Please add a uart temperature sensor for Longrange flights with lion batteries.
The text was updated successfully, but these errors were encountered: