By the connection diagram shown in Figure 8-2, this experimental schematics is easily draw in Figure 8-3. Note that, we should design the circuit by the pin connection of temperature sensor.
Figure 8-3 Schematic circuit
8-4 Circuit diagram
Run Program 8.
01 // Program 8: use sensor to measure your environmental temperature
Open the serial monitor on the Arduino software platform, we can see the Celsius temperature sensed by the temperature sensor LM35. Note that, the baud of monitor should be the same as the above code, which can be seen in Figure 8-5.
Figure 8-5 the temperature value on the Arduino monitor
From Figure 8-5, we know that the environmental temperature is about 24.44℃ in this experiment.
Key points and summaries
We should know the features about the temperature sensor. For example, in such experiment, the temperature of LM35 is linearly proportional to the voltage. By this relationship, we can get the formula about the temperature and voltage.
We should the connection about the sensor logs. As for LM35 in this experiment, let the full-face having characters facing us. Then the left is connected to 5V port on the Arduino board, the right leg is a GND port, which should connect to the GND port on Arduino board, and the middle leg should connect to the analog port on the Arduino board, which can output the concrete value about temperature.
The output temperature value can be seen on the serial monitor. But, the baud for the monitor should be unanimous with the baud set in the experimental code.