Do-it-yourself electronic thermometer on a pic microcontroller. Electronic thermometer with wine sensor DS18B20 on Attiny2313 microcontroller

Antipyretic remedies for children are prescribed by a pediatrician. But there are situations of indispensable help in case of care, if the child needs to give faces negligently. Then the fathers take on themselves the resuscitation and stop the antipyretic preparations. What can be given to infants? How can you lower the temperature in older children? What are the most safe faces?

Let's have a look at this article digital thermometer, prompted by microcontroller Attiny2313, baked digital wine sensor DS18B20. The average temperature should be set from -55 to +125 degrees Celsius, the minimum temperature should be 0.1 degrees. The scheme is rather simple, you can easily remove a minimum of details and її you can easily pick it up with your own hands.

Description of the robotic circuit of the thermometer

Self-contained electronic thermometer with wine sensor promptings for everything. The role of the temperature sensor has a DS18B20 chip from Dallas. The thermometer circuit can contain up to 8 digital sensors. The microcontroller interacts with DS18B20 over the 1Wire protocol.

At the same time, a signal is sent and the initialization of all connected sensors, then from them the temperature reading is taken from the coming display on the three-digit seven-segment indicator HL1. The indicator can be stagnant both with a glowing cathode (OK) and with a glowing anode (OA). A similar indicator is also a stagnation indicator. Under the skin indicator є firmware. You can control the temperature both at home and on the street, for which you need to blame the DS18B20 for the whole day.

