Description ds1621. Temperature sensor DS1621 Detailed description of the sensor. Improvement in accuracy

A microcircuit with a thermometer and a thermostat "in one bottle" with a digital input and a switch, which guarantees the accuracy of the control of the abduction plus - minus 0.5 gr. Celsius. In order to change the DS1621 sensor as a thermometer, data must be processed through the I2C/SMBus serial bus in the additional nine - bit code with the accuracy of the youngest level plus - minus 0.5 gr. Celsius.

For additions, which require the expansion of the controllable value of the temperature, it is necessary to enter additional registers and viconate inconsistent arithmetic operations, in order to take a larger lower 12-bit resolution (with the target value, 05 becoming the smallest number). The DS1621 microcircuit can have three address inputs, so it is possible to connect up to one bus up to eight DS1621 sensors.

Zastosovuyuchi sensor DS1621 as a thermostat, DS1621 є register TH (temperature increased) and TL (temperature reduced). When the flow temperature level TH is exceeded, the sensor's output switches to the active state and continues to stay in the new state, until the flow temperature drops below the TL sign. In this way, the control is realized from the given hysteresis.

Description of features of the DS1621 sensor

  • SDA- view data from the I2C bus.
  • SCL- view the clock signal of the I2C bus
  • tout- exit the thermostat.
  • vdd- videdennya kharchuvannya plus.
  • GND- vision of life, minus.
  • A0..A2 - line of young beats.

Working Principle of DS1621 Sensor

The principle of vimir is based on the instability of the frequency of colivans with a change in temperature. To implement the principle of vimir, two generators are included in the microcircuit structure.

The first of them has a high temperature stability. Yogo working frequency at the temperature - 55 gr. Celsius and practically does not change. The operating frequency of another generator, on the other hand, changes proportionally to temperature changes. Spetsіalnі lіchlіnki zdіysnyuyut pіdraknіkі іmpulsіv іn іvny іnіm_zhok і hour і on osnovі raznitsі, rozіlnі іn flow temperature, which looks like a 9-bit double code.

Dani podіlyayutsya on senior and young baiti. For any purpose, the temperature value is necessary, it is necessary to vikoristovuvat, only the high byte. The youngest byte can only have one information bit - LSB, which implements a discreteness of 0.5 gr. Celsius. Lost the bits of the young byte to zero.

Register will become

The DS1621 microcircuit can have its own set of operating modes. The establishment of such control of these regimes is carried out for the additional register of stations. Establish the following beats:

  • DONE- the ensign of the completion of the transformation. Restored after the completion of the transformation.
  • THF- flag "high temperature". It is restored when the temperature rises above the TH threshold. The ensign is thrown off programmatically or for the sake of living.
  • TLF- flag "low temperature". Restores when the temperature changes below the threshold TL. The ensign is thrown off programmatically or for the sake of living.
  • NVB- ensign to record data in the independent memory of the sensor. The establishment of ensigns indicates those that the record has not been completed. Approximate hour for data recording at the office is set to 10 ms.
  • POL- Select the polarity of the Tout output. High value indicates direct polarity, low means reverse polarity. Tsey bit is energy-independent.
  • ISHOT- bit control cycle vimiriv. One-time vimir is considered for the high logical equal of this bit. Yogo zvuchay zastosovuyat pіd hour of the creation of energy-saving systems. The low logical rіven of this bit, allows the victorious transformation in the fast mode. The bit is energy independent.

Exchange command

Data exchange with the DS1621 sensor is based on the typical I2C protocol. The sensor takes the fate of the new SLAVE - attachment. Yogo SLAVE - addresses may look at the offensive look:

de XXX - line A0-A2 microcircuit. For interfacing with DS1621, the following commands are used:

  • 22h-"Zupinennya reworking" - a command to complete the work and scheme of temperature conversion. Zayvih data for work is not necessary.
  • Ah-"Reading the temperature" - Podskom robotic command - two bytes of data, yakі mіstat the value of the measured temperature.
  • A1h-"Setting TH" - a command to select the upper threshold for the operation of the thermostat. After this command, the transfer of two bytes of the threshold value is required.
  • A2h-"Setting TL" - a command to select the lower threshold for thermostat operation. After this command, the transfer of two bytes of the threshold value is required.
  • A8h-"Reading a temperature reader". The command is more readable and allows you to enter the data of the lichnik, the frequency of the work and the temperature.
  • A9h-"Reading a stable reader". The command is more readable and allows you to enter the data of the lichnik, the frequency of the work and the temperature.
  • ACh -"Register of configuration". As soon as it is logged R - recording of the configuration register is carried out, with W - reading.
  • eeh-"Start lichilnik" - a command to start the temperature control. Zaiwih data is not necessary.

