I'm using a thoroughly tested Arduino Nano with the following modules (All Adafruit except the keypad, ADC and XBee)):
Keypad (Sparkfun I2C), SD Card (SPI), INA 219, DS3231 RTC, TMP117, XBee S1, MCP3202 ADC.
Voltage, Temp, and Current Readings of the battery under test (using a 100 Ohm Resistor load) occur every 1 second, are saved to SD Card and transmitted using the XBee. What I'm seeing are sporadic reading from the TMP117...always the same value of -256. The other temperatures are exactly what I would expect (i.e., room readings of 22 Deg C. Any suggestions ? Note: I don't think a timing issue is involved since it occurs when I change the delay to higher values (e.g., every 10 seconds)...It occurs with 2 different TMP117 modules so a bad temp sensor seems unlikely. Any sugegstions?
Sporadic temperature readings with TMP117
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- MountainMan370
- Posts: 34
- Joined: Mon May 11, 2020 7:30 pm
- mikeysklar
- Posts: 13824
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Sporadic temperature readings with TMP117
There is a lot going on with your circuit. Can you isolate the Nano with the TMP117 to see if the behavior continues without other devices and loads?
Are you specifying the number of readings to be taken and averaged (eg. tmp117.setAveragedSampleCount(TMP117_AVERAGE_32X) )?
https://learn.adafruit.com/adafruit-tmp ... ng-3078466
https://github.com/adafruit/Adafruit_TM ... ttings.ino
Are you specifying the number of readings to be taken and averaged (eg. tmp117.setAveragedSampleCount(TMP117_AVERAGE_32X) )?
https://learn.adafruit.com/adafruit-tmp ... ng-3078466
https://github.com/adafruit/Adafruit_TM ... ttings.ino
- MountainMan370
- Posts: 34
- Joined: Mon May 11, 2020 7:30 pm
Re: Sporadic temperature readings with TMP117
Followed your advice and there appears to be a conflict with the Keypad. Once I removed that the TMP117 performed as expected.
- mikeysklar
- Posts: 13824
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Sporadic temperature readings with TMP117
Good work isoalting the issue down the keypad.
If you manage to understand what specifically about the Keypad and TMP117 was causing the conflict I would be curious to know.
Probably the most common issue is an address conflict. That is not an issue with the keypad being 0x4B and the TMP117 being 0x48.
You might have some luck specifying the i2c bus speed at a slower rate if tolerable down to 100 kHz or 400 kHz.
If you manage to understand what specifically about the Keypad and TMP117 was causing the conflict I would be curious to know.
Probably the most common issue is an address conflict. That is not an issue with the keypad being 0x4B and the TMP117 being 0x48.
You might have some luck specifying the i2c bus speed at a slower rate if tolerable down to 100 kHz or 400 kHz.
- MountainMan370
- Posts: 34
- Joined: Mon May 11, 2020 7:30 pm
Re: Sporadic temperature readings with TMP117
I ruled out any address conflicts. I’m not sufficiently experienced to adjust the I2C rate. In any event, the keypad was just a “nice to have” accessory and it’s removal isn’t a problem.
Thank you again for your suggestions.
Thank you again for your suggestions.
- mikeysklar
- Posts: 13824
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Sporadic temperature readings with TMP117
Should you want to experiment in the future with adjusting i2c bus frequency to help devices play nice together here is one initialization example. This one uses 100 kHz of which I've found a few devices requied, but it is unusual.
Code: Select all
busio.I2C(board.SCL, board.SDA, frequency=100000)
Please be positive and constructive with your questions and comments.