In Fig. 79 given circuit diagrams the simplest semiconductor thermometers on diodes(Fig. 79, a) and a transistor (Fig. 79.6), published in one of the American radio magazines. In the thermometer, the diagram of which is shown in Fig. 79, a, the sensitive element (sensor) is four silicon diodes connected in series and powered by a direct current of 1 mA. In this case, a shift of the current-voltage characteristic of silicon diodes towards zero by 2.11±0.06 mVI°C is used. Thus, with an increase in temperature from -18 to +100 ° C, the voltage acting on each diode decreases by more than 400 mV (from 688 to 270 mV). Consequently, the voltage on all four diodes will decrease by 1.6 V, i.e. it will be 4 times greater.



To measure voltage fluctuations on the diodes, they are included in one of the arms of the bridge, which generally consists of a voltage divider across resistors R3-R5 and resistor R1 connected in series with diodes D1-D4. The thermometer indicator is a microammeter connected to the diagonal of the bridge through a variable resistor R2. The bridge is powered by a constant voltage of 6 V, stabilized by a silicon zener diode D5.


Setting up a diode thermometer comes down to calibrating its scale, which is done as follows. Diodes coated with waterproof varnish are placed in a vessel with water, the temperature of which is controlled with a mercury thermometer. The length of the conductors connecting diodes D1-D4 to the meter can be several meters. When cooling or heating water, you can go through the temperature range from zero to 100 ° C, while making the appropriate marks on the microammeter scale. “Zero” is shifted to the desired place on the instrument scale by adjusting variable resistor R4, and the temperature measurement range is selected using variable resistor R2. Any source can be used to power the diode thermometer direct current voltage 12-16 V.


A transistor thermometer, the circuit of which is shown in Fig. 1, is significantly more sensitive. 79, b.


This is explained by the fact that here a transistor is used as a sensitive element, operating in an amplifier stage assembled according to a circuit with separated loads. Thanks to the amplifying properties of the transistor, the sensitivity of the thermometer increases tens of times. The controls and settings here are the same as in the previously discussed design.


When making a thermometer according to the diagram in Fig. 79, or you can use diodes like D105 or D106 (D1-D4), KS156A (D5). In the thermometer according to the diagram in Fig. 79, b transistor T1 can be of type KT315 or KT312 with any letter index. A thermometer with a transistor of the KT312 type will have less thermal inertia, since this transistor has a metal body, while the KT315 has a plastic body.


All described thermometers can also measure negative temperatures down to -70 ° C. In this case, it is advisable to install a microammeter in the thermometer at 100 μA with zero in the middle of the scale.


Semiconductor thermometers are very convenient for remote temperature measurement. For example, by placing several groups of diodes at different points of the refrigerator, by switching them you can control the temperature of the corresponding area. Another example is measuring the temperature of the earth's surface and the near-earth layer of air. In rural areas, this is of great importance, as it can warn of the onset of spring and summer frosts on the soil. You can monitor the temperature of the soil or air in the garden or vegetable garden using the readings of a device installed directly in the room. There are other possible applications for semiconductor thermometers.


Vasilyev V. A. Foreign amateur radio designs. M., "energy", 1977.

Digital thermometers are very convenient to use. First of all, it is important to note that they have a low percentage of error. Many models are capable of determining indoor humidity.

Devices with remote sensors are most suitable for laboratory research. Models differ in sensitivity and sensor type. In order to understand this issue, you should consider the standard circuit of a digital thermometer.

Device diagram

A conventional thermometer includes a multichannel type sensor, as well as a set of resistors. The signal is directly displayed on the display using a small microcircuit. Capacitors are installed on it. To increase the sensitivity of the device, use different types thyristors. The capacity of the modification depends on the capacitance of the transistors.

How to make a model?

Making your own digital thermometer is quite simple. The sensor itself must be selected as a probe type. Modifications with suction cups are difficult to do. You will also need a thyristor unit for operation. Next, to make a digital thermometer with your own hands, take a compact sensor. The microcircuit is selected from the PP20 series. Various elements are used to increase sensitivity. In this case, you can use an amplifier. As a rule, pulse modifications are presented on the market.

They are quite expensive, but they can do a lot of work. Capacitors are used to carry out the calibration process. On average, the element capacitance should not exceed 3.5 pF. To increase the permissible temperature threshold, resistors with different conductivities are used. In order to connect the sensor, you will need a two-wire cable. It is connected to the output contacts of the microcircuit using a conventional soldering iron.

DC-1 reviews

This digital thermometer with remote sensor is very easy to use. First of all, it is important to mention the wide temperature range. If necessary, the device can accurately determine the moisture level. The interface in this case is used from the RS series. A socket for connecting a USB cable is provided by the manufacturer. The thermostat measurement accuracy is no more than 1.3%.

The calibration speed of the equipment is quite high. The sensor in the device is of the probe type. The model is well suited for laboratory research. The protection system is provided in the IP31 series. The standard set of the device includes a battery sensor and a digital thermometer itself. Instructions are also included with the manufacturer. This model costs about 540 rubles on the market.

