Manufacturing of high-precision usb 1 wire thermometer. News and analytical portal "electronics time". Preparation for use

Answer

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry"s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five http://jquery2dotnet.com/ centuries , but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

ATmega8 was chosen as the microcontroller. Digital temperature sensor: DS18B20, which has temperature measurement limits from -55 to +125 degrees Celsius. In general, here is a list of everything you need for a thermometer:

ATmega8 microcontroller (very preferably without the “L” at the end).
Temperature sensors DS18B20, needed without the PAR index at the end, otherwise max. the temperature will be +85 degrees.
Quartz 12 MHz.
2 22 Pf capacitors and one power supply capacitor (10V and at least 100 Mf, because USB has terrible voltage drops on the power line).
2 resistors 68 Ohm, 1 resistor 200 Ohm, 1 resistor about 2.2 - 4.7 kOhm, 1 resistor 10 kOhm and 1 resistor 1.5 kOhm.
2 zener diodes 3.6V.
USB plug or connector.
Light-emitting diode.
Well, and the signet or breadboard on which all this will be assembled.

Device diagram:

The scheme is very simple. On the left are all 4 USB pins. Capacitor C3 is the same power supply capacitor. Zener diodes VD1 and VD2 reduce the voltage on the data line to 3.3V. The DS18B20 sensor can not be placed on the board, but brought to the desired location; in general, the wire length can be up to 100 meters, but I do not recommend more than 50 m. The LED changes its state (lights up/goes out) each time temperature measurement is started. If it blinks at a chaotic speed, then the temperature sensor is working normally, if it constantly lights up or does not light up, there is a problem with the sensor (wrongly connected, non-working, or a very long wire near which there is strong electromagnetic interference). On the right is a connector for in-circuit programming of the microcontroller. Firmware for it - USBThermometer\MCU\USB_thermometer\default\main.hex. After uploading the firmware, you need to set the fuses correctly, otherwise the device will not work; in STK500 from AVR Studio it looks like this:

If you assembled the device correctly and flashed the MK correctly, then when you connect to a computer via USB, Windows will find a new device and ask where the driver is. It is located in the folder USBThermometer\windows-driver\, where you need to indicate the path. When the driver is installed, restart your PC. Then run the program USBThermometer.exe. If the device is not connected, then instead of the temperature it will be written “Not connected.” and when dragging, the window will freeze a little every second because the program will update data about connected devices every second until it finds this thermometer. If you connect the device, the message “Thermometer connected” will pop up in the tray, the window will no longer freeze, and you will see this:

Also, which is very convenient, there is a “Mini-window” and “On top of all windows” function. I usually check all 2 boxes and this is what I get:

The entire gray area is the program window in a “mini-view” (the white and blue background with bulbs is the desktop). Like:) ?. This is convenient because the window is small (96x198), constantly on top of all windows and does not interfere when using other applications. In addition, the program is not displayed on the taskbar, but only in the tray, and by hovering the cursor over the program icon, you can see the temperature in Celsius:

I tested this thermometer on several desktop PCs, laptops and netbooks running Windows Home Edition, Windows Professional and Windows Vista operating systems. Everything worked great! Only on Vista, when the temperature on the temperature sensor is below -9 and above 99 degrees. The letter “C” (where the temperature is in Celsius) was not visible because I chose the font to display the temperature “Comic Sans MS”, but I don’t think that this is a problem for anyone.

Program, firmware, sources, driver, printed circuit board: Download (500 kB)

P.S. If you do not have a programmer and you need a microcontroller already flashed or you want to buy a ready-made thermometer, then contact me by e-mail: devices2000 (stsoback) ya.ru

I also accept orders for the development and manufacture of devices on microcontrollers, for this please contact the same email.

DIY USB thermometer

A long time ago I had the idea of ​​​​making a USB thermometer, but there was no need, and the idea lay dormant. Once, while visiting a friend, I noticed a couple of USB flash drives. One was dead and I got it for free. Recently I have been constantly hunting for them, because... in most cases the controller burns out, and the NAND flash is live + SMD quartz. And such things don’t lie on the road.
So, from this flash drive I got: SMD quartz at 12 MHz, a USB plug for the board and a small case, as well as the development of the idea of ​​a USB thermometer.

Within a week the following were developed:
1. Device diagram;
2. Layout of the printed circuit board for the existing case;
3. Program for MK ATtiny45;
4. Host program (hereinafter simply host) for receiving data from the MK.