For Attiny2313, it is necessary to install the fusion in the coming order (for software

I would like to point out that the board was designed and that the design was expanded with a rozrahunkom for those, sob to build a compact attachment that is attached to the wall.

We will build a caravan for an additional one button. The program for the microcontroller is written in C, but there are comments, and you can modify it according to your specific needs, or expand the functionality. The library of Peter Fleury is ready for cultivating the Republic of Kazakhstan as an indicator of winning (archives for the acquisition are available from the distribution of the acquisitions). Additional data may be displayed in degrees Celsius or Fahrenheit. Є k_lka modes_v keruvannya pіdsvіchuvannyam _indicator.

Also, this option means one important point: the device can enable wireless data transfer via Bluetooth with the help of a special module (optional).

Schematic diagram

From a glance, the circuitry is awkwardly attached, and we can look at the edge of the elements.

Dzherelo zhivlennya thermometer vykonano on the basis of an integrated voltage regulator in a standard included (with ventilated capacitors to filter). Voltage Regulator 3.3 AMS1117 the most common use of such modules 3.3.

The indicator that is displayed at the extension is the standard garden indicator on the HD44780 controller. The assignment transistor for controlling the switching of the indicator by logical signals from the microcontroller or a PWM signal from the microcontroller. Resistor R3 connects the stream through the base of the transistor, resistor R1 pulls the base to zero potential.

The basis of the thermometer is a microcontroller, which operates at a frequency of 8 MHz and takes into account all the necessary peripherals.

The DHT-11 sensor is an inexpensive sensor for temperature and water content, which is used in projects as an outdoor sensor. Vіn not vіdraznyaєtsya vysokoy svidkodієyu that tchіstіvі, prote znayut their zastosuvannya at radioamatorskih projects through its not high varіst. The DHT-11 is built with an external moisture sensor and thermistor. It is also possible to use the sensor in your own ADC for converting analog values ​​of moisture and temperature.

Main characteristics:

  • low varity;
  • life voltage 3 - 5 V;
  • data transmission via 1-Wire bus on a distance up to 20 m;
  • determination of water content 20-80% from 5% accuracy;
  • maximum strum damping 2.5 mA;
  • temperature setting 0 ... 50 ° with an accuracy of 2%;
  • sampling frequency is not more than 1 Hz (not more than once per 1 s);
  • size 15.5×12×5.5 mm;

The next thing to note is that you can find a DHT-22 sensor for sale, which has the same interface, but also the best characteristics.

The sensor is connected to the microcontroller via the 1-Wire bus (connector JP3 in the diagram) with a variable resistor, which is connected to the data line and a blocking capacitor for life.

As an internal sensor, the analogue temperature sensor LM35 IC5 is widely expanded, which is connected to channel 1 of the ADC of the microcontroller.

Connector J1 to the interface of the internal circuit programming of the microcontroller allows you to quickly change the program code or update the software. To connect a thermometer behind the UART interface, the JP1 connector is used. The switch button SW1 is connected to the input of the call reset of the microcontroller, this input is pulled to the port by an internal resistor.

Bluetooth module for wireless data transfer, which is shown on the diagram as IC3, GP-GC021, also connects to the UART interface of the microcontroller and allows data transfer to a PC, mobile phone or web server. On the other board, the space of the installed module was transferred. At rozdіlі zavantazhen є description of the module, the process of vzaєmodії and commands.

The RK indicator is installed on the front part of the other board in the connector, and in this way the components are installed on the main board, and we have to make a compact attachment. The place where the Bluetooth module is installed is on the right side of the other board (div. photo of the board).

The ethereal look of a ready-made fabric for a thermometer


Baby handmade payment at CAD Eagle

Board with built-in Bluetooth module

Enthusiasm

Schematic diagram of the board (Eagle), PZ (external code, firmware) -
Library for robots with RK indicator on controller HD44780
Technical description Bluetooth module GP-GC021 -


This is the best digital thermometer, on the Internet there are a lot of similar devices. The basis of the microcontroller PIC16F628A and digital temperature sensor DS18S20 (DS18B20). As indicators of stasis of light 3-digit indicators of green color. The indication is dynamic. The thermometer works in the entire temperature range of the DS18S20 sensor, tobto. air -55 to +125 degrees.

Selected thermometer on a different plate at the same time with an indicator. The sensor and life are connected okremo. If the sensor is not connected, the letter E (Error) will appear on the indicator. There are no daily special features of the Danish attachments. Diode VD1 serve for the protection of the polarity reversal of life.

The attachment can be used both with the DS18B20 sensor and with the DS1820(DS18S20) sensor. Under the skin sensor, the firmware of the microcontroller is changed. Below is a variant of the thermometer that is installed on a different board with a single bridge and a stabilizer 7805, that is. for life, I will add enough to connect the secondary winding of the transformer to the life socket. In addition, a light-diode is installed on this board, which is a kind of fast sleeper for an hour of testing the temperature sensor by the microcontroller. Svіtlodiod podklyucheniya mizh nіzhkoy RB3 (vysnovok 9) і mass, naturally with a resistor. The presence of a light-emitting diode on the board does not interfere with the operation of the thermometer.

Attachment to manually expand in a plastic box of suitable expansions. I have installed it at the housing of the framing unit (Adapter) at once with a transformer. Tobto. There are no more plugs to go out of the box to the DS18B20 sensor, and the case itself is inserted into the 220V gauge.



File:
Rozmir:
Vmist:

sm_termo.rar
38.3 KB
Little boards (LAY) and microcontroller firmware.

Abo yoga analogues. Fit a good accuracy, stability to a shift code, and, in parallel with analog solutions, significantly simplify the circuit. Between similar temperature sensors, sound the exchange with a range of -55 to 125 ºС. What work is required to keep the temperature higher than 125 °C? Obviously, it is necessary to use analog sensors, the temperature range of which can reach +300 °C. The next step is to indicate which way the accuracy of the vimiriv will decrease. Ale often at high temperatures, it is more accurate to know the value of neobov'yazykovo, and the shift in a few degrees will be pleasant, and when it is displayed on an analogous scale, for example, on the line of light, it's incomprehensible.

For normal operation, I will attach at a temperature of 0 ... 250 ° С, an analog sensor should be set to work range of -40 + 300 ° С. For the processing of these data, a microcontroller (MK) is given. Obviously, fit and be any other, but the author of this MK seems to be one of the most accessible and most popular. The fuse is overstocked from the factory. When razv'yazannі tasksі criteria of exact vimіru buli vіdkladenі to another plan. Pohibka ruled no more than a few degrees.

Digital indication of the results of vimiriv

The LCD display is used for digital display. Behind the bazhannym attachments, you can modernize by upgrading the program code. Vіlnih ports vіdnya vіvednya for tsgogo enough. LCD display connected via 4-bit bus (Malyunok 1). The older ranks of the indicator D4 - D7 are connected to the younger ranks D0 - D4 of the microcontroller. There are no traces of exact clock references in the same annex, then there is no need in the outer quartz resonator. To ports PB6 and PB7 connected to the display brackets. Like Bachimo, all lines of control of the display come out from one side of the MK case, which will make it easier to move the other board.

Temperature calculation

Figure 1 shows that the analog temperature sensor is connected to the ADC input of the microcontroller. When vikoristanny operative pіdsiluvacha the kidnapping was less. The voltage to the ADC is supplied through a dilnik, using a thermistor and a replacement resistor. For the shortest accuracy, the change of the vibrating resistor is adjusted with a variable rotation.

Table 1 Temperature support.

Temperature ºС

Opir Ω

Based on Mathcad's Table 1 graph (Malyunok 2), you can check the validity of the analog sensor support according to the applied temperature. The given data of the tables are taken from the technical description KTY84_130. The function may be practically linear in nature, only for small respirations at high temperatures.

At a moderate temperature of 0 ºС, the thermistor opir becomes 498 Ohm. The voltage at the output of the dilnik is good

  • U D - voltage on the earth temperature sensor,
  • U ПІТ - voltage of life,
  • R D - opir temperature sensor,
  • R 1 - insertion of a replacement resistor.

At a temperature of 0 ºС, the voltage at the input of the ADC is due to become 0.6 V. To calculate the temperature value, the author has written the following formula:


  • ADC - 10-bit digital ADC code, readings from the sensor,
  • U OTS ​​- the most important value (60), which is 0.6 at 0 ºС.

The range of variable temperatures from 0 ºС to 250 ºС is determined by the input voltages of the ADC, which come from the outlet, from 0.6 to 1.8 V. The reference voltage of the ADC is set to 5 V; to convert to three digits ASCII code. Scaling the KTY84_130 sensor for a maximum temperature of 300 ºС, it is better to leave a small margin and 250 ºС.

Little 5 shows attachments, pickings on the breadboard. The code of the program is valid, and the skin can easily be supplemented by yogo pіd vlasnі zavdannya.

MK software and Proteus virtual model for LCD 16×2 -

MC software and Proteus virtual model for LCD 8×2 -

Thermometer on ATmega8 and temperature sensor DS18B20

Thermometer circuit on ATmega8 and DS18B20

Digital thermometer DS18B20
Seven-segment light indicator
Thermometer program algorithm
Digital thermometer program on DS18B20

The scheme of the program is simple digital thermometer from the substations of the microcontroller ATmega8 temperature sensor DS18B20. The thermometer allows you to control the temperature from 0 to 99 degrees with an accuracy of up to 0.5 degrees with a separate building of 0.1 degrees.

The thermometer, due to its characteristics, is even simpler and can only be used as a thermometer to control the “room” temperature. Incorporate a microcontroller in this design with a memory of 8 kilobytes, extremely cost-effectively, you can put a microcontroller in a simpler way. It is worth noting that this design is the basis for further development of the DS18B20 digital temperature sensor. At the next article, the design of another thermometer will be published - on two DS18B20 sensors, which will allow you to control the temperature not only in the room, but also overboard. Naturally, you will be given the opportunity to overcome the negative temperature. It will be added to the design the function of a thermostat, a yearbook, the ability to work with different preferences, which will allow you to choose an awkward design - the basis of a "reasonable house". Well, today is the first article from the cycle of the series.

Thermometer circuit on ATmega8 and temperature sensor DS18B20

Let's look at the thermometer circuit:

Like a bachite, the scheme is rather simple, it only needs a minimum of details.
The scheme for indication has a seven-segment three-digit light indicator.

Structural stress - 5 volts. If you install the microcontroller with low-voltage power, then you can reduce the voltage of the structure, and in the same way, you can change the rating to extinguish the supports in the segments of the indicator. Approximately nominal values ​​of supports can be taken:
- When eating 5 volts - 200-300 Ohm
- When eating 2.7 - 3 volts - 100-150 Ohm


transistors- Be-yaki, low-power, NPN structures.
temperature sensor - DS18B20
Seven-segment indicator - Whether it be a three-discharge cathode. If you want to zastosuvat іnshі, іz a hot anode, if you happen to replace transistors on PNP and make changes to the program (replace the array of two codes for displaying digits on the indicator). I zastosuvav indicator of the red color of the candle, and at the same time, for the offensive scheme, preparing the same, ale black color of the candle.

Details of the thermometer on the microcontroller ATmega and DS18B20



Pinout of ATmega8 microcontroller:

Three-digit seven-segment indicator FYT-5631AUR-21:

Temperature sensor DS18B20:

Transistors BC547C:

The algorithm of the robotic thermometer on the ATmega and DS18B20

Usі installations of the microcontroller are factory, FUSE-bіti chips are not required.

For the robotic program, two timers / controllers of the microcontroller are set:
eight-digit T0
sixteen-digit T1
For help eight-digit timer T0 of the per-week-client pereprivance by re-routing with the internal frequency CK/8 (period of 2 milliseconds) of organizations:
- Razrahunok flow temperature
- dynamic display of the results of temperature monitoring by the DS18B20 sensor
For help sixteen-digit timer T1 of the per-week-klick-laced relapsing with the internal frequency CK/64 (period of 4 seconds) was organized:
- Sending a command to the DS18B20 sensor to monitor the temperature
- Reading the measured temperature from the sensor
In principle, you can use one eight-digit timer / chime, as well as to set the cycle for reordering, with an internal frequency of CK / 8, and to organize the entire work of the circuit in the process of reordering. And on the right, there is no sense in it - the DS18B20 sensor needs three times less than 1 second (at 12-bit resolution) to convert (define) the temperature, so it is often lower than 1 time per second and it is not possible to convert the temperature data. In addition, more often than not, the temperature was updated before the sensor heated up, and, apparently, the creation of real data. The choice of another lichnik allows you to set intervals for the hour of temperature control.

The axis looks like the main part of the program in Algorithm Builder:

De:

SP- Adjusting the post address of the stack

Timer 0- Setting the timer T0:

Timer 1- Setting the timer T1:

TIMSK- Adjustment of interruption of timers:

Init_Display- subprogram for adjusting the ranges of ports, which take part in the dynamic display of data on a three-digit seven-segment indicator

1 -> I- Global allowed reset

How to blame the power, as if it was not possible to understand what the food was like the programs, write - let's say.

(2.4 KiB, 7004 hits)

Support the project - share your efforts, darling!
Read also
How to fix pardons with a tunnel at Hamachi - a yellow tricot and a blue dress How to fix pardons with a tunnel at Hamachi - a yellow tricot and a blue dress What is Robity, what is GTA V galmuє? What is Robity, what is GTA V galmuє? Play via the Internet in the HOTSEAT game (not for one PC, but as many) Play via the Internet in the HOTSEAT game (not for one PC, but as many)