All about renovation and decoration of apartments

High temperature controller based on K-type thermocouple. PIC16F676 - Thermometers - Designs for home and garden

PIC16F676 Application: soldering station, control of high-temperature processes, etc. with PID control function of the heating element

I decided to insert a thermometer into my laminator, a K-type thermocouple thermometer. To make it more informative for me, I believe that a hobby radio amateur cannot be content when only two LEDs “POWER” and “READY” are lit on such a device. I arrange the scarf for my details. Just in case, with the ability to cut it in half (this is some versatility). Right away with a place for the power part on the thyristor, but for now I’m not using this part, this will be my circuit for a soldering iron (when I figure out how to attach a thermocouple to the tip)


There is not enough space in the laminator (the mechanisms are located very tightly, you know in China), I use a small seven-segment indicator, but that’s not all, the whole board doesn’t fit either, this is where the versatility of the board comes in handy, I cut it in half (if you use a connector, the upper part fits many developments on little tidbits from ur5kby.)


I set it up, first I do as stated in the forum, I don’t solder in the thermocouple, I set 400 (although if this parameter is in memory, this item will disappear), I set the variables to approximately room temperature and exactly to boiling point,

Such a controller theoretically operates up to 999°C, but at home such a temperature is unlikely to be found, at most it is an open fire, but this heat source has strong nonlinearity and sensitivity to external conditions.

here is a sample table.
and also for clarity

So there is little choice in choosing a source for adjusting the controller readings.

There is no more playing with buttons, everything can be collected,
I used a thermocouple from a Chinese tester. And a post in the forum advised me that this thermocouple can be multiplied, its length is almost half a meter, I cut off 2 cm.

I make a transformer by twisting it with charcoal, a ball is obtained, and to the two ends it is exactly the same, along a copper wire, for good soldering to my wires.

But you can assemble it yourself for half the price.
If anyone is interested, welcome to cat.

Let's start in order.
Thermocouple... like a thermocouple. Meter exactly, K type, 0-800C

It can be embedded into the body; there is a threaded part that rotates freely. Diameter 5.8mm, pitch - 0.9~1.0mm, looks like M6 x 1.0mm. Turnkey for 10


This is all good, what to do next? It is necessary to convert the signal (thermopower) into a digital or analog signal in order to read it with the Arduino. This will help us. This is a K-type thermocouple signal converter to digital, has an interface, which suits us.
Here comes our hero - ($4.20)


Cost $4.10, but that lot is no longer available (same seller).

We will connect to an Arduino, you can take a simple one ($5.25, you can find it cheaper, here you see exactly this one)


We will write the data to the memory card (and at the same time send it to the port) using $1.25.


The interface, by the way, is also SPI. But not all cards support it. If it doesn't start, try another one first.
In theory, all lines of SPI devices (MOSI or SI, MISO or SO, SCLK or SCK), except CS (CS or SS - choice of chip), can be connected to one pins of the Arduino, but then the MAX6675 does not work adequately. That's why I separated everything into different pins.
The sketch was based on an example of working with memory cards with .
Library and sketch for MAX6675. MAX6675 connection diagram:

#include
#include

Int units = 1; // Units to readout temp (0 = F, 1 = C)
float error = 0.0; // Temperature compensation error
float temp_out = 0.0; // Temperature output variable

MAX6675 temp0(9,8,7,units,error);

