Thermocouple Amplifier MAX6675, SN-6675


In order to measure the temperature without using the thermometer, thermocouples are the option to do so. However, the thermocouples need a reference temperature(normally take 0°C ) as to detect the difference of the temperature in between the materials of the thermocouples and is very inconvenience for the user to use it. Hence, SN-6675 is introduced to do everything for you.This SN-6675 breakout board comes along with MAX6675 and a bypass capacitor.

Specification:

  • Works with K type thermocouple
  • 0°C to +1024C output in 0.25 degree increments
  • Internal temperature reading
  • SPI data output requires any 3 digital I/O pins.

SN-6675

               
               (Click to enlarge)                     (Click to enlarge)
  • VCC – 3.3 to 5v power supply and logic level compliant!
  • CS – Active low to enable the chip
  • SO – reads out the 12-bit result onto this pin(Connect to SDI pin)
  • SCK – Provide the clock pulse (Connect to SCK pin)
  • T- – Connected the the T- of the thermocouple
  • T+ – Connected to the T+ of the thermocouple

In this tutorial, you will learn on how to interface this product with SK40C and the Thermocouple K in order to measure the temperature. The sample source code is attached at the end of this tutorial.

Tools and components:

            
 1 x SK40C                     1 x SN-6675              1 x Serial LCD (2×16)           
 
111712_0914_ArduinoBuyi12        lcd-8x2-3137-222x2964449-280x373
 1 x BBFuino                           1 x LCD (8×2)                     1 x Header Pin (2×20)          
 
  
     pic16f887                    straight-pin-header-male-1x40-ways-1962-280x373
    1 x IC PIC 16F887                     1 x Terminal Block-2 Way         1 x Straight Pin Header (Male) 
 
 
male to male jumper wireBreadboard

 Male to Male Jumper Wire                 1 x Breadboard              1 x Thermocouple K
 

Procedures

Section 1: SK40C with SN-6675

1. First of all, solder the 2 ways terminal block and straight pin header to the SN-6675.
              
                            Front view                                                            Back view

                          Figure 1: Soldered the block terminal  and pin header to SN-6675

2. Next. connect the component to the SK40C on a breadboard  as the schematic and the sample circuit connection provided
   

                                                Figure 1.1: Schematic (Click to enlarge)

   

                                   Figure 1.2: Actual Circuit connection (Click to enlarge)

   

                               Figure 1.3: Sample Circuit Connection (Click to enlarge)

3. The following show some part of the sample source code..
    The microcontroller used for this tutorial is PIC16F887.
    The MPlab X version 1.20 and XC8 compiler version 1.0 can be downloaded from here
    Please refer here for MPlab X tutorial
 
    main function: This function was functioning as to read the temperature from the SN-6675

[sourcecode language=”cpp” wraplines=”true”]
while(1)
{
obtain = 0;
obtain = readCelsius();
data = obtain%100;
obtain = obtain/100;
__delay_ms(1500);
lcd_2ndline();
lcd_bcd(3, obtain);
lcd_putchar(‘.’);
lcd_bcd(2, data);
RB7 ^= 1;
__delay_ms(1500);
}
[/sourcecode]

Sub-function: Since the MAX6675 receive 12 bits of data at once, this function detects the data received by shifting the bits received as much as 16 times before sending it back to PIC16F887. The following code shows the virtual SPI function generating the clock pulse 16 times in order to receive the data in 16 bits.

[sourcecode language=”cpp” wraplines=”true”]
unsigned int readCelsius(void) {

unsigned int v;

CS = 0;
__delay_ms(1);

v = spiread();
v <<= 8;
v |= spiread();
CS = 1;

v >>= 3;
return v*25;
}

unsigned char spiread(void) {
int i;
unsigned char d = 0;

for (i=7; i>=0; i–)
{
SCK = 0;
__delay_ms(1);
if (SO) {
//set the bit to 0 no matter what
d |= (1 << i);
}
SCK = 1;
__delay_ms(1);
}

return d;
}
[/sourcecode]

4. Observe the temperature obtained.
   

                               Figure 1.4: Room Temperature_Night(Click to enlarge)

   
  

   Figure 1.5: Temperature change as Thermocouple K detect the heat change(Click to enlarge)

5. Done

Section 2: BBFuino with SN-6675

1. A cutter used to cut the 2×40 header pin (Male) into 2×8 ways. The pins was soldered to the 2×8 LCD as shown below.
                                                
                                                  Before (Front view)                                     After (Back view)
                                                 Figure 2.1: Soldering the header pins onto the 2×8 LCD
2. A 2×40 header pins (Female) was cutting into 2×8 ways and being soldered onto the LCD pad (DS3) of BBFuino board as shown below.
                                                      
                                                          Front view                                                 Back view
                                                 Figure 2.2: Soldering the header pin onto the BBFuino Board
