PaxInstruments / t100-electronics

A single thermocouple to USB adapter.
0 stars 2 forks source link

TC address inconsistency #38

Closed charlespax closed 9 years ago

charlespax commented 9 years ago

I got a working T100 form the Electronics version 0.1 boards. I had to transplant the ATtiny from a DigiSpark to make it work. I then successfully loaded the T100 firmware with make program.

When I run the t100_basicReadings program I get the output below. It's the same output even if I touch the board, which should heat up the MCP9800.

I think I have something wrong with my electrical setup. @kehribar do you have any insight into this?

bash-3.2$ ./t100_basicReadings 
> T100 connection OK!

> Cold junction temperature: -0.062 C
> ADC voltage reading:       0.000 mV
> Thermocouple temperature:  -0.062 C

> Cold junction temperature: -0.062 C
> ADC voltage reading:       0.000 mV
> Thermocouple temperature:  -0.062 C

> Cold junction temperature: -0.062 C
> ADC voltage reading:       0.000 mV
> Thermocouple temperature:  -0.062 C

> Cold junction temperature: -0.062 C
> ADC voltage reading:       0.000 mV
> Thermocouple temperature:  -0.062 C

> Cold junction temperature: -0.062 C
> ADC voltage reading:       0.000 mV
> Thermocouple temperature:  -0.062 C
kehribar commented 9 years ago

Hi Charles,

There are many address variations of the ADC and temperature IC. Do you know what variation is yours? If you don't know explicitly, please share the marking on the IC so that we can check from the datasheet.

I should have stated what variations that I'm using in the firmware clearly. I'll do that ...

ihsan.

charlespax commented 9 years ago

Here are the ICs on the board.

MCP3421 - CA2Q MCP9800 - LDSU

MCP3421

screen shot 2015-01-04 at 00 30 06 screen shot 2015-01-04 at 00 40 20 screen shot 2015-01-04 at 00 40 36

MCP9800

screen shot 2015-01-04 at 00 29 59 ![Uploading Screen Shot 2015-01-04 at 00.43.18.png . . .]()

kehribar commented 9 years ago

marking

I have the one with LJ marking which makes the Address5, but apparently you have the IC with Address0 variant for MCP9800.

marking2

Again for the MCP3421, I have the one with CC marking but you have the one with CA marking.

Let me calculate the I2C address values for your devices as a temporary solution.

kehribar commented 9 years ago

For MCP9800, A0 variant makes 0x48 address.

For MCP3421, A0 variant makes 0x68 address.

charlespax commented 9 years ago

Good catch on this. I just added an idea to the firmware issues on how we might deal with this. See https://github.com/PaxInstruments/t100-firmware/issues/9

charlespax commented 9 years ago

In firmware in main.c I changed every instance of address(0x4D) to address(0x48) and every instance of address(0x6A) to address(0x68). Now I get the following output while touching/releasing the PCB.

> Cold junction temperature: 28.875 C
> ADC voltage reading:       255.998 mV
> Thermocouple temperature:  999.000 C

> Cold junction temperature: 29.000 C
> ADC voltage reading:       255.998 mV
> Thermocouple temperature:  999.000 C

> Cold junction temperature: 29.188 C
> ADC voltage reading:       255.998 mV
> Thermocouple temperature:  999.000 C

> Cold junction temperature: 29.250 C
> ADC voltage reading:       255.998 mV
> Thermocouple temperature:  999.000 C

> Cold junction temperature: 29.312 C
> ADC voltage reading:       255.998 mV
> Thermocouple temperature:  999.000 C

> Cold junction temperature: 29.125 C
> ADC voltage reading:       255.998 mV
> Thermocouple temperature:  999.000 C

> Cold junction temperature: 29.000 C
> ADC voltage reading:       255.998 mV
> Thermocouple temperature:  999.000 C

> Cold junction temperature: 28.812 C
> ADC voltage reading:       255.998 mV
> Thermocouple temperature:  999.000 C
kehribar commented 9 years ago

Hi,

That seems normal. If you didn't plugged the thermocouple, ADC will read maximum (2048/8) mV and that will lead to 999C thermocouple reading which basically a "Over the range" error and also normal based on the input voltage.

charlespax commented 9 years ago

I get this when I connect a thermocouple. All looks good :-)

> Cold junction temperature: 25.000 C
> ADC voltage reading:       0.168 mV
> Thermocouple temperature:  29.214 C

> Cold junction temperature: 25.000 C
> ADC voltage reading:       0.416 mV
> Thermocouple temperature:  35.433 C

> Cold junction temperature: 25.062 C
> ADC voltage reading:       0.506 mV
> Thermocouple temperature:  37.744 C

> Cold junction temperature: 25.062 C
> ADC voltage reading:       0.539 mV
> Thermocouple temperature:  38.574 C

> Cold junction temperature: 25.188 C
> ADC voltage reading:       0.555 mV
> Thermocouple temperature:  39.090 C

> Cold junction temperature: 25.188 C
> ADC voltage reading:       0.564 mV
> Thermocouple temperature:  39.334 C

> Cold junction temperature: 25.250 C
> ADC voltage reading:       0.570 mV
> Thermocouple temperature:  39.543 C

> Cold junction temperature: 25.312 C
> ADC voltage reading:       0.568 mV
> Thermocouple temperature:  39.556 C
kehribar commented 9 years ago

Small step for mankind but giant leap for us :)

charlespax commented 9 years ago

Hell yeah! That was pretty awesome to work through like that.

I think we can call this issue done. Permanent solution discussed at https://github.com/PaxInstruments/t100-firmware/issues/9.