Improvement in accuracy

The DS1621 sensor can improve the temperature accuracy, which can be improved. For the available value of the stable N value and the fallow temperature N of the generator. Knowing the temporal values ​​of the temperature T, the values ​​of the qualifiers can be taken more accurately by using the formula:

T = T - 0.25 + (N-N) / N

Thermostat mode DS1621

The DS1621 sensor also has an operating mode as a thermostat. For the control of vykonavchimi outbuildings є digital output Tout, which is set in the fallow temperature. Equalities of inclusion and deactivation of the output are set in the TH and TL registers, and the polarity of the output is selected by the POL bit of the configuration register.

Chip DS1621 thermometer and thermostat with digital input / output, which ensures accuracy of ± 0.5 ° C. With a different thermometer, data is read out via the I2C/SMBus serial bus in an additional 9-bit code with a low order value of ±0.5°C. For add-ons that require a larger high bit rate, you can read the add-on registers and perform simple arithmetic steps in order to reach a larger lower 12-bit resolution (with the price of the lowest order of 0.0625 ° C). The DS1621 chip secures 3 address inputs to allow shortlisters to connect up to 8 DS1621s to one bus.
When the thermostat fails, the DS1621 chip can be programmed in the internal non-volatile memory (EEPROM) with a variable temperature overshoot (TH) and undertemperature (TL) setpoint. One special logical exit is required, if TH is reached, and the exit is overridden by an active dot, as long as the temperature is not lower than TL (programming hysteresis).
The DS1621 chip is valid for 300mil, 8-pin PDIP and 150mil, 8-pin SOIC. For applications that do not require ±0.5°C accuracy, the DS1721 chip is available with a reduced ±1°C accuracy, a cheaper total chip (only in SOIC package).
The DS1621 chip is supported by the DS1702k demo kit.
Noteworthy features:
±0.5°C accuracy from 0°C to 70°C
9-bit allowed to expand to 12-bit
special logical exit for thermostatic bath
Adjustment of the thermostatic bath, energy-independent and programmed with a short
Data is transmitted via I2C/SMBus serial interface
3 address inputs (8 DS1621 can be used on one bus)
Operating voltage range 2.7V to 5.5V
8-pin PDIP or 150mil, 8-pin SOIC packages
DS1621 8-PIN DIP (300-MIL)
DS1621S 8-PIN SOIC (150-MIL)
DS1621V 8-PIN SOIC (208-MIL)

Schematic diagram of a self-contained thermostat, which is used for robotics with a scorching system based on an electric boiler. The circuit is based on the DS1621 chip. Microchip DS1621 thermometer and thermostat with digital input / output, which ensures accuracy of ± 0.5 ° С.

With a different thermometer, the data is read out via the l2C/SMBus serial bus in an additional 9-bit code with a low order value of ±0.5°С.

For supplements, which require a larger, higher capacity, you can read the supplementary registers and perform simple arithmetic steps in order to reach a larger lower 12-bit resolution (with the price of the smallest order of 0.0625 ° С). The DS1621 chip secures 3 address inputs to allow shortlisters to connect up to 8 DS1621s to one bus.

When varying the data of the microcircuit in the capacity of the thermostat, data about that temperature, which is required to be taken from the internal non-volatile memory (EEPROM) at the control points, which are set by the temperature shift (TH) and by the temperature decrease (TL). The difference between TN and TL establishes hysteresis.

If the temperature is insufficient (TL and lower) on the displayed microcircuit 3, a low logical level is restored. If the temperature is sufficient (ТН і higher) for this visnovka, a logical one.

The DS1621 chip is available in 8-pin PDIP and 8-pin SOIC packages.

Schematic diagram

Small 1 shows the connection diagram of this microcircuit to a personal computer.

Rice. 1. Schematic diagram of a thermostat for an electric boiler.