The program for MK was developed in the AVR Studio environment using GCC based on the avrusb library and the source code of a certain Martin Thomas for DS18B20 (there was no time to write it myself). The way the host interacts with the device is implemented in the form of sending a conditional code to the device (according to which the device will perform the required operations), as well as requesting a data packet with the current temperature value. Since the size of the sent and received data is small, a future report (type of data packet) was chosen due to the ease of working with it.
If you want to fix the program for MK, please first carefully read the USBID-License.txt document located in the usbdrv folder.
It contains a number of rules and restrictions on using the avrusb library.
The host program is written in Borland Delphi 7 using the JEDI-VCL component library, which includes the TJvHidDeviceController component, which provides simple access to HID-compatible USB devices. To make using the device as convenient as possible, it was decided to implement the host as an icon with the temperature value in the system tray (near the clock) without any graphical interface, with the exception of a context menu by right-clicking on the tray icon.
I have WinXP SP3, I have not tried the program on other OSes.

In general, the host works according to the following algorithm:
1. Using a timer (every 2 seconds), we start searching for our device. Search criteria - text names of the manufacturer (vendor) and device (product);
2. We receive information from the device with numerous error checks. If any arise, set the “NA” icon - no access;
3. Give the command to read the temperature from the sensor. We wait;
4. Give the command to start measuring the temperature;
5. Return to point 1 after 2 seconds.

The article presents a diagram of a USB thermometer with temperature readings displayed on a computer monitor. An NPN transistor was used as a sensor; the voltage change across it is approximately 2.3 mV for every 10°C.

The PIC18F2550 microcontroller has a 10-bit analog-to-digital converter. The circuit is powered by . Interface for a personal computer - HID class.

USB thermometer calibration

Calibration of the circuit sensors is carried out in the VB application. When you run the VB application for the first time, it creates a "cal.txt" text file in the same folder. The file has 2 numbers that save sensor readings from 0 to 100 Celsius. This is necessary due to the fact that each sensor has its own output voltage value. Recording calibration data is done as follows:

  1. Place the temperature sensor in ice water and press the 0°C button.
  2. After which the application will update the cal.txt file with the new value of the sensor signal.
  3. Then place the sensor in boiling water (100°C), press the 100°C button to update the data in the cal.txt file.

Also, any NPN transistor in a plastic case with a gain of at least 100 is suitable as a temperature sensor.

Once again, summer unexpectedly arrived and the heat came, and since I am in charge of a small server room, I wanted to be able to remotely monitor the temperature in the room.

This room cannot be called a full-fledged server room, but it has all the signs of this room, including an air conditioner that operates from approximately the beginning of March to the end of November, maintaining a comfortable temperature of 18-20 degrees, for servers, active network equipment, UPS, etc. .P.
A year ago there was already a situation when the air conditioner failed, yes, my mistake, I should have set up notifications about the increase in the temperature of processors and hard drives, but I didn’t, fortunately it became clear almost immediately and emergency measures were taken to replace the air conditioner.

When I was browsing online stores, I came across a USB thermometer, and I wanted to try to adapt it to control the temperature in the room (at home I have a temperature sensor via the COM port with a Dallas sensor).
Well, in general, I ordered, received, printed.
Photo of what arrived.

A small blister, a device similar to a flash drive, in general, nothing special in appearance.

The kit included a CD, presumably with software. Why, presumably, because I don’t have a single connected DVD or CD at home, I was too lazy to connect.
I typed in the inscription on the packaging into a Google search and ended up on the manufacturer’s website, where I easily found my thermometer and downloaded the software.
Downloads page -
Link to latest version. -

The device itself is very similar to a flash drive, only there is an additional hole, I’m thinking of hanging something on some kind of nail :), while it is used with a direct connection to the front USB port of the computer.

The first thing that seemed unusual was the weight. The device has a metal case and is quite weighty, after using the flash drive the difference is noticeable, I became curious and decided to weigh it.


The photo quality is not very good, the weight of the device is 13 grams.