Description of thermometers DC-2

This is a fairly simple and convenient digital thermometer. Its circuit includes field-effect capacitors and a pulse transistor. The model is ideal for home use. In this case, the moisture level cannot be measured. According to customers, the equipment turns on quite quickly. Small batteries are included in the standard kit. The through resistance of the presented modification is at the level of 4.5 Ohms. The immediate minimum permissible is -70 degrees. The interface is simple and clear. There is no function for storing values ​​in the thermometer. The sensor is used as a probe type.

DC-5 device

This digital remote thermometer has a high permissible temperature threshold. The model is quite expensive, but has a lot of advantages. First of all, it is important to mention the low percentage of error. The sensor is of a multi-channel type. Calibration speed is high.

The interface itself is used by the RS series. The protection system in the equipment is installed IP32. The device has a moisture meter function. The device is ideal for field research. The through resistance of this modification does not exceed 6 Ohms. The presented thermometer is for sale at a price of 2100 rubles.

Thermometers Digital 202

This is a compact and convenient digital thermometer. Its circuit includes capacitive capacitors and a sensitive sensor. Many people buy the device for home use. If desired, it can show the moisture level in the apartment. The calibration speed of the model is very low. It is also important to note that the margin of error is as much as 2.5%. The through resistance indicator is at 4 ohms. The protection system is used by IP 33. The user can purchase a thermometer of the presented brand for only 600 rubles.

Digital 320 reviews

This digital thermometer with a remote sensor is sold with a fairly high-quality sensor. The sensor itself is installed of a multi-channel type. The average measurement time is 1.2 seconds. As a rule, the error rate does not exceed 0.8%. Most often, the model is purchased for laboratory research. However, it is important to note the low temperature limit.

The calibration process in the device takes a long time. According to customers, the device starts up with a slight delay. The device uses two batteries in total. They last for about three hours of work. The interface is provided by the manufacturer for the RS series. The USB port is located on the side panel. You can buy this thermometer for 1600 rubles.

Description of Digital 700 thermometers

This digital thermometer with a remote sensor is universal. In an apartment, it will help determine not only the exact temperature, but also the humidity level. The sensor itself is of a multi-channel type. The sensor is standardly provided with a touch sensor. In this case, the gain cannot be adjusted. The control interface is provided for the RS series.

According to customers, the thermometer turns on very quickly. However, the time to obtain results may be long. The sensitivity indicator of the presented model fluctuates around 4.5 mV. The through resistance of the modification is at 5 Ohms. The price of the presented thermometer fluctuates around 1300 rubles.

Digi Sense device

This digital thermometer receives mostly positive reviews from customers. Many owners praise the device for its compactness. If necessary, it is able to determine the exact level of humidity in the room. The interface is used as standard for the RS series. If necessary, the user can change the sensitivity parameter. Maximum permissible temperature equipment is 200 degrees. In total, the model uses one sensor.

In this case, the resistors are installed as a pulse type. According to experts, the batteries last for about three hours of equipment operation. The thermometer's capacitors are of the capacitive type. Taking this into account, the equipment has high accuracy. The error rate in this case is at the level of 2.1%. You can buy the presented thermometer for only 800 rubles.

Thermometers Shenzhen K55

This multifunctional digital thermometer with a remote sensor is designed for use in laboratory conditions. In this case, the sensor is connected via a three-wire cable. The equipment is powered through conventional lithium batteries. Time battery life- no more than three hours. The microcircuit in this case is of a switched type.

There is a USB connector on the side of the equipment. The model does not provide a function for storing results. It is also important to note that the model turns on with a low delay. The through resistance indicator does not exceed 5?4 Ohms. The presented digital thermometer with sensor is for sale at a price of 800 rubles.

Hello, friends!

On this page I will tell you about homemade electronic thermometer. This device designed to measure temperature outside the window on the street, made by me in several copies, each of which works flawlessly.

The measurement limits are limited from below by the type of sensor used at the level of -40ºС, from above - by the hardware circuit and software at +80ºС. Thus, the measurement range of the electronic thermometer is -40...80ºС. The temperature measurement accuracy is no worse than ±1ºС.

As temperature sensor The LM335Z sensor is used, made in the TO-92 housing:

This sensor has 3 legs, of which only two are actually used: “+” and “-”:

The sensor has the characteristic of an almost ideal zener diode (voltage stabilizer), the stabilization voltage of which linearly (more precisely, almost linearly) depends on the temperature of the sensor itself. By setting any current through the sensor in the range from 0.4 to 5 mA (for example, as shown in the figure above, using a resistor of a suitable value), we obtain the voltage on the sensor, which in tens of mV represents the absolute temperature (in Kelvin):

So, for example, at a temperature of 0ºС = 273.15K, ideally there will be a voltage on the sensor of 2.7315V, at a temperature of -40ºС = 233.15K on the sensor there will be 2.3315V, at 100ºС = 373.15K on the sensor there will be 3.7315V.