Software security, with some practicality, the thermostat according to Fig. 1 can be known at once from a personal computer, start the program - Startage (1.5 MB).

After setting the temperature for the help of a personal computer, you can turn it on in the diagram in Fig.1. The given data are saved in the memory of the microcircuit, and the scheme is self-supporting, maintaining the set temperature for the help of the VS1 triac, which saves the temperature of the heating boiler.

Rice. 2. Diagram of the thermostat of the ATTINY2313 microcontroller.

The computer, with success, can replace the control circuit and control based on the microcontroller, for example, the circuit on ATTINY2313 is shown in figure 2. and serve as a thermometer for one hour, showing the specific temperature of the host.

The temperature is displayed on a yard light digital indicator. Three buttons control. S1 serve to turn on the thermometer.

And with the buttons S2 and S3 you can set the temperature, which is necessary to adjust. Svіtlodiod HL1 serve to indicate the included electric boiler. If the TEN of the boiler is working, the wine is blowing.

Firmware MK

The HEX file for programming the microcontroller can be found in the following code: Request (1.9 KB).

The microcontroller is powered by a generator with a frequency of 4 MHz. When programming with Features, you need to select:

int. R.C.OSC. 4MHz; Start-up time: 14 CK + 0 ms;

Brown-out detection disabled; check the box for Serial program downloading (SPI) enabled;

Fuzy: (check) SUT1, SPIEN, SUTO, CKSEL3, CKSEL2, CKSELO

Details

Mounting on breadboard other boards. Transformer T1 is a ready-made transformer TAIWAN 110-230V 6-0-6V 150tA, power, low-voltage, with a secondary winding of 6V. Vernishe, at the new two secondary windings 6-0-6V and strum up to 150tA, connected in series. There is less than one winding here. Primary winding for 230V, but also for 110V.

It is necessary to select with an ohmmeter the windings of the primary winding with the largest support between them, and connect them to the electrical circuit. Light indicators of ALSZZZA to finish old. You can replace them with seven-segment digital light-emitting diodes from a glowing cathode.

Kozhukhin V. A. RK-08-16.

Literature: 1. Thermometer for PC on DS1621 - cxem.net/mc/mc136.php.



The attachment is simple, without calibrating that microcontroller.

The price of a fairly simple thermometer is connected to any free port of the next. Whether programming components and microcontrollers are not victorious. The accuracy of the measurements can be set to 0.5°C without calibration. It's so cheap that I made yoga for the leather computer I made. Tse so accepting the temperature on the panel Windows manager What a lot of friends asked me to grow such an attachment!

Get your own accurate thermometer

D This project is easy to complete for beginners, however, it can be difficult, due to the hardware inconsistency of the serial port on different computers. The version with one sensor needs only a sensor microcircuit, a voltage regulator and a diode and resistor. Explore and recognize the secrets of the IIC bus, how to implement the IIC vicorist bus with less than two resistors and a pair of stabilitrons, how to wire them on the serial port of vicorist in Visual Basic. Components that are matched are easily available in radio online stores.

Characteristics:

The temperature is displayed both on the Windows taskbar and outside the boundaries (div. figure).

Installed at any other COM port of the PC.

Temperature range -20...+125°C (-4...257°F).

The base accuracy and variability is 0.5°C.

Celsius (°C) and Farenheit (°F) scale.

The data is written to a text file that is easy to read (good for Excel).

Sampling frequency 1, 5, 30 hours 60 seconds.

One or two temperature sensors (expandable up to 8)

Zhivlennya s COM-port, zvnіshne dzherelo is not needed.

Easy to install, not exotic software and hardware parts.

Does not require calibration.

Zrobiti PC thermometer is easy. I will report on the version with surface-mounted elements. Those who do not know about soldering small SMT elements will be happy to know that a board for similar elements is also available.

For the cob, it is necessary to select all the elements, crim boards. Axis item list:

Number Type of Description
U1, U2 DS1621 or DS1631 Digital temperature sensor

Plastic case SO8 (SMD) or DIP (Vividny)

U3 LM2936Z-5.0 Voltage regulator with ultra low inputs, TO92 housing (in both versions)
D1, D2 LL4148 Small pulse diode (on board 1N4148)
DZ1, DZ2 MMSZ5V1 Stabilitron 5.1V 0.5W.
C1, C2 47uF/16V electrolytic capacitor
C3, C4 100nF Low voltage ceramic capacitor (SMD 1206)
R1, R2 4700 ohm 5% Resistor 0.25W (SMD 1206)
COM DB9F 9-pin female connector, straight (SMD) or female (Vivid)