Naturally, no one is going to include an untested device in the server, so first I decided to test it at home.
I installed the software and inserted the thermometer into the USB port.
Everything started with half a kick, no drivers had to be installed (the only thing is that the net framework must be installed on the system, the program asks for 3.5, but actually works with 3.0), no settings were needed either, I just turned it on, launched the software and got temperature readings. The packaging of the thermometer stated support for the main common operating systems; it was tested on Windows XP. When you first start the software without a sensor, it shows 2 temperatures, inside and outside. Most likely, you can install a pair of such sensors and control the temperature in two places.

Working window of the program.

In reality the temperature was about 26-27 degrees. By the way, if you select the graph area from left to right with the mouse, you can see the range that was selected; selecting from right to left returns the graph to its original state.

After 6-7 minutes, the temperature rose a little higher, apparently due to self-heating of the sensor, this is sometimes the case with Dallas sensors, especially with a high polling frequency.


Further, the readings remained almost unchanged. After changing the polling frequency from 2 to 10 seconds, the readings decreased slightly, which confirms my assumption. And during operation, you can feel that the device is getting a little warm, it’s not a buzz at all, it’s not clear what could be generating heat there.
In principle, this is not a very big problem; the software has quite a lot of settings, including correction of readings.

Naturally, I wanted to disassemble this device, I thought there would be problems, but it turned out that it was enough to pull the connector hard and the device split into 2 parts, a board with a connector and components, and a metal case.



The device uses a temperature sensor LM75 from MAXIM. Inside, it presses a little against the metal body.

I brought the sensor to work, connected it, and configured it. Below is a description of the disgrace displayed on the screen.


The sensor is located not far from the alcohol thermometer, which shows 19-20 degrees (fluctuations from the operating mode of the air conditioner), it is clear that the temperature has dropped to approximately 28.38, it became curious what would happen without the housing, in the second part of the graph (after rising) it is clear that the temperature has settled at the same value, even the magical properties of blue electrical tape, with which I insulated the sensor board in one layer, did not help, went to the server room again, removed the electrical tape, inserted the board back into the case, in the end we have almost the same as before all the experiments.

It turns out that the sensor overestimates the readings by as much as 8-9 degrees (according to the datasheet, the error can be -2 - +2 degrees), very strange for a digital sensor. As a result, I made a correction in the software of 8 degrees, and along the way it turned out that in the software the maximum correction can be set only in the range of -8 - +8 degrees.

Main settings windows.

Data storage format, polling frequency.

Setting the response temperatures at which a notification is issued.
Moreover, you can set up notifications both when the temperature is exceeded and when it falls, and there is also a hysteresis setting, which may come in handy.

Calibration of readings and format for displaying temperature values.

The software language, unfortunately, is only Chinese or English, although the settings are so simple that you can ignore it.

There is also a color tab - the background color of the window with the graph and a software startup tab.

The software allows you to send notifications using MSN, email or Skype. There is also a display of a window with a graph and a window with a temperature measurement log.

In summary, the device left me with mixed feelings: on the one hand, it has a good design (with due diligence, you can even embed it into a tank to control the temperature of the liquid), pretty good software, but at the same time disgusting accuracy.

Pros.
The device is working
No problems were found during installation.
The software is quite convenient and intuitive.

Minuses.
The sensor overestimates the temperature readings, fortunately this can be corrected. Although for a device designed to measure temperature, this is quite a big minus.

Instead of a cat

Uptime of one of the servers; in fact, a thermometer is now connected to it.
Yes, XP, due to the use of specific software, some servers run Windows XP, nothing can be done. But as you can see from the screenshot, all this works quite reliably, I hope it will continue to work.


In general, in my opinion, the device may well have the right to life; time will tell how it will live in the future. As for the price, it's up to you to decide, this device was provided to me for testing and review free of charge by the chinabuye store I'm planning to buy +32 Add to favorites I liked the review +59 +100
MP707
Digital USB Thermometer
1410 rub.

The block will allow the radio amateur to obtain a multi-channel digital thermometer connected to a PC via a USB port. Essentially, it is a USB 1wire adapter with additional functions. 2 external actuators (for example, two BM146) are connected to MP707 and 2 loads are switched depending on changes in the temperature value from any 2 (two) of 32 temperature sensors (temperature control is carried out), which are connected to the line in parallel. The distance to the last temperature sensor is 100 meters.
IN offline mode work MP707 does not require connection to a PC and can receive power from any +5V network adapter with a USB connector.
The supply voltage +3.6...5V (for example, from a standard lithium battery) can also be supplied through connector J2 to the Vdd point.