Void setup()
{
Serial.begin(9600);
Serial.print("Initializing SD card...");

PinMode(10, OUTPUT);
if (!SD.begin(10)) (
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");

// Check if the data.csv file exists on the map; if it does, delete it.
if(SD.exists("temp.csv")) (
SD.remove("temp.csv");
}
// open the file. note that only one file can be opened at a time,
//so you have to close this one to open another one.
myFile = SD.open("temp.csv", FILE_WRITE); // open for writing


if (myFile) (
Serial.print("Writing to temp.csv...");
// close the file:
myFile.close();
Serial.println("done.");
}
else(


}

}
void loop()
{

Temp_out = temp0.read_temp(5); // Read the temp 5 times and return the average value to the var

Time = time + 1; // Increase time by 1

MyFile = SD.open("temp.csv", FILE_WRITE);

// if the file opened normally, write to it:
if (myFile) (
// record the time
myFile.print(time);
Serial.print(time);
// add a semicolon
myFile.print(";");
Serial.print(";");
// write the temperature and line feed
myFile.println(temp_out);
Serial.println(temp_out);
// close the file:
myFile.close();
}
else(
// and if it does not open, then print an error message:
Serial.println("error opening temp.csv");
}
delay(1000); // Wait a second
}


Download:

I decided to insert a thermometer into my laminator, a K-type thermocouple thermometer. To make it more informative for me, I believe that a hobby radio amateur cannot be content when only two LEDs “POWER” and “READY” are lit on such a device. I arrange the scarf for my details. Just in case, with the ability to cut it in half (this is some versatility). Right away with a place for the power part on the thyristor, but for now I’m not using this part, this will be my circuit for a soldering iron (when I figure out how to attach a thermocouple to the tip)

There is not enough space in the laminator (the mechanisms are located very tightly, you know in China), I use a small seven-segment indicator, but that’s not all, the whole board doesn’t fit either, this is where the versatility of the board comes in handy, I cut it in half (if you use a connector, the upper part fits many developments on little tidbits from ur5kby.)

I set it up, first I do as stated in the forum, I don’t solder in the thermocouple, I set 400 (although if this parameter is in memory, this item will disappear), I set the variables to approximately room temperature and exactly to boiling point,

Such a controller theoretically operates up to 999°C, but at home such a temperature is unlikely to be found, at most it is an open fire, but this heat source has strong nonlinearity and sensitivity to external conditions.

here is a sample table.

and also for clarity

So there is little choice in choosing a source for adjusting the controller readings.

There is no more playing with buttons, everything can be collected,
I used a thermocouple from a Chinese tester. And a post in the forum advised me that this thermocouple can be multiplied, its length is almost half a meter, I cut off 2 cm.

I make a transformer by twisting it with charcoal, it turns out to be a ball, and to the two ends exactly like that, along a copper wire, for good soldering to my wires

Recently, due to the frequent use of various step-down, step-up, charging and control modules, a need has arisen for a thermometer with a wide measurement range. Since the available multimeter did not have a temperature measurement function, I thought about purchasing a separate device. I immediately rejected immersion thermometers - they are too inertial. Pyrometers, although they allow you to measure temperature remotely, are deterred by their price and do not shine with quality. At least those that came into my hands were not impressive.
As a result of the search, an electronic thermometer TM 902C was ordered for $3.99


There are a great many similar devices on Aliexpress, but I settled on this one for the following reasons:
- highly specialized device without additional functions;
- wide measurement range;
- the device is equipped with a TR-02 thermocouple with an upper measurement limit of 750 degrees Celsius.

There is another modification of the thermometer - powered by two AAA elements, but complete with a TP01 thermocouple with a measurement limit of 350 (400 according to some sources) degrees. I didn’t see any point in buying a TP02 thermocouple separately and turned a blind eye to power supply from Krona.
What do the manufacturer and the seller declare to us according to the instructions in a language that we all understand)?



Although few of us actually understand the language, at least a few technically literate people will understand that the device:
- with its dimensions 24 * 72 * 108
- powered by 9 Volts (Krona, 9F22);
- relative humidity ≤ 75%;
- capable of measuring temperatures from -50 to 1300 degrees Celsius (1370 according to the instructions);
- works with type K thermocouples of the corresponding range.





Judging by the information in the instructions, the device errors range as follows (in Celsius):
From – 40 to – 20: -± 3 degrees;
From -20 to – 0: -± 2 degrees;
From 0 to 500: -± 0.75-1 degree;
From 500 to 750: -± 1%;
From 750 to 1000 and from 1000 to 1370: could not interpret accurately.
The most common thermocouples are TP01 and TP02 with ranges from -50 to 350 (400) and from -50 to 750 degrees Celsius, respectively.
When purchasing, the seller was asked a question about what kind of thermocouple would be included in the kit.
Assurances were received that the thermometer would measure temperatures from -50 to 750 degrees, i.e. The kit will include a TP02 probe, which is confirmed by further tests.
Externally, the device is made very carefully, the casting is of high quality.





Weight with battery and thermocouple

The back cover is secured with two screws. The board is also secured with the same screws - simply, reliably and economically.
The display is secured to the board with two screws and two latches.

The viewing angles are wide.
Inside, the casting of the case is less thorough, which is not critical.



The board is made of getinax.
The quality of processing of one of the four ends of the board (do not forget about the price of the device)

The 1.9-inch display is connected to the board via a conductive rubber band, so I didn’t remove the screen - it’s unlikely to be possible, and then put it back correctly.

There are eyelets on the edge of the screen for fastening with screws to the case - in this case, such a fastening scheme is not used.
There are light traces of flux, but I think this will not affect the performance in any way.

As you can see, there are almost no elements on the board - probably a blob microcircuit is hidden under the screen, which is responsible for processing the signal from the probe, performing calculations and displaying information on the screen.
Having studied the inner world of the device, I moved on to field tests.
At first, I used an immersion kitchen thermometer and a room thermometer to compare readings. The indoor one did not inspire confidence for a long time and was subsequently excluded from the competition program.
Refrigerator freezer

Immediately after removal from the freezer, the submersible one showed 0.2 degrees lower, but it is impossible to photograph at the same time due to the rapid reaction to changes in the temperature of the object being monitored and the inertia of the submersible thermometer.
Outdoors

Veranda

Room

Hot water


Boiling point of water


Next, soldering irons were used as a heat source. The immersion thermometer is no longer used as it is difficult to attach it to a point heat source, and it is difficult to warm up the entire body.






