Category Archives: Action 3: Temperature sent to Cloud by using Arduino and wifi

Seg 6: Key notes and summaries

Figure 3-6 Data display on the Arduino serial monitor

(7) data connection at the end: if you finished the above six steps successfully, congratulations, you are successful. The temperature measured by sensor LM35 has been successfully sent to the server on the internet by wifi module, as shown in Figrue 3-7.

Figure 3-7 Data display at server

Compared the temperature data shown in Figure 3-6 (local monitor) with Figure 3-7 (server at cloud), it is can be found that, both data are the same, which shows the data is transmitted successfully. In the next section, we will show the data handling to exhibit to people.

3.5 Key notes and summaries

(1) before configuring network parameters, to ensure the successful configuration, please recovery the wifi module to the default factory settings.

(2) please ensure the exactness of data configuration, especially the settings about mobile phone and server IP address.

Seg 5: Arduino code

(6) Arduino code

void setup()


Serial.begin(115200);//set baud value


void loop()


int n=analogRead(A0);//define A0 as the received port

float vol=n*(5.0/1023*100);//voltage signal to temperature




void upload_sensor(float vol)


// send the HTTP PUT request:

char buf[200];


int ret;

ret=sprintf(buf,”GET /upload.php?uid=ycf&ps=ycf&sensor_name=arduino&data=”);


Serial.print(buf); //stored at buf temporally

Serial.print(vol);//use temperature data vol

Serial.println(” HTTP/1.1″); //HTTP protocol name

Serial.println(“Host:”);//set server website

Serial.println(“Connection: close”);//data transmission is finished, and connection is closed.



Then you can download the above code to the Arduino control board. Note that, there is a switch. You should let the switch on the outside (O) when downloading the Arduino code. This is because the serial connection may affect the data download. At the same time, you can track the data transmission on the monitor at the Arduino soft-platform, which is shown in the red label. The temperature is 25.90, and this data has been transmitted to the remote server cloud by wifi networks.

Seg 4: Experimental analysis-2

(4) set up wifi hot spot: Since there is no other wifi hot spot in our such experimental environment, then we use OUR HTC mobile phone to set up a wifi hot spot (wifi router is suitable). After this, temperature data can be sent by wifi to the cloud. At first, opent the “WLAN hot spot” in the mobile phone. At the same time, remember to open 3G network signal, which can make temperature data collected by LM35 send to server in the remote cloud. In this experiment, the WLAN hot spot name in my phone is set as “HTCtest” for the mobile SSID, and password is “12345678″. You can also use the default name and password. However, for the input convenience, you had better to modify the default name and password.

(5) network configuration: When the computer connects the wifi network wifi HI_LINK_0021 successfully, you can input the website “″ in the browser, and input the user name and password (both are “admin”) to configure the web data, which is shown in Figure 3-5.

Figure 3-5 Network data configuration

When configure the network data parameters, please note that the marked by red rectangle, and others can be default set. Some notes are given as follows.

  1. At this time, wifi module can be viewed as a collection and transmission unite, which can send the collected temperature data to the server on the remote distributed cloud.
  2. SSID and Password are denoted by the SSID and Password of the mobile phone (or wifi router).
  3. Remote ServerDomian/IP: It is pointed to the server IP address where the temperature data are stored at.
  4. Locale/Remote Port: the server port number.

After configure, click “Apply”. At this time, if you check your phone, there is a “1 user connects” in the bottom of the “WLAN hot spot”. This implies that, the wifi module on the Arduino board has been connected the mobile hot spot. That is, the wifi module has been connected the internet.

Seg 3: Experimental analysis

3.4 Experimental analysis

(1) draw the experimental schematics: According to the design idea, you can draw the experimental schematics, which is shown in Figure 3-3, and this principle of LM35 is the same as Section 8 from the Basic Part. To readers’ convenience, this figure is given here again. Compared with this experiment, it is short of Arduino shield board and wifi board. But the principle of collecting temperature by LM35 is the same as Section eight in the Basic Part.

Figure 3-3 experimental principle

(2) circuit connection: By the experimental principle, we firstly connect the circuit shown in Figure 3-4.

Figure 3-4 Experimental connection

(3) wifi network connection: when we power the wifi on the Arduino main board, we can get the wifi signal. But, note that, for the stability of wifi signal, we should power the wifi shield board by the 15V voltage adapter designed in Table 3-1. Then, after a short while, you can search a wifi signal in your compter named as HI_LINK_XXXX (which is said in Section 2) transmitted by wifi module. Here, in my computer, the wifi signal is called as HI_LINK_0021. Then double click the wifi network HI_LINK_0021wifi, and input the password ( the default password is 12345678). It is said that you have connected the wifi networks. Note that, if you use the wifi module at the first time, to ensure the exactness of data configuration, wifi module needs to recovery the default factory settings (press the button RST on the Arduino shield board for 6 seconds, then power off and reboot for the wifi module. Also can see the method in Section 2). This step is similar to open the wifi in our phone to surf the internet. It shows that the wifi module can transmit the wifi signal. Then, if wifi module connects a wifi hot spot, then we can let data send by wifi communication.

Seg 1: Temperature sent to Cloud by using Arduino and wifi

3.1 Problem presention: how to use Arduino and wifi for sending temperature to remote cloud

In this section, we will give a presentation how can we send the measured temperature data to the remote cloud by using Arduino control board and wifi module. Then, by login into the distributed clients, you can check the temperature around your lovers at any countries in the remote Atlantic side. Certainly, if using many types of sensors, you can check and read many other required information.

3.2 Hardware and software

The required materials in this experiment are shown in Table 3-1.

Table 3-1: the required materials


name quantity function note


Arduino software 1 platform


server 1 Collection data


Wifi module 1 Wireless communication


Arduino shield board 1 Connection wifi All version


USB to serial RS232 1 conversion


5V1A voltage adapter 1 voltage


antenna 1 Transmit wifi signal optional


HTC mobile phone 1 Wifi hot spot


client 1 Read data

The hardware materials can be seen in Figrue 3-1.

Figure 3-1 Hardware