I re-read all the information, saw the BM1707.cmd and example.ftp files. But I don’t know what to substitute in [ftp server name] or [full path and file name on the server]. I tried different things - he doesn’t want it. Show me - what did you put in these lines?
BM1707.cmd:
ftp -n D:\Temp\example.ftp
example.ftp:
open ftp.narod.ru
user usbsergdev _password_
put D:\Temp\BM1707.html /BM1707/BM1707-html.html
close
- Replace the username usbsergdev with your own,
- your password is also yours.
- Naturally, the html file should be located where indicated,
- the BM1707 directory must also exist on the server.
- Also read about ftp access on the website www.narod.ru, they changed something there for new users...

- How to configure the thermostat from another external temperature sensor?
Assign an active temperature sensor to operate the thermostat, for which please follow these steps:
- Select the program type "Table".
- Select the desired temperature sensor with the left mouse button.
- Right-click on "Current Thermostat Sensor".

I connected external sensors DS1820 and DS1822, but I can’t set the temperature measurement accuracy. After performing the procedure for changing the accuracy, the message “temperature measurement accuracy is set for all connected sensors” appears. What can be done?
- This is possible due to the lack of such a setting in some temperature sensors. Please check the operation of the device with DS18B20 temperature sensors.

I would like to see the ability to select a control sensor for each thermostat output in future versions.
- You can increase the number of control channels using MP710 together with MP701.

In MP707 standalone mode, the thermostat does not work - the ON signal is on. (heater), although the upper threshold is set to +30°C and the sensor is heated to +34°C. When connected to a PC everything is fine. What am I doing wrong?
- If you have connected additional temperature sensors, they need to be registered in the device. To do this, please enter: Control --- Thermostat --- Set.

I connected a temperature sensor to the device at a distance of 5 meters - it works fine. Then I connected it at a distance of 40 meters - the device does not see it! But the stated distance to the last temperature sensor is 100 meters over category 5 twisted pair cable. But my distance is 40 meters! At the same time, even TWISTED PAIR, or NOT TWISTED PAIR, but the device does not see the temperature sensor! What can be done?

When connecting temperature sensors at a considerable distance (more than 20 meters) from the base unit, it is important that the connecting wires have the least resistance, i.e. were copper and not too thin, for example, MKESH-3x0.5 http://www.cable-msk.ru/catalog/mkesh/. Therefore, twisted pair cable category 5 for laying computer networks is not the best option.

Digital temperature sensors DS18B20 have the ability to connect them to a bus (parallel to each other). Each sensor has a unique serial number assigned to it at the factory during manufacture. This allows each sensor to be addressed independently of its physical location on the bus. Together with the device, you can use both DS18B20 and DS18S20, DS1822, DS1820 (with accuracy reduced to +-2 degrees). Thermal sensors are “attached” to certain loads by software. The distance to the last temperature sensor on the line is up to 100 m. If the line length is more than 10 meters, you should use the connection of temperature sensors according to a THREE-WIRE circuit(using three wires). Recommended cable - twisted pair cable of the 5th category CAT5 (frequency band 100 MHz) - four-pair cable for laying local networks and telephone lines (supports data transfer rates up to 100 Mbit/s) - eight lines that are twisted in pairs (twisted pair) - four twisted pairs. For each signal, use a separate twisted pair, both wires of which are connected to each other. Total: out of four twisted pairs: one pair is connected to VCC (power), one pair is connected to DQ (data), one pair is connected to GND (common). A total of 3 twisted pairs out of four are used.

Requirements for connecting digital temperature sensors:
- A line must have one beginning and one end. In this case, several “ends” are missing (NOT A STAR!).
- A controller is installed at the beginning of the line.
- The last temperature sensor is installed at the end of the line, the distance to which is up to 100 meters;
- Between them there are intermediate temperature sensors.

- Thanks for the advice! Everything really worked on the 110 meter cable (no longer)!
1) Replaced R5 with R5=5 kOhm trimmer (the resistance at which became 1 kOhm).
2) Set at the end of the line Add.=1 µF ceramic + Cadd.=47 µF electrolytic.
3) Set C=47 uF at the beginning of the line from the controller side. It wouldn't work without him.
4) The diode did not short-circuit.

What is the reason for the presence of two series diodes in the MP707 circuit diagram at the top? Is it possible to short-circuit them both to raise the voltage on the temperature sensor line to the nominal 5 Volts?
- The USB bus has +5V power, and the logical levels for D+/D- are 0...3.3V. The diodes form a voltage drop of 1.4...1.6V, which ensures matching of logical levels. Bypassing them may cause the USB driver to perceive this as a short circuit on the data line and stop working with the device.

- My program VM1707.exe glitched. What can be done?
- In this case:
- Delete the ini file.
- Start VM1707.exe again.

- MP707 works fine, the relays switch (click), but the LEDs do not light up. What could be the problem?
- Possible cause is incorrect installation of LEDs on the board. Please install the LEDs according to their polarity.

- Is it possible to connect several MP707 to one PC and how to properly configure their joint operation?
- Yes, you can connect several MP707 to one PC. For this:
- Create a separate folder on your PC.
- Download (or copy) BM1707.exe no younger than version 11.
- Run BM1707.exe and read the device ID by going to View --- Management, Information --- USB ID).
- Close BM1707.exe.
- Open BM1707.ini.
- Find ID=* in it.
- Replace * with the device number (8 characters!).
- Save the file.
- Close BM1707.ini.
- Run BM1707.exe.
The ini file can be used (copied) the old one. In this case, you should add the entry ID=XXXXXXXX to the section.
To launch the 2nd copy, repeat the steps above.

When you restart the computer, the program for MP707 starts, but stops recognizing the sensors (13 sensors). You need to remove and reinsert the thermometer itself from the USB, after which it is recognized and starts working. Since the computer is remote, rebooting it after a power outage causes the temperature measurement to be interrupted, which is not desirable. How can you solve the problem?
- Install in the ini file:
AUTOTUNE=1
- Start the program.
- Close it.
- Install:
AUTOTUNE=0
- Restart your PC in normal mode.

In the "graph" mode, the temperature scale is not scaled to fit the entire range of measured values. You can only observe an interval 40-45 degrees wide and you have to move the graphs up and down to see their parts one by one. How to deal with this?
- In the ini file set:
LeftAxis_Automatic=1

- Is it possible to connect atmospheric pressure sensors to the MP707?
- MP707 has 1 1-wire digital input (no analog inputs), so barometric pressure sensors cannot be connected to it.

- How is the temperature measurement algorithm implemented by each of the temperature sensors in the MP707?
- The temperature measurement START command is transmitted for all sensors simultaneously. Temperature readings are then read sequentially for all sensors.

It is known that in the MP707, channel 1 controls the HEATER (Lower = ON, Top = OFF) and channel 2 controls the COOLER (Lower = OFF, Top = ON). Is it possible to install channel 1 to control the chiller?
- Unfortunately, there is no way to set channel 1 operating mode in the MP707 to control the cooler.

- Does MP707 keep a log file or is it intended only for monitoring?
- Yes, MP707 writes readings to 2 (two) log files:
1. With temperatures and times (See description!!!)
2. With operations completed (off by default)

- Is it permissible to use different sensors on one loop - 18B20 on the board, and 18S20 on the loop?
- Yes, MP707 simultaneously works with different temperature sensors in the line: both 18B20 and 18S20.

I connected three temperature sensors to the MP707. On the PC screen, the lines of all sensors are displayed in one (blue) color. Is it possible to change the color of each line for better perception?
- Yes, the color is determined by an entry in the ini file like:
DD000001A4BB4728_COLOR=16711680
Colors are specified in 3 bytes, 16711680 (dec) = 0xFF0000 (hex) - this is pure blue.
You can set it like this:
DD000001A4BB4728_COLOR=0xFF0000 This will be pure blue.
or
DD000001A4BB4728_COLOR=0x00FF00
or
DD000001A4BB4728_COLOR=0x0000FF
or combinations thereof.

Connected additional DS18B20 sensor for MP707. The length of the wires is 50 cm. The sensor is detected by the VM1707 program and does not display errors in the logs, but the temperature shows 127.5 degrees. When the temperature accuracy of the sensors changes, tenths of the connected sensor change, i.e. 127.5; 127.75; 127.875; 127.9735 At the same time, the standard sensor - on the board - shows the real temperature. What can be done?
- During conversion, the DS18B20 increases consumption and simply does not have enough supply voltage. The voltage drops due to R5, and conversion fails. For normal operation of the temperature sensor, please install a resistor with a nominal value of R=2.4 kOhm on the board parallel to R5.