The cost of the chosen SMT fee (Small fee - a cost-effective temperature sensor).

As soon as I have selected all the elements, I have paid a fee to the real expansion, so that I can review the analysis of all the elements at will. Whether the element is too great or small, I can correct the fee or search for the most important element before the ear of the robot.

After that, as the elements are pervered, I will pay the fee. Since it is one-sided, you can easily see it on your own. It takes less than a year and does not require special materials for the method, we will describe it here.

The board can be insanely clean (without traces of oxidation and finger marks) for pickling and soldering. Wipe with a soft abrasive to a shine (kitchen washcloth, steel wool and wind office gum). Don't forget to mirror the drawing before printing! I love SMT pay, for that it is necessary to drill not so richly weary openings before soldering.

For soldering, a soldering iron with a thin sting is needed, the gostry tweezers are that firm hand. I fix the payment to the table for an hour of soldering. In fact, I will attach it to the other, in order to make it easier to recheck for an hour of soldering.

In order not to mix up the elements, trim them in the original packaging until needed. I will tell you about soldering from other elements (resistors, diodes ...) and finish with great ones (electrical capacitor), high elements can make access to other elements easier.

Do not overheat too much solder, and be careful not to overheat the elements (especially diodes and microcircuits). As it is necessary, let the okholone element. More polar elements, be careful not to confuse them. The cathode of the diode (K) is marked with a black ring, the negative effect of electrical capacitors is with a black female. As you see the importance of the tantalum capacitors, remember that their marking is turned upside down, and in a black smog they signify a positive visnovok!

Keep an eye on the photograph and constantly check the girls until you get confused with the one who has no suitable price.

Those who do not have access to SMT elements, can be soldered by soldering the sensor microcircuit.

I clean the tip of the soldering iron in front of the skin soldering point, and the vicorous arc with thin solder, so that I apply the smallest amount of solder. I put a small amount of solder on the maidanchik of appointments for seeing 1.

I put the microcircuit on the board, and if її vysnovki zbіgayutsya with maidanchiks, I clean the sting and warm contact 1, the docks are not soldered. I am verifying that the microcircuit, as before, stands correctly (all contacts are in the center of the same maidanchiks). As soon as it moved, I heat contact 1 and move it, otherwise I, like before, solder other contacts, cleaning the tip and soldering a little. Remaining crock є soldering to contact 1, soldered on the back with a small amount of solder.

The LM2936Z5 voltage regulator will require special preparation before soldering. I have open the door open, but I want to solder it on the SMT side of the payment. The little one shows how to bend and shorten the contacts.

The card is secured on the installation between the pins of the pink serial port. This is the rest of the soldering. Do not forget to solder the visnovki 7 and 8 on the prolezhny botsі of the other plate.

I clean the board with excess flux for an additional retailer, for example, with acetone, and I allow the board to dry before turning it on. As soon as the board is revered and processed, I apply a transparent ball of varnish-spray for the oxidation of midi in the oxidation.

The rest of the crop is in the zavantazhennі that vstanovlennі software security. How to help you with tips from Microsoft Installer (... italian mine) and screenshots (first and second) will help you get everything right.

At the first start, you need to select the number of the serial port, to which the circuit is connected, and you will be ready until the temperature is reached. Success!

How do you work?

Scheme of a similar view of the Claudio Lanconelli PonyProg programmer. The key component is the Dallas Semiconductor DS1621 temperature sensor. This is a digital temperature sensor, and this means that it controls the temperature and converts it to digital values ​​(double numbers, so the sequence is zero and one, like bytes on a computer).

Just supply stabilized power 5V, and DS1621 building temperature transmitter dovkilla via the IIC serial bus (Inter-Integrated Circuit bus, also spelled I2C). The same standard transmission scheme was developed by Philips Semiconductors for impersonal microcircuits at once, with only two lines: clock (SCL) and data (SDA).

Div. documentation, to get more detailed information about the bus robot, and at the same time it’s enough to know if any I2C chip can have its own address (a number in the range of 0 to 127) and a set of commands. In this way, you can connect a lot of microcircuits in parallel and still be in contact with your skin care, starting your skin care with a specific address.

