Tag Archives: leg

Seg 4: Experimental principle of LM35

  1. Experiment and code
    1. Experimental principle

The principle of such experiment is very simple. The voltage data is sensed by the temperature sensor LM35, which would be sent to the analog port (A0 is used in this experiment) on the Arduino board. Then the Celsius (Centigrade) temperature can be output by the linear relationship between the voltage and temperature. For example, in this experiment, we know the linear relationship for the temperature LM35 by one Celsius temperature/10mV. Thus, we can get the voltage value n from the analog port A0 connected LM35 on the Arduino board. Not that, the data n is discrete and located on the range of 0~1024. So, we should change the discrete data n into a continuous voltage to get the Celsius temperature. In fact, the computation is simple. We know that, as for the analog ports A0~A5, the value range is 0~1024, and 1024 is corresponding to 5V. Therefore, if we know the value in A0 port, then we can obtain the discrete voltage value within 0~1024; i.e., the value is n. Then, we can compute the Celsius temperature. Assume that the continue voltage in port A0 on Arduino board is denoted by U. Then, we have the following compute formula by the principle A0 and the linear relationship between Celsius temperature and the continuous voltage.


where vol is the Celsius temperature we should compute, n can be achieved from analog port A0 on the Arduino. Therefore, we can compute the continuous voltage in A0 by equation (1). Then, we substitute the U into equation (2), the Celsius temperature can thus be obtained. In addition, the value of vol (i.e., Celsius temperature) could display on the serial monitor on the Arduino software platform.

Seg 1: How to use Arduino controller and button to control the blink of LED

3.1 Problem description: How to use Arduino controller and button to control the blink of LED

The previous two examples are relatively simple. When the corresponding codes are burn into the Arduino board, then the LED could blink. But it cannot interact with people. So, in our such experiment, by adding a new material, button, to control the blink of LED.

3.2 The required material

Table 3-1 the required material


Name Qua Function Note


Arduino software 1 IDE Version 1.05


Arduino UNO board 1 board


USB line 1 burn


Dupont lines many Connection elements




Resistor (10, 200Ω) 2 Current limited


Breadboard board 1 connection


button 1 onoff

Before doing this experiment, we firstly introduce the relevant properties of botton.


Button is an usual device in the design embedded system. By button, some instructions and data can be utilized to control the on/off states, which can control the run states of some devices. For example, in this experiment, by button, the high/low level is generated to control the blink of LED. But, there are many kinds of switches, such as a single switch in kitchen, double switches in bedroom, voice control switch in corridor, and so on. In our such experiment, we mainly use small/or miniature switches, as shown in Figure 3-1.

Figure 3-1 Miniature buttons

And the size of the miniature switch in this experiment is about 6*6*5mm and has four legs, which is shown in Figure 3-2.

Figure 3-2 Miniature button in this experiment

Note that, the two logs divided by a deep ditch is the same side. Its principle is also given out in Figure 3-2. If the button is pushed down, the four logs 1,2,3,4 would connected each other. Then this can trigger a high level to light the LED. But if you relax the button, 1,2,3,4 would be off

Figure 3-3 Schematics of button