Ive been using a tc74a0 for awhile. works great until I started working on my power supply project. I need it to read to at least 100c. currently it only gets to about 45c sometimes a little more sometimes a little less. Ive tried different things and cannot get anything to work correctly
any help is appreciated
#include <Wire.h>
int i2c = 72; // i2c address
int a = 0;
void setup() {
Serial.begin(9600);
Wire.begin();
Serial.println("hello");
}
void loop() {
Wire.beginTransmission(i2c);
Wire.write(a);
Wire.endTransmission();
Wire.requestFrom(i2c, 1);
while(Wire.available() == 0);
int c = Wire.read();
int f = (c*9.0/5.0 + 32.0);
Serial.print(c);
Serial.print("C, ");
Serial.print(f);
Serial.println("F.");
delay(500);
}
Wire.requestFrom returns when there is data, or it cannot get the data. Doing Wire.available afterwards achieves nothing, except possibly to send the program into a loop if no data was returned.
ok I tried this and now it maxed out at 50c then it stops I reset the board then it starts working again
One time it got to 51c then froze I reset it as fast as I could and then it started working again at 50c and slowly cooled down?
ok I removed the while(Wire.available() == 0); from the code and something odd happened, it hit 52c then said -1c several times then said 53c then it started cooling off and going back down it would not go over -1c
ok I tried this and now it maxed out at 50c then it stops I reset the board then it starts working again
One time it got to 51c then froze I reset it as fast as I could and then it started working again at 50c and slowly cooled down?
OK, but what's the output? I asked you for the output not the temperatures. I wanted the output of the config register at the different temperatures, especially if the temperatures rises over 50°C.
ok I tried this and now it maxed out at 50c then it stops I reset the board then it starts working again
One time it got to 51c then froze I reset it as fast as I could and then it started working again at 50c and slowly cooled down?
OK, but what's the output? I asked you for the output not the temperatures. I wanted the output of the config register at the different temperatures, especially if the temperatures rises over 50°C.
ok I didnt know that and im not near the arduino setup but im almost positive it only spit out 255 at the varying temps
Should I make a youtube video and post the link so everyone could see exactly what it is doing?
pylon:
For me it's enough if you copy/paste the output of the serial monitor to your next post.
it only spit out 255 at the varying temps
For the temperature or for the config value?
BTW: How do you heat the sensor above 50°C?
the temp sensor hit a 54c max then said -1c as I heated it then as it cooled when back down
the config always said 255 from when opened serial monitor at 19c then heated it (with a lighter on the metal tab t0-220) up to 52c then -1c then as it was cooling down it started at 54c and downward. I understand why the max varies slightly because of the .5 second delay but it cant be much higher than it has hit
thats what I tried but it will not let me copy only highlight
Have you tried the keyboard shortcuts (Ctrl-C/Ctrl-V or on the Mac Cmd-C/Cmd-V)? For me they're working perfectly.
it only spit out 255 at the varying temps
Then there's something completely wrong as 6 of the 8 bits must be 0 always (by definition as to the datasheet).
Try that new code, I haven't found in the datasheet if the device is able to read more than one register per transfer, so I put it in a separate transfer.
Don't you have a softer method of heating the part? I would try a hair dryer, you won't get to 100°C but over 50°C. A lighter puts temperatures of several hundred degrees to the device which might harm it.
thats what I tried but it will not let me copy only highlight
Have you tried the keyboard shortcuts (Ctrl-C/Ctrl-V or on the Mac Cmd-C/Cmd-V)? For me they're working perfectly.
it only spit out 255 at the varying temps
Then there's something completely wrong as 6 of the 8 bits must be 0 always (by definition as to the datasheet).
Try that new code, I haven't found in the datasheet if the device is able to read more than one register per transfer, so I put it in a separate transfer.
> with a lighter on the metal tab t0-220
Don't you have a softer method of heating the part? I would try a hair dryer, you won't get to 100°C but over 50°C. A lighter puts temperatures of several hundred degrees to the device which might harm it.
im barely hitting the metal tab and I touch it then pull it off and then touch it then back off
and here is the serial monitor with the new code you posted
I guess you should change the way you're heating up that poor little sensor. Probably the chip overheats before the heat reaches the temperature sensing element. The metal tab is ground connected and most probably not meant to be heated that way.
pylon:
I guess you should change the way you're heating up that poor little sensor. Probably the chip overheats before the heat reaches the temperature sensing element. The metal tab is ground connected and most probably not meant to be heated that way.
ok ill try it with some hot air at low temp and heat it really slowly