Thus, by measuring the voltage on the sensor, we are able to find out the temperature of the sensor itself.

basis electronic thermometer is a microcontroller from Atmel ATtiny26. This microcontroller is a microcircuit whose functions can be changed by reprogramming it. The microcontroller has several programmable pins, the purpose and functions of which can be determined by the designer of the device circuit (i.e., myself) using the firmware written into the microcontroller. In addition, this microcontroller contains a number of useful devices, including an Analog-to-Digital Converter (ADC) voltage.

An ADC is a device designed to convert an input analog signal (i.e., some current voltage value on one of the legs of the microcontroller) into some numerical value, which can then be used in the firmware as an input parameter. The resolution of this ADC is 10 bits. This means that inside the microcontroller, the result of converting the input voltage is represented by a number in the range from 0 to 1023 (0...1023, i.e. a total of 1024 values ​​- this is exactly the number 2 to the power of 10).

To obtain the ADC result, the input voltage is compared with the reference voltage generated by the Reference Voltage Source (VS) built into the microcontroller. According to the description for this microcontroller, its ION generates a voltage of 2.56V, however, the permissible range of its deviation from sample to sample is 2.4 ... 2.9V. Typical value is 2.7V. Thus, if the input voltage = 2.7V, i.e. equal to the reference voltage, then the ADC result will be equal to 1023, if the input voltage is half of the reference voltage, i.e. 1.35V, then the ADC result will be equal to half of 1023, i.e. i.e. 511. If the input voltage is greater than the reference voltage, i.e. more than 2.7V, then the ADC result will still be equal to 1023:

Since the maximum temperature for which it is designed Digital Thermometer, is 80ºС or 353.15K, and, therefore, the voltage on the sensor will ideally be equal to 3.5315V, which is greater than the reference voltage of the microcontroller ADC (2.7V), we will need a voltage divider from the sensor, for which we use two resistors:

Now you need to select the values ​​of all resistors. The device is powered from an unstabilized power supply, which uses a Chinese mobile phone charger:

Such charging device have a fairly large spread of output voltages, which (voltages), moreover, can change under load (sag). For thermometers, I selected chargers whose output voltage at idle (i.e., without load) is about 5.2...5.8V. This is no longer possible, since the maximum maximum supply voltage of the ATtiny26 microcontroller is 6V. We also assume that under load the output voltage of such a power supply can drop to 4.5V.

Let's consider two limiting cases:

  1. The voltage on the sensor is minimal (at sensor temperature -40ºС), the supply voltage is maximum (let’s take 6V for convenience):

  1. The voltage on the sensor is maximum (at sensor temperature 80ºС), the supply voltage is minimum (4.5V).

It can be seen that with the resistor values ​​indicated in the figures above, the current through the sensor is in the range of 0.87...3.67 mA, which is within the permissible limits of the sensor itself (0.4...5 mA). The values ​​of the voltage divider resistors from the sensor are chosen such that the current through them does not have a large influence on the current through the sensor, and at the same time, so that their reduced resistance (which in this case is about 7 kOhm) is significantly less than the input resistance of the microcontroller ADC (100 MOhm according to the description of the microcontroller).

It is also clear that throughout the entire operating range electronic thermometer, the voltage supplied to the ADC input varies within 1.74...2.64V, which corresponds to the ADC result within 660...1001. Therefore, if the ADC result is less than 660, we can talk about a sensor malfunction or a short circuit. If the ADC result is greater than 1001, we can talk about a malfunction of the sensor or its break, because if it breaks, the voltage divider on the 9.1 kOhm and 27 kOhm resistors will be connected almost to the supply voltage (through a 1 kOhm resistor).

Now let's consider digital indicator. It is used as a four-digit seven segment indicator from kingbright CA04-41SRWA or CC04-41SRWA with a bright red glow. CA04-41SRWA differs from CC04-41SRWA in the direction of the LEDs: in CC04 they are connected according to a circuit with a common cathode (common negative):

in CA04 - according to the scheme with a common anode (common plus):

For a seven-segment indicator, the segments are named with the Latin letters a, b, c, d, e, f, g, h as follows:

Each segment of the indicator is a separate LED, which can be turned on, i.e. lit, or turned off, i.e. not lit, depending on the polarity of the voltage supplied to them:

A resistor is needed to limit the current through the segment (LED) to the required level. Without it, it will be unacceptable to go through the LED high current- the LED will fail - it will burn out.

Let's estimate how many segments there are in four digits. It turns out that there are 8 x 4 of them = 32 separate segments (LEDs). If you manage each segment according separate wire, then to control a four-digit indicator we would need a microcontroller with 32 programmable legs, not counting the ADC input and power pins. Additionally, 32 resistors would be required in each segment (LED) circuit:

Is there a way to reduce the number of controllable pins on a microcontroller? It turns out there is! Already in the CA04-41SRWA indicator (CC04-41SRWA) the segments (LEDs) are connected according to the following scheme:

It can be seen that the segment pins of the first and second, as well as the third and fourth digits are combined in pairs. However, I went even further and already in the scheme itself electronic thermometer combined the segment findings of these two groups:

How many programmable microcontroller legs will we now need to control such an indicator? It turns out that it’s just 8 + 4 = 12. True, now we will have to manage not only segment, but also general digit outputs. Why?

Let's say we want to light only the "a" segment on the first digit, and only the "b" segment on the second digit. The remaining segments of these digits and all segments of other digits must be turned off. What should we do?

To light the “a” segment on the first digit, we need to apply “+” to the common wire of the first digit and “-” to the wire of the combined “a” segments. Similarly, to light the “b” segment on the second digit, we need to apply “+” to the common wire of the second digit and “-” to the wire of the combined “b” segments.

But then we will also have segment “a” of the second digit on, and segment “b” of the first digit, because current will flow to them too. But we don’t need them! What to do?

Who said they have to burn at the same time?

In fact, first we will apply “+” only to the common electrode of number 1, and to the common electrodes of the remaining numbers we will apply “-”, which prohibits their operation. Now, we will apply to the combined segment terminals the combination of signals necessary to display the desired sign on number 1 (in this case, “-” to the wire of the combined segments “a” and “+” to the remaining wires of the combined segments. Now we will only have the “segment” lit. a" of the first digit:

After some time, we will now apply “+” only to the common electrode of number 2, and we will apply “-” to the common terminals of the remaining numbers, including the common terminal of number 1. At the same time, we will change the combination of signals on the combined segment pins to the combination necessary to display the desired sign on number 2 (in our case, “-” on the wire of the combined segments “b” and “+” on the remaining wires of the combined segments. Now we will have a light on only the "b" segment of the second digit:

Similarly, after some more time, we will proceed with the third digit, only now we will not apply “-” to any of the wires of the combined segments, i.e. we will apply “+” to everything:

The same goes for the fourth digit:

After some more time, we turn on the “a” segment of the first digit again:

If the time for switching digits is short enough, that is, the digits switch quickly enough, we, people, create the illusion that segment “a” of the first digit and segment “b” of the second digit are lit simultaneously, and not alternately, but The method described above for including numbers is called " dynamic display".

Now where to connect the current limiting resistors? To common wires, or to segment ones? If you want to save on four resistors, connect to common ones; if you want the numbers to light up evenly, connect to segment ones.

In fact, if a resistor is connected to the common wire of any digit, then this resistor will generate current for ALL segments CURRENTLY ON in this digit. If this is one segment, all the current will flow only through this segment. If there are two segments, then the resistor current will be divided in half between these two segments; if all eight segments must burn, then the resistor current will be divided between all eight segments at once, i.e., each specific segment will receive only 1/8 of the resistor current. Thus, in each specific segment, the current will depend on how many segments are included in a given figure. The current is directly related to the brightness of the glow: the higher the current, the higher the brightness, the lower the current, the lower the brightness. As a result, the brightness of each digit will depend on how many segments are lit in it. This scheme was used in the first domestic “home” telephones with Caller ID of the “RUS” brand. It looked completely ugly.

If you connect resistors to segment terminals, each resistor at a particular time will work only on one segment of the indicator, therefore the currents and, consequently, the brightness of all segments of all digits will be the same. It looks much better.

In my practice, I use only the second option and connect resistors only to the segment pins:

How to choose the value of these resistors?

During normal operation of the segments (LEDs), a voltage drop of about 2V occurs across them. Some more voltage drop is formed due to the output resistance of the microcontroller pins. This drop can be of the order of 1V at maximum permissible current through a specific pin of the microcontroller, which, according to the instructions for the ATtiny26 microcontroller, is 40mA. The rest of the voltage is extinguished by our resistor.

Through which indicator wires does the maximum current flow? The maximum current flows through the common wires of the indicator at the moment when all eight segments are lit, since these wires carry the total current from all segments of a given digit.

Let's take this current through the common wires (at the moment when all eight segments of a given number are lit) at the level of the maximum permissible for this microcontroller, i.e. 40 mA. Then the current through any segment should be eight times less, i.e. 5mA. Considering that the maximum supply voltage of an electronic thermometer can reach 5.8V, we find that the resistor can drop 5.8 - 2 - 1 = 2.8V. So we need a resistor that will provide a current of 5mA with a voltage drop across it of 2.8V: 2.8 / 0.005 = 560 Ohms. In fact, we have not yet taken into account that 5.8V is the maximum NOLP voltage of our power supply, while under load it can drop, so the current through each indicator segment will be even less than 5mA. Consequently, the current in the common wires of the indicator will be less than 40mA, therefore, the microcontroller current limit will never be reached.

By the way, in electronic thermometer there is no need to use a dot segment in the numbers (the "h" segment). Therefore, the electronic thermometer circuit provides only seven combined segment wires, and not eight, since the combined wire of the point "h" segments is not used in the electronic thermometer circuit:

This circumstance further reduces the current through the common wires of the numbers.

Let's now talk about the ATtiny26 microcontroller in more detail.

The microcontroller can be compared to the real one desktop computer, only in a greatly truncated and reduced form.

The microcontroller has a built-in CPU, which performs all arithmetic and logical calculations.

The microcontroller has a program memory into which the developer (i.e., I) writes his own microprogram, developed by him, in accordance with which all further operation of the microcontroller is carried out. This program memory can be compared to hard drive desktop computer on which, for example, a program is located Microsoft Word. If we want to prepare Text Document and for this we launch Microsoft Word, then at this moment its (i.e. Word’s) program actually begins to execute.

The microcontroller has RAM, which stores the current values ​​of the program’s operating variables, for example, ADC results from a temperature sensor, or sets of data for output to a seven-segment indicator at different moments of dynamic display.

The microcontroller has a non-volatile EEPROM memory designed to store user settings even when the power to the microcontroller is turned off. Let's say you have a TV at home. Once you set up TV channels in it, and now you watch them, switching between them. Next, take it, turn off the TV and remove the plug from the socket. Now the TV circuit is completely de-energized. But nevertheless, the next time this TV is plugged in, for some reason the previously made program settings were retained! And we can watch our tuned TV channels again. Where are these settings saved? If the TV was built on an ATtiny26 microcontroller, these settings would be stored in non-volatile EEPROM memory. Non-volatile, because we turned off the TV from the outlet, but the TV channel settings were still saved. EEPROM memory can also be compared to the hard drive of a desktop computer, but now we will not be writing to it. Microsoft program Word, and the results of its work are text files prepared by us.

The microcontroller has a clock frequency, which in this ATtiny26 microcontroller can reach 16 MHz. In this case, the microcontroller processor can theoretically produce up to 16 million arithmetic or logical operations in one second. The clock source can be different devices, For example quartz resonator or crystal oscillator. IN electronic thermometer The 8 MHz RC oscillator built into the microcontroller is used as a clock source.

The microcontroller has programmable input/output ports, or, more simply, programmable legs. Each of these legs can be used as an input - to enter information into the microcontroller, such as information about whether a button is pressed or not, or as an output - to output signals from the microcontroller, for example to a seven-segment LED indicator.

The microcontroller even has a “Reset” leg - similar in function to the Reset button on system unit desktop computer.

In addition, the microcontroller has a number of built-in useful devices that can take on many standard functions and thereby relieve the burden on the central processor. These include timers, comparator, ADC, communication interfaces with external devices or other microcontrollers, interrupt controllers, etc. All these useful devices can be turned on, off, selected different modes, and also monitor the results of their operation using memory cells (control registers) specially provided in the microcontroller, writing into which different sets of data can be control one or another microcontroller device. From a programmer's point of view, these control registers are no different from the cells of a regular random access memory microcontroller.

The microprogram for the microcontroller is prepared on a desktop computer. For this, I use the program development environment for microcontrollers Algorithm Builder - this is a domestic analogue of Assembler, which, however, allows you not to “write” programs, but to “draw” them in a very convenient graphical form:

For some time now, this environment has become completely free for any volume of the program! You can download it from the developer's page. This program was created and maintained by a Russian craftsman This address Email protected from spam bots. You must have JavaScript enabled to view it. .

In order for the microcontroller to start working using the prepared firmware, it must be programmed. The microcontroller is programmed right in the circuit electronic thermometer(so-called “in-circuit programming”), by connecting the microcontroller to a desktop computer through a special programmer. How to make a simple programmer that works through a computer’s COM port is described in the instructions for the Algorithm Builder environment. A more sophisticated version of the programmer for this environment is presented on the AVR USB programmer for Algorithm Builder page.

To program the microcontroller, 5 wires are used - 4 signal and one common. The signal wires include the “Reset” wire, since the microcontroller is programmed while in the Reset state. The other 3 signal wires are ordinary I/O legs, which, in addition to programming, can be used for their intended purpose, i.e. as I/O ports. In particular, in the circuit of an electronic thermometer, some combined segment pins of a seven-segment indicator are connected to them. However, it is necessary that the part of the circuit connected to these pins does not interfere with the programming process, otherwise programming will become impossible.

In order to prevent the microcontroller from triggering a reset under the influence of external electromagnetic interference, I connect a 5.6nF capacitor to the “Reset” pin in the immediate vicinity of the microcontroller:

Why exactly 5.6nF? In general, the more, the better. But it was experimentally determined that 5.6nF is the maximum capacitance for this capacitor, at which the microcontroller programming circuit continues to work stably. After all, this capacitor shunts the signals at the "Reset" input coming from the programmer. If the capacitance of this capacitor is increased, then the programming process becomes unstable, and if it is greatly increased, it becomes completely impossible.

You can program the microcontroller not just once, but many times (10,000 times guaranteed, according to the instructions). This is especially useful when debugging a device, where we can first program only the display functions (if the device has an indicator or other means of displaying information) to see what is happening internally, and then gradually build out the rest of the firmware.

For the convenience of connecting the programmer to the microcontroller, in most of my devices on microcontrollers, I provide a five-pin connector of the following type:

It is to this that the programmer is connected to write the microprogram into the microcontroller.

Finally, in order for the microcontroller to work at all, it must be powered. For this purpose, the "VCC", "AVCC" and "GND" pins are used. According to the power supply system, the ATtiny26 microcontroller is divided into two parts: digital and analog. The analog part refers to the ADC and everything connected to it inside the microcontroller. This part is powered through its own power output (or rather input) called "AVCC". The other (rest) or "digital" part of the microcontroller is powered through the "VCC" pin (input). Both of these wires should be supplied with “+” from the power supply. The "-" power supply is connected to the "GND" (or "Ground" or "Common") pins of the microcontroller. The ATtiny26 microcontroller has two “GND” pins:

To protect the microcontroller from the influence of external and internal electromagnetic interference, the rules for constructing radio circuits strongly recommend that you bypass the power pins with ceramic capacitors in the immediate vicinity of the microcontroller:

In addition, to further protect the analog part of the microcontroller from interference, it is recommended to supply power to the “AVCC” pin through an LC, or at least an RC filter. For “R” I used a 30 Ohm resistor, for “C” I used a 1 µF capacitor:

Finally, to reduce the level of noise at the input of the ADC to which the sensor is connected temperature through a resistive voltage divider, I also connected a 1 µF capacitor to this input, and took the power for the sensor itself from the power input of the "AVCC" microcontroller:

How is a microcontroller able to control a seven-segment LED indicator and apply either “+” or “-” to its pins? It turns out that each programmable input-output, if it is used in the microcontroller firmware as an output, is connected inside the microcontroller according to the following circuit:

If we want the output to be “+”, in the microcontroller firmware we issue a logical one (logical “1”) to this pin:

If we want the output to be “-” (aka “0”, “Common” or “Ground”), then in the microcontroller firmware we must output a logical zero (logical “0”) to this pin:

The seven-segment indicator is connected to eleven programmable pins of the microcontroller, but for simplicity, we will consider only two of them. To light the segment “a” of the first digit, we need to apply “+” to the common wire of the first digit and “-” to the segment pin “a”. To do this, we need to submit a log in the microcontroller firmware. "1" to the general output of the first digit and the log. "0" to segment pin "a". In this case, the “a” segment of the first digit will be lit:

If we want to turn off this segment, we will do the opposite: we will submit a log in the microcontroller firmware. "1" to segment output "a" and log. "0" to the general output of the first digit. Then our segment “a” of the first digit will not light up - after all, this LED will be locked:

When using the CC04-41SRWA seven-segment indicator instead CA04-41SRWA(remember that they differ in the polarity of the LEDs), you need to change the log in the firmware. "0" and log. "1".

So, it's time to consider complete circuit diagram of an electronic thermometer:

Actually, the full diagram shows everything that we talked about above. The numbers 0603 and 0805 next to the designation of resistors and capacitors indicate their standard size (in hundredths of an inch). This designation is used to indicate the size of radio elements for surface mounting.

The capacitor on pin 17 of the microcontroller is actually connected to the ADC ION to give it greater stability and protect the ADC from interference.

Legs 19 and 20 of the microcontroller are not used in this circuit, and so that they do not “dangle in the air,” I connected them to the common wire of the circuit. In the microcontroller firmware, these pins are written as outputs to which logical zero is output at all times. Thus, the internal circuit of the microcontroller is additionally connected to the common wire through these legs:

The microcontroller firmware is structured as follows. First, after power is applied, as well as after a reset, the entire RAM of the microcontroller is cleared, including all control registers of all useful devices built into the microcontroller. This was done in order to know for sure that we will not have random data in RAM or false inclusions of certain things internal devices as a result of failures from, for example, a short-term power loss.

After clearing the RAM, some internal devices are configured, such as:

Timer No. 0 (and there are 2 of them in this microcontroller: Timer No. 0 and Timer No. 1), because the part of the firmware responsible for the dynamic indication will work according to this timer;

A watchdog timer that will cause a reboot (Reset) of the microcontroller if it freezes (if the firmware is inactive for more than 0.5 seconds);

I/O ports. It is at this moment that it is determined which of the programmable legs will be the output to the seven-segment LED indicator, the ADC input becomes precisely the input, and grounded pins 19 and 20 become “additional GND pins”;

Analog-to-Digital Converter (ADC), at this moment the exact input to which the temperature sensor is connected is selected, the built-in Reference Voltage Source (VS) (2.7V) is selected and the first ADC process is started.

After this, the microprogram goes into loop and begins to go in a circle, executing the unconditional jump operator on itself. When Timer #0 counts down specified time(approximately 1/500 sec), it causes an interrupt, the microprogram stops walking in a “vicious circle” and processes the part of the algorithm specified in the interrupt processing from Timer No. 0. Timer #0 itself starts counting down the next 1/500th of a second. Upon completion of interrupt processing from Timer No. 0, the microprogram returns to its “closed circle”. Thus, the algorithm described in interrupt processing for Timer No. 0 is executed 500 times per second. What kind of algorithm is this?

The interrupt processing algorithm for Timer No. 0 contains two parts: an algorithm for preparing values ​​displayed on indicators, and an algorithm for processing dynamic indications.

The algorithm for preparing values ​​displayed on indicators works as follows. The ADC algorithm (see below) supplies the absolute value of the measured temperature (in Kelvin). This value is used to determine sensor damage (break or short circuit), and also determine the temperature value in ºC and select the method for displaying this temperature on the indicators. So,

if the sensor is damaged (if temperature too small (short circuit) or too large (break)) the indicator displays dashes " - - - - ";

At a temperature of 0...9ºС, for example 5ºС, the temperature value is displayed on the indicator in the form: "5 ºС" (the first digit does not light up);

At temperature more than 9ºС, for example 27ºС, the temperature value is displayed on the indicator in the form: “2 7 ºС”;

At temperatures in the range -1...0ºС the indicator displays the value temperature in the form: "- 0 º C";

At a temperature in the range of -9...-1ºС, for example at a temperature of -7ºС (i.e. at a temperature in the range of -8...-7ºС), the value is displayed on the indicator temperature in the form: "- 7 º C";

At temperature less than -9ºС, for example at a temperature of -18ºС (i.e. at a temperature in the range of -19...-18ºС), the temperature value is displayed on the indicator in the form: "- 1 8 º".

In order to display on the indicator temperature value, it must first be “decomposed into components,” that is, into tens and units of ºС. After receiving the value of each indicator digit (symbols "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", " " , “-”, “º” and “C”), using this value, one or another set of segments is selected for a given indicator location, displaying the required symbol. These four sets (according to the number of familiar places (digits) on the indicator) are stored in four cells (bytes) of RAM.

The algorithm for processing dynamic indication is arranged as follows. A cell is assigned in RAM, which represents the number of the digit displayed in this moment dynamic indication. The value of this cell increases by one with each interrupt from Timer No. 0, and when the value “4” is reached, it is reset to zero. Thus, the value of this cell “runs through” a series of values ​​0, 1, 2, 3, then again 0, 1... etc. The value “0” corresponds to the first digit of the indicator, “1” to the second, ... , "3" - fourth. It is by the value of this cell that the dynamic indication algorithm selects the indicator digit that must be turned on during the time until the next interruption of Timer No. 0. A combination of signals for this particular indicator digit is output to the segment wires of the indicator (exactly one of those four that are stored in RAM by the algorithm for preparing values ​​for the indicator). And the common wire of this particular digit is supplied with a “+” that allows it to glow (log. “1”). Thus, each digit lights up during the period of time between interruptions from Timer No. 0, i.e. for 1/500 sec. Since there are only four digits, the indicator is updated at a frequency of 125Hz.

The ADC, upon completion of the next conversion, just like Timer No. 0, causes an interrupt. However, the algorithm for processing this interrupt is its own. After processing of this interrupt is completed, the next ADC conversion starts.

The ADC interrupt processing algorithm performs the following actions. In the RAM of the microcontroller, a cell (of 2 bytes) is assigned that functions as a counter of completed ADC conversions (which is the same as a counter of the received ADC results). With each interrupt upon completion of the next ADC conversion, the value of this cell increases by one. In addition, another cell (of 3 bytes) is assigned in the RAM, which is used to summarize the ADC results. With each interruption upon completion of the next ADC conversion, the new ADC result obtained is added to the existing value of this cell.

When the counter of completed ADC conversions reaches the value 16384, this counter is reset to zero and starts counting again, and the sum of the ADC results is divided by 16384, the result is stored, and the sum itself is then also reset to accumulate the sum of the next 16384 ADC conversion results.

The result of dividing the sum by 16384 is the average of the ADC results over 16384 results. Averaging is necessary to increase the stability of readings and eliminate flickering of the least significant digit. The average value is used to calculate temperatures in Kelvin. To recalculate the result of the ADC conversion to Kelvin, it is necessary to multiply the ADC result by a certain coefficient. This coefficient is very easy to determine.

To calculate a certain coefficient, the microcontroller firmware is changed in such a way that the indicator displays not the temperature, but directly the average value of the ADC results. The sensor is placed in a glass of water in which pieces of ice float and the whole mixture is intensively mixed to stabilize the temperature in the glass and equalize the temperature of the sensor with it (the sensor, of course, must already be protected from moisture (see below), otherwise the water will will short-circuit his conclusions and greatly distort the results). Temperature a mixture of water and ice, as everyone knows, is 0ºС or 273.15K. Let's assume that the average ADC result is 761 units. Then our required coefficient is 761 / 273.15 = 2.786. Actually, after dividing the average ADC result by this coefficient, we get temperature in K. This temperature value in Kelvin is stored in one of the RAM cells of the microcontroller, in order to then be used by the algorithm for preparing the values ​​displayed on the indicators (see above).

The average ADC result is obtained approximately once every 2 seconds. This is how often the readings change electronic thermometer with a sudden change sensor temperature.

Lastly, I would like to note that while the first average value of the ADC results is being determined (i.e., for about 2 seconds), all used segments are turned on on the indicator, i.e., “8 8 8 8.” This was done to be able to quickly check the serviceability of all used indicator segments if necessary.

At the request of site visitors, I provide the source code and firmware for the microcontroller firmware of the electronic thermometer with detailed comments:

I remind you that all materials from this page can be used only for personal use (not for commercial purposes).

The AVR USB microcontroller programmer page for Algorithm Builder talks about how to build a more advanced programmer for programming microcontrollers from this environment.

In addition, it will be necessary to program its so-called "Fuse bits". These bits determine a number of critical parameters of the microcontroller, such as the clock source and programming method. You can set the required Fuse bits values ​​in the "Options" menu - "Project options..." - the "Fuse bits" tab, or from the programming window via the Fuse bits link... In any case, these bits are set in the Fuse bits installation window, and should be installed EXACTLY as in the picture below:

Structurally Digital Thermometer made on two printed circuit boards Oh. See how to make high-quality printed circuit boards at home. On one board there is a seven-segment LED indicator, on the other the rest of the circuit:

For those who are planning to repeat this design, I post the trace files of these boards:

T1.PCB.rar (37.6kB) - trace file of printed circuit boards of an electronic thermometer in P-CAD program 2006:

After installing the components and cleaning them from flux, these two boards are soldered together into a single block using PLS pin combs:

The boards are mounted in a G1015 case manufactured by Gainta Industries. This case needs a little modification, cutting out a window for the indicator and a couple of holes for attaching the printed circuit board unit.

On the indicator side, thin transparent plexiglass (plexiglass), cut from a CD box, is glued to the body, onto which a tint film for tinting car windows is then glued twice. A double layer of tint film is enough to make the entire glass appear opaque (black) from the outside, but the glowing numbers of the indicator are clearly visible through it:

Using the “ears” of the case, the electronic thermometer can be screwed to a wall or something else.

In the first version, the electronic thermometer sensor is placed in a piece of tube from the telescopic antenna and filled with epoxy glue:

In subsequent versions, I wrapped the sensor with several turns of thick cotton thread (reinforcement) and soaked it with wicking sealant for car glass. This option, in my opinion, is even more moisture resistant than the first, although less durable from a mechanical point of view:

This page provides free access to all necessary information and design documentation for independent repetition of this design.


In this article we will review digital thermometer, built on microcontroller Attiny2313, equipped remote digital sensor DS18B20. The temperature measurement range is from -55 to +125 degrees Celsius, the temperature measurement step is 0.1 degree. The circuit is very simple, contains a minimum of parts and can easily be assembled with your own hands.

Description of the operation of the thermometer circuit

Homemade electronic thermometer with remote sensor built on everything known. The DS18B20 microcircuit from Dallas acts as a temperature sensor. Up to 8 digital sensors can be used in a thermometer circuit. The microcontroller communicates with the DS18B20 via the 1Wire protocol.

First, all connected sensors are searched and initialized, then the temperature is read from them and then displayed on the three-digit seven-segment indicator HL1. The indicator can be used with both a common cathode (CC) and a common anode (CA). A similar indicator was also used. Each indicator has its own firmware. You can measure the temperature both at home and outside; to do this, you need to take the DS18B20 outside the window.

For Attiny2313 you need to set the fuses as follows (for the program

Often circuits are assembled according to the residual principle: something is lying around somewhere - you can solder something. This is exactly the case where you don’t need to buy anything, since all the parts of the thermometer are the most common. The use of cheap 176 series microcircuits (K176LA7 and K176IE4) made it possible to create a digital thermometer, which, despite its simplicity, has high repeatability and sufficient accuracy for everyday purposes. Digital temperature sensors have often been installed lately, but here they are an ordinary thermistor with a negative TCR and a resistance of approximately 100 kOhm.

Digital thermometer was originally conceived as a household item, which should hang somewhere near a window all its life. The owner of a thermometer is primarily concerned with what the temperature is outside. Therefore, the thermometer can have an external temperature sensor, located, for example, on the outside of the window frame, or only an internal one, if you need to control the temperature in the room.

You should often look at the thermometer when lighting conditions are poor - for example, in the middle of the night. Therefore, LCD indicators, even backlit ones, are not suitable. LED indicators of the ALS type have better readability in low light conditions. The parameters of the thermometer in terms of measurement error are entirely determined by the calibration settings on the reference thermometer. The thermometer diagram, along with the entire page from the radio designer magazine, is given below:


The printed circuit board design of the thermometer body depends on the desired product design, so it is not given here. A photo of my board is given below.