Directly from the factory, all DS1621s are supplied with a base address ($40), or you can change it, one by one, by address numbers (A0, A1, A2), from 5V or GND by default (div. table). In this way, you can connect up to 8 sensor microcircuits in parallel to the bus, if you want the software security that is supplied, add only two to the table (you can add more sensors by changing the software security).

So how can we live the DS1621 into a 5V DC stream and connect the SCK and SDA wires to the I2C PC interface, why not? It's a pity, computers can't get the 5V power supply and I2C ports, it's my fault to hack them!

Hack #1: Phantom live COM port

The temperature sensor does not provide much energy for the robot, so why not waste energy, "stealing" energy from the signals already available on the RS232 port?

12V RS232 lines are transmitted to the regulator via diodes D1, D2, filtered by C1 and regulated up to +5V on LM2936-Z5. This is a special regulator, building pratsyuvati with a minimum input voltage and saving the skin mA. LM2936 building regulator with such a low input voltage as 5.2 (most recent ports live less than 6V). For surge, the 78L05 primary regulators will accept 6.7V at the input and provide 100 times the surge required by the LM2936-Z5.

Hack #2: Let's put the COM port in, it's the I2C bus.

The thermometer's PC software supports the I2C bus through the two-pin COM port available on all motherboards.

RTS (Request To Send, pin 7) is reversed in the SCL line, and the SDA line is reversed, which is split for the DTR serial port (Data Terminal Ready, pin 4). These signals are available with Visual Basic by setting the DTR and RTS powers of the MSComm object.

You cannot send a signal from the COM port on the DS1621 without a middle, since the equal voltages are due to the adaptation. It is up to the EIA-RS232 standard, most computers have a voltage that can reach +15V DC current and drops to -15V DC power on the pink COM port, which is due to the presence of power voltages from 0 to +5V power supply before connecting the power supply. DS1621 SDA and SCL wired. A 5.1V zener diode and an intermediate resistor 4700 are sufficient for the need.

As you marvel at the diagram respectfully, you should note that the SDA connections also use the CTS pin (Clear To Send, pin 8). In this way, the thermometer's PC software can control the SDA logical line to read the microchip's input so that the line is bidirectional. Wanting theoretically the last port to be able to see a large signal from the input, signals in the range of 0 ... 5V of a constant stream are well practiced practically on any computer on earth.

Software security

Software security is delivered after compilation and with the installer (setup.exe), but for the quiet, who can click on the programming, the exit code is marked.

I wrote a program in Visual Basic. I've built it in a straight forward way, navmisne unique optimizations, like making the code less readable.

Functions of the I2C bus grouping a file, which can be re-copied by other programs. We give functions for all the main operations of the I2C bus: such as the launch of that bus spike, or the management of that one byte.

The main program takes care of the temperature functions (chipaddress), which gives the I2C bus command to take the temperature from the chip.

To read the temperature of a microcircuit in Visual Basic, all you need is to supply the temperature ($&48), where $ and 48 is the address for the first microcircuit, $H49 is the address of the other microcircuit, and so on, as far as the table above. My program uses two sensors, but it's not so important to change them for trimming up to 8 microcircuits.

The first time you run the program, you will be warned about those that do not have a configuration file (there will be automatic creations in the last session) and the settings will be locked. Select the last (COM) port, whichever you choose, so that your device includes U2 to read the temperature of the outside temperature, the interval between the alarms, the units of the alarm and if you want to log the temperature to the file "pc_thermometer.txt" (ASCII in a text file, you can in Excel for processing and prompt graphics).

If the "start minimized" field is turned over, as it is highlighted, then during future launches the program will not display on the desktop, but will be minimized on the task panel, leaving the "temperature icon" safe. This is my shortest way to use the program.

When pressed on the icon, the window pops up.

Upload files to the project

Original article on English language(translation: Oleksandr Kasyanov for cxem.net site)

microcircuit DS 1621, a manufacturer of Dallas Semiconductors, is recognized for its advanced thermometer and thermostat functions. Possibility of the microcircuit allows to carry out the experiment in the temperature range from -55 to +125 degrees Celsius. Krok vіdlіku temperature become 0.5 degrees. DS 1621 is equipped with an interface I 2C. In thermostat mode, autonomous operation is possible.