3. Soldered the JP8 on the BBFuino as shown below in order the LCD backlight can be function properly.
                                                        
                                                         Before                                                            After
                                                   Figure 2.3: Soldering the JP8 on the BBFuino board
4. The 2×8 LCD with 2×8 ways of header pin was plug in into the BBFuino board and fit them to a breadboard as shown below.
                                         

                                   Figure 2.4: 2×8 LCD plug to the BBFuino board and fit them to a breadboard

5. Connect the circuit as the schematic and the sample circuit connection provided.
                                   
                                                                        Figure 2.5: Schematic(Click to enlarge)
                   
                                                      Figure 2.6: Sample Circuit Connection(Click to enlarge)
                 

                                                       Figure 2.7: ActualCircuit Connection(Click to enlarge)

6. The following show some part of the sample source code..
    Arduino Ide version 0021  for BBFuino can be download from here
   
    main function: It will obtain the temperature value for SN-6675. Buzzer and Led will light according to the range of the temperature detected.

[sourcecode language=”cpp” wraplines=”true”]
void loop() {
// basic readout test, just print the current temp
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(“Temp:”);

// go to line #1
if(thermocouple.readCelsius() < 0)
{
lcd.print(“Cold!!!”);
lcd.setCursor(0,1);
celcius(thermocouple.readCelsius());
digitalWrite(LED_R, HIGH);
digitalWrite(LED_G, LOW);
digitalWrite(buzzer, HIGH);
delay(50);
}

else if(thermocouple.readCelsius() > 100)
{
lcd.print(“Hot!!!”);
lcd.setCursor(0,1);
celcius(thermocouple.readCelsius());
digitalWrite(LED_R, HIGH);
digitalWrite(LED_G, LOW);
digitalWrite(buzzer, HIGH);
delay(50);
}
else{
lcd.setCursor(0,1);
celcius(thermocouple.readCelsius());
digitalWrite(buzzer, LOW);
digitalWrite(LED_G, HIGH);
digitalWrite(LED_R, LOW);
}

delay(1000);
}
[/sourcecode]

Sub-function: Since the MAX6675 was received 12 bits of data at once, this function was detected the data received by shifting the bits received as much as 16 times before send it back to main function. The code following was using the virtual SPI function by generate the clock pulse by 16 times in order to received the data by 16 bits. This sub-function can be found from the MAX6675 library.

[sourcecode language=”cpp” wraplines=”true”]
double MAX6675::readCelsius(void) {

uint16_t v;

digitalWrite(cs, LOW);
_delay_ms(1);

v = spiread();
v <<= 8;
v |= spiread();

digitalWrite(cs, HIGH);

if (v & 0x4) {
// uh oh, no thermocouple attached!
return NAN;
//return -100;
}

v >>= 3;

return v*0.25;
}

double MAX6675::readFahrenheit(void) {
return readCelsius() * 9.0/5.0 + 32;
}

byte MAX6675::spiread(void) {
int i;
byte d = 0;

for (i=7; i>=0; i–)
{
digitalWrite(sclk, LOW);
_delay_ms(1);
if (digitalRead(miso)) {
//set the bit to 0 no matter what
d |= (1 << i);
}

digitalWrite(sclk, HIGH);
_delay_ms(1);
}

return d;
}
[/sourcecode]

7.Observed the temperature changed.
                      
                                                              Figure 2.8: Room Temperature_Night(Click to enlarge)
 
                      
                          Figure 2.9: Temperature change as Thermocouple K detect the heat change(Click to enlarge)
                                              
8. Done
 
Attachment:
SK40C_16F887_MAX6675.X.zip
BBFuino_MAX6675+library.zip
  

Buy

, , ,

Related Post

Control and Monitor via SMS Part 2

Simple steps to control Stepper Motor using 2Amp Motor Driver Shield and CIKU

PIC16F VS PIC18F:Analysis of PIC Mid-Range 8 bit family and Advanced 8-bits Family

SK40C vs CT-UNO

11 thoughts on “Thermocouple Amplifier MAX6675, SN-6675

  1. Not really recommend if the cooking oil is for human consumption. We do not know the reaction of the insulator on thermocouple to cooking oil and what is the chemical reaction

  2. do you have any sensor that suitable for cooking oil measurement?i dont know what type of sensor that suitable

  3. Pls, can i get a source code on hi-tech picc for temperature, keypad and lcd interface ie their initialization. i tried writing the code using mikroc pro but it keep telling me demo limit. am now trying to switch to hi-tech c.

  4. hye…..

    i would like to ask if im using hyper terminal. do u have a sample of the source code.

    thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *