Microduino Digital tube thermometer(LM35, DS18b20)
Language: | English • 中文 |
---|
ContentsObjectiveThis tutorial will teach you using two temperature sensor, that are LM35 and DS18B20, and use the digital tube to display the temperature. Equipment
First Experiment(LM35 temperature sensor)LM35 temperature sensor LM35 temperature sensor output voltage linear relationship between the Celsius temperature scale,0 ℃, output is 0V, for every 1℃increases in output voltage of 10mV.
Identify the pin easily, put the sensor as upper picture, the left pin is power, the middle pin is data, the right pin is GND. SchematicPin table:
ProgramLM35 and DS18B20 use the same program. Refers to MicroduinoDigitalThermometerLM35-DS18B20.ino
DebugStep 1: Copy the code to IDE and compile it; Step 2: Set up the circuit, as follows: Step 3: Download the program and then run it. Step 4: Observe the digital tube. Find a hot object to close the temperature sensor, the digital tube will display the value. ResultAfter LM35 sensor near the heat source, the digital tube displayed value will rise, leave the heat source temperature will gradually reduce.
Second Experiment (DS18B20 temperature sensor)DS18B20 temperature sensor DS18B20 is a single bus digital sensors produced by United States DALLAS company, convert temperature variation to digital signal, and each device has an unique serial number, so can realize multipoint measurement. Its measuring range is -55°C to +125 °C, in which -10°C to +85°C range measuring accuracy can reach ±0.5°C. It is only has three pins, GND, DQ and VDD, power supply can be directly by the cable itself, also can use external power supply, it is convenient to use, but must pay a price for this kind of convenient. Its timing is critical, various operation on DS18B20 must be conducted in accordance with the protocol of DS18B20. Operation protocol contains: initialize DS18B20, send ROM function command, send the memory operation command and process data. If there are more interrupt in program, or the hardware connection wire is too long, which can cause temporal waveform distortion, then result in chaotic measurement results. Based on this situation which makes use of this chip by certain restrictions. Identify the pin easily, put the sensor as upper picture, the left pin is power, the middle pin is data, the right pin is GND. SchematicPin table:
ProgramLM35 and DS18B20 use the same program. Refer to MicroduinoDigitalThermometerLM35-DS18B20.ino
DebugStep 1: Copy the code to IDE and compile it Step 2: Set up the circuit, as follows: Step 3: Download the program and then run it. Step 4: Observe the digital tube. Find a hot object to close the temperature sensor, the digital tube will display the value.
ResultAfter DS18B20 sensor near the heat source, the digital tube displayed value will rise, leave the heat source temperature will gradually reduce. Video |