Visnovkiv appointment

  • SDA- I2C bus data line
  • SCL- I2C bus clock signal line
  • Tout- Exit thermostat
  • vdd- positive view of eating
  • Vss- minus life
  • A0..A2- Lines of molding of young battles addresses

Robotic principle

temperature sensor D.S. 1621 to overcome the vicorist principle of instability of the frequency of the change in temperature. For this to її the warehouse includes two generators. The first may be high temperature stability. Yogo frequency in temperature is -55 degrees and practically not easy to change. The frequency of the operation of another generator, on the other hand, changes proportionally to the temperature. Spetsіalnі lichnіlіnі іmpulsіv robіt pidrakhunok і іn the same hour intervalі і on the basis of rііznіci calculate temperature values. The value in the 9-digit double code is available to the koristuvachev. Dani are broken down into senior and junior byte. If you want to add a temperature value, you can use only the high byte. The low byte can only have one LSB information bit, which ensures 0.5 degree resolution. The rest of the bits of the young byte must be updated to 0.

Microchip DS 1621 Nalashtuvannya that vіdstezhennya tsikh modesіv zdіysnyuєtsya for the help register of stations. These are the available beaches:

  • DONE- Ensign of the completion of the transformation. It is restored after the completion of the transformation.
  • THF- Flag "high temperature". It is restored when the TH threshold is exceeded. Skidaetsya programmatically or viknennyam zhivlennya.
  • TLF- Flag "low temperature". Restores at a lower temperature, lower value of the threshold TL. Skidaetsya programmatically or viknennyam zhivlennya.
  • NVB- ensign to record data on energy-independent memory. The ensigns were established due to the incompleteness of the record. The hour for recording a commercial should be approximately 10 ms.
  • POL- Polarity output Tout. A high value indicates a direct polarity, a low value indicates a reverse polarity. The bit is energy independent.
  • ISHOT- Management of the cycle of death. For a high logical equal, the vimir is won once. Tsey mode vikoristovuetsya in energy-saving systems. The low logical rіven of the battle, allows the victorious transformation on a non-stop mode. The bit is energy independent.

Robot with DS1621

Exchange command

Data exchange with DS 1621 is carried out according to the standard protocol I 2C. The microcircuit takes the fate of a new one as a slave-attachment. Slave addresses DS 1621 may be 1001xxx, de xxx - line A0-A2 of the microcircuit. For robots with DS 1621, the following commands are used:

  • 22h– “Zupinennya reconverting” - the command completes the work of the temperature reshaping scheme. Additional data for work is not required.
  • AAh– “Reading the temperature” - The result of the robotic command is two bytes of data to retrieve the measured temperature value.
  • A 1h– “Setting TH” - a command to set the upper threshold for the thermostat. After the command, it is necessary to transfer two bytes of the threshold value.
  • A 2h- "Setting TL" - a command to set the lower threshold for thermostat activation. After the command, it is necessary to transfer two bytes of the threshold value.
  • A8h- "Reading a temperature reader". The team works only on reading and allows you to enter the data of the lichnik, the frequency of the work and the temperature.
  • A9h- "Reading a stable reader". The team works only on reading and allows you to enter the data of the lichnik, the frequency of the work, and not to lie in the temperature.
  • A CH- "Register of configuration". The R/W bit will be recorded and read from the configuration register. The data format is bytes.
  • EEh- "Start of the lichilnik" - a command to control the temperature on the cob. Additional data is not required.

Improving the accuracy of vimiriv

The temperature sensor DS1621 allows you to increase the accuracy of the temperature. For the most stable N and temperature-depleted N generator available values. Knowing the temporal values ​​of temperature T and the values ​​of the lichniks can be calculated by the formula:

T = T - 0.25 + (N-N) / N

It is also necessary to calibrate the sensor with the necessary corrections. The appearance of these amendments is to be carried out at the controller.

Thermostat mode

The DS 1621 microcircuit can be used as a thermostat. For which is the output of Tout, which is set to the fallow temperature value. The thresholds for switching on and switching off the output are set by the values ​​in the TH and TL registers. Output polarity is set by the POL bit in the configuration register.



Share with friends or save for yourself:

Enthusiasm...