The last photo shows that the temperature of the heating element is above 400 degrees, which indicates that the kit actually contains a TP02 thermocouple.
During the tests, the fiberglass braiding of the thermocouple cord was slightly damaged - it fell into the flame of a gas stove. However, this can also be considered a test - it was not burned, but only slightly changed color.


The advantages include:
- narrow specialization of the device;
- decent appearance and workmanship;
- complete with thermocouple TP02;
- it seems to me that there is sufficient measurement accuracy and, thanks to this, a wide range of measurements;
I didn’t find any downsides, other than the 9 Volt power supply and the lack of a thermocouple protective cap.

I'm planning to buy +40 Add to favorites I liked the review +42 +72

Thermocouple is a type of temperature sensor that can be used in measuring devices and automation systems. It has certain advantages: low cost, high accuracy, wide measurement range compared to thermistors and digital temperature sensor microcircuits, simplicity and reliability. However, the output voltage of the thermocouple is small and relative, and the circuit of the thermocouple meter is complex, since there are strict requirements for the precision amplification of the signal from the thermocouple and for the compensation circuit. To develop such devices, there are specialized microcircuits that integrate an analog signal conversion and processing circuit. Using these microcircuits, you can build a fairly compact temperature meter with a thermocouple as a sensor (Figure 1).

Principles

Wikipedia defines the principle of operation of a thermocouple as follows:

The operating principle is based on the Seebeck effect or, in other words, the thermoelectric effect. There is a contact potential difference between the connected conductors. If the joints of the conductors connected in a ring are at the same temperature, the sum of such potential differences is equal to zero. When the joints are at different temperatures, the potential difference between them depends on the temperature difference. The proportionality coefficient in this dependence is called the thermo-EMF coefficient. U different metals the thermo-emf coefficient is different and, accordingly, the potential difference arising between the ends of different conductors will be different. By placing a junction of metals with excellent thermo-EMF coefficients in an environment with a temperature T1, we will obtain a voltage between opposite contacts located at a different temperature T2, which will be proportional to the difference in temperatures T1 and T2 (Figure 2).

Figure 2.

There are several types of thermocouples, depending on the pair of materials used (pure metal or alloy). In our project we use a K-type thermocouple (chromel-alumel), which is often used in industrial tools and instruments. The output voltage of a K-type thermocouple is approximately 40 µV/°C, so a signal amplification circuit with a small voltage offset across the input will be required.

As mentioned above, thermo-emf is proportional to the temperature difference between the cold and hot junction. This means that the cold junction temperature must be known to calculate the actual hot junction temperature. To do this, you will need a cold junction compensation circuit, which will automatically introduce a correction to the measured thermo-EMF (Figure 3).

To obtain the temperature value using a thermocouple, you will need analog circuitry, such as a precision op-amp and a cold junction compensation circuit. However, there are several types of specialized microcircuits with a built-in thermocouple interface. These chips integrate the above analog circuits and greatly simplify the design. In our case, we chose the MAX31855 chip from the company. It contains an analog circuit and an analog-to-digital converter, therefore, at the output of the microcircuit we will receive digital data. Before purchasing a microcircuit, it is necessary to determine in advance the type of thermocouple that will be used in the device.

Main characteristics of the MAX31855 chip:

  • Temperature measurement range: from -270 °C to +1800 °C;
  • Resolution: 14 bits, step 0.25 °C;
  • Simple SPI-compatible interface (data reading mode);
  • Thermocouple reference junction compensation circuit;
  • Circuit for detecting short circuit of thermocouple wires to the power bus and the common bus;
  • Circuit for detecting a break in the measuring circuit;
  • Versions for thermocouples types K, J, N, T and E;
  • 8-pin package.

Cold junction compensation is implemented using a temperature sensor integrated into the chip, so one of the important conditions when assembling the meter is to place the chip directly next to the thermocouple connector. An important condition is also the insulation of this unit from external heat. For connection we used the connector shown in Figure 4. Other types of connectors can be used.

The schematic diagram of the temperature meter is shown in Figure 5.

The heart of the device is the AVR microcontroller. The MAX31855 chip connects to the microcontroller via the SPI interface.

An LR1 battery with a voltage of 1.5 V is used as a power source. To power the microcontroller and thermocouple interface chip, a boost DC/DC converter circuit is used, based on an XC9111 series chip, providing an output voltage of 3.0 V. The microcontroller controls the power and monitors the battery voltage.

Since a 1.5 V battery is used for power supply, it is optimal to use the TWV1302W segment static LCD indicator, which is used in digital temperature measuring devices, to display data (Figure 6). The operating voltage of this indicator is 3 V. When using an indicator with an operating voltage of 5 V, an additional voltage converter circuit will be required (Figure 7). The indicator control functions are performed by a microcontroller. With this solution, the current consumed by the device will be 4 mA, and the battery will last at least 100 hours.

Related publications