Thermometer on the PIC16F628A and DS18B20 (DS18S20) microcontroller - an article with a detailed description of the memory thermometer circuit and, in addition, a logical continuation of the article I previously published on the Yandex site pichobbi.narod.ru. This thermometer has proven itself quite well, and it was decided to modernize it a little. In this article I will tell you what changes have been made to the scheme and work program, I will describe the new functions. The article will be useful for beginners. Later I converted the current version of the thermometer into .
The thermometer on the PIC16F628A and DS18B20 (DS18S20) microcontroller can:
The thermometer also provides for easy replacement of the 7-segment indicator from OK to an indicator with OA. A gentle procedure for writing to the EEPROM memory of the microcontroller has been organized. A voltmeter that has proven itself well is described in this article -.
The circuit diagram of a digital thermometer on a microcontroller was developed for reliable and long-term use. All the parts used in the circuit are not in short supply. The pattern is easy to follow and perfect for beginners.
The schematic diagram of the thermometer is shown in Figure 1
Figure 1 - Schematic diagram of a thermometer on PIC16F628A + ds18b20/ds18s20
Describe all schematic diagram I won’t use a thermometer, since it’s quite simple, I’ll just focus on the features.
Used as a microcontroller PIC16F628A from Microchip. This is an inexpensive controller and also not in short supply.
Digital sensors are used to measure temperature DS18B20 or DS18S20 from Maxim. These sensors are inexpensive, small in size, and information about the measured temperature is transmitted digitally. This solution allows you not to worry about the cross-section of the wires, their length, etc. Sensors DS18B20,DS18S20 capable of operating in the temperature range from -55… +125 °C.
The temperature is displayed on a 7-segment 3-digit LED indicator with a common cathode (OK) or with (OA).
To display the maximum and minimum measured temperatures on the indicator, you need the SB1 button. To reset the memory you also need the SB1 button
Using the SA1 button you can quickly switch sensors (street, house).
A jumper is needed to switch the common wire for the LED indicator. IMPORTANT! If the indicator is OK, then we put the jamper in the lower position according to the diagram, and solder the transistors VT1-VT3 with p-n-p conductivity. If the LED indicator is OA, then we move the jamper to the upper position according to the diagram, and solder the transistors VT1-VT3 with n-p-n conductivity.
In Table 1 you can see the entire list of parts and their possible replacement with an analogue.
Position designation | Name | Analog/replacement |
C1, C2 | Ceramic capacitor - 0.1 μFx50V | - |
C3 | Electrolytic capacitor - 220μFx10V | |
DD1 | Microcontroller PIC16F628A | PIC16F648A |
DD2,DD3 | Temperature sensor DS18B20 or DS18S20 | |
GB1 | Three 1.5V AA batteries | |
HG1 | 7-segment LED indicator KEM-5631-ASR (OK) | Any other low-power for dynamic indication and suitable for connection. |
R1,R3,R14,R15 | Resistor 0.125W 5.1 Ohm | SMD size 0805 |
R2,R16 | Resistor 0.125W 5.1 kOhm | SMD size 0805 |
R4,R13 | Resistor 0.125W 4.7 kOhm | SMD size 0805 |
R17-R19 | Resistor 0.125W 4.3 kOhm | SMD size 0805 |
R5-R12 | Resistor 0.125W 330 Ohm | SMD size 0805 |
SA1 | Any suitable switch | |
SB1 | Tact button | |
VT1-VT3 | Transistor BC556B for indicator with OK/transistor BC546B for indicator with OA | KT3107/KT3102 |
XT1 | Terminal block for 3 contacts. |
For initial debugging of the digital thermometer, a virtual model built in Proteus was used. In Figure 2 you can see a simplified model in Proteus
Figure 2 – Model of a thermometer on the PIC16F628A microcontroller in Proteus
Figure 3-4 shows the circuit board of the digital thermometer
Figure 3 – Printed circuit board The thermometer on the PIC16F628A microcontroller (bottom) is not to scale.
Figure 4 – Printed circuit board of a thermometer on a PIC16F628A microcontroller (top) not to scale.
The thermometer, assembled working parts, starts working immediately and does not need debugging.
The result of the work is Figures 5-7.
Figure 5 - Appearance thermometer
Figure 6 - Appearance of the thermometer
Figure 7 - Appearance of the thermometer
IMPORTANT! In the thermometer firmware not sewn in advertising can be used for your pleasure.
Amendments made to the work program:
1 automatic detection of DS18B20 or DS18S20 sensor;
2. The rewriting time in EEPROM has been reduced (if the condition for rewriting is met) from 5 minutes to 1 minute.
3. The blinking frequency of the dot has been increased;
More detailed description The operation of the thermometer can be viewed in the document, which can be downloaded at the end of this article. If you don’t want to download, then on the website www.pichobbi.narod.ru The operation of the device is also perfectly described.
The finished board fit perfectly into a Chinese alarm clock (Figures 8, 9).
Figure 8 – All the stuffing in a Chinese alarm clock
Figure 9 - All the filling in the Chinese alarm clock
Video - Thermometer operation on PIC16F628A
This version of the watch is made in such a way as to simplify the circuit as much as possible, reduce power consumption, and ultimately obtain a device that easily fits in your pocket. Having selected miniature batteries to power the circuit, SMD mounting and a miniature speaker (for example, from a non-working mobile phone), you can get a design slightly larger than a matchbox.
The use of a super-bright indicator allows you to reduce the current consumed by the circuit. A reduction in current consumption is also achieved in the "LoFF" mode - the indicator is off, and only the blinking dot of the low-order digit of the clock is turned on.
Indication
Adjustable brightness of the indicators allows you to choose the most comfortable display of readings (and again reduce energy consumption).
The watch has 9 display modes. Switching between modes is carried out using the “plus” and “minus” buttons. Before the readings themselves are displayed, a short hint about the name of the mode is displayed on the indicators. The duration of the hint display is one second. The use of short-term prompts made it possible to achieve good ergonomics of the watch. When switching between display modes (of which there are quite a lot for such a simple device as an ordinary watch), there is no confusion, and it is always clear which readings are displayed on the indicator.
Model name: PIC16F628A-I/P
Manufacturer: Microchip
Description: 8-bit microcontrollers (MCU) 3.5 KB 224 RAM 16 I/O
Brief contents of the document:
PIC16F627A/628A/648A Data Sheet
Flash-Based, 8-Bit CMOS Microcontrollers with nanoWatt Technology
© 2009 Microchip Technology Inc.
DS40044G
Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip's Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. Microchip is willing to work with the customer who is concerned about the integrity of their code. Neither Microchip nor any other semiconductor manufacturer can g
Specifications:
PIC16F628AI/P, PIC16F628A I/P
Microprocessor PIC, Core 8bit, 3.5K-Flash 224B-SRAM 128B-EPROM, 20MHz, 3.0V…5.5V, -40°C…85°C PIC (Peripheral Interface Controller) microcontrollers are programmable PROMs, have low power consumption,... .
nanbaby.ru - Health and beauty. Fashion. Children and parents. Leisure. Life House