Monthly Archives: October 2013

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

Seg 8: Mobile phone software

二. Mobile phone software

In nature, mobile phone software is the same as PC software. In this section, we will debug wifi module by mobile phone software.

  1. Install the mobile phone debug software EasyTCP (have iphone and Android versions, respectively. If you want them, you can contact me by skype: yichone.), in this experiment, we use the Android version EasyTCP.
  2. Open the wifi network at mobile phone, and look for the wifi signal HI-LINK_0021的wifi and double it to connect with the same way as PC version, as shown in Figure 2-12.

    Figrue 2-12 Look for the wifi signal HI-LINK_0021

  3. Open the mobile software EasyTCP→click “CONNECT”→click “+” to add the connection IP address and port number, which is the same as PC software. IP is, and port is 8080, which are shown in Figure 2-13. Then click “connect” to let mobile phone connect to the wifi network HI-LINK_0021.

    Figure 2-13 Connect to wifi network by Android mobile phone

  4. At the same time, we should open the serial assistant. In this experiment, we must send the data from mobile phone to PC serial port by wifi network. In the later experiment, we would send the data from mobile phone to server on the cloud. In figure 2-14, data “5″ has been send to PC serial port by wifi network successfully.

    Figure 2-14 Communication between mobile phone and PC serial port by wifi

2.5 Key notes and summaries

1) As for the new wifi board, we can make a preliminary judgment whether a wifi board can work normally by simply observing the display state of the LED light. But, we should note that the insertion direction when wifi board is inserted into a Arduino shield board.

2) when network-serial assistant is used to debug wifi module, it is noted that the wifi module should be recovery to the default factory setting and the software settings.

3) We should choose the wifi signal transmitted from wifi module to debug the wifi module, or we cannot use the wifi module for the wireless communication rightly.

Seg 7: Look for the wifi networks

(2) Look for the wifi networks

Figure 2-8 Look for the wifi network signal

After setting the relevant parameters by the above-mentioned step (1), we can find the wifi signal transmitted from wifi board according to the followings.

  1. After power on the wifi board for about 30 seconds, the three LED lights would be exhibited normally. That is, LED1 is lighting with red all the time, LED2 is light with green all along as well, and LED3 is blinking with green light. The relevant context can be referred as shown in Section 2.3. Then, clicking the network icon, you would find there are many wireless network signals, where there is a named as HI_LINK_XXXX wifi signal, which is the wanted wireless wifi network signal. Therefore, we can double click such wifi signal, then it is needed to input password 12345678, which is the default password. If it is the first connection, it needs us to input the password, but thereafter, we may not input the password. Note that, the later 4 letters “XXXX” in the wifi signal name HI-LINK_XXXX is denoted by the different names, since their names may be different according to the different wifi devices. For example, in our such example, the name of wifi signal is HI-LINK_0021, which is also the same as the name encountered in the mobile phone. After double clicking the HI-LINK_0021 wifi signal and input the password, we can make the computer connect to the wifi module on the Arduino shield board, as shown in Figure 2-8.
  2. According to 1), we can connect the wifi network HI-LINK_0021 transmitted from wifi module. Then, return to the network-serial assistant shown in Figure 2-6, click the “Open” button on the left serial setting, and click the “Connect” on the right wifi setting, which are denoted by opening the serial port COM6 and connecting wifi network HI-LINK_0021, as shown in Figure 2-9 with red label. Note that, if the serial port doesn’t open, or the wifi network doesn’t be connected, the buttons “Open” and “Connect” would not work normally, and thus we cannot change the states of buttons “Open” and “Connect”. In other word, “Open” cannot be changed into “close”, and “Connect” cannot be changed into “disconnect”.

Figure 2-9 open the serial port and connect wifi network

  1. After connecting the serial port and wifi networks by Figure 2-10, we can transmit and receive data between serial port and wifi module, as shown in Figure 2-11. When we send a digital number “1″ at serial port, then we can receive “1″ at wifi network. Similarly, if sending “1″ at wifi networks, we can receive “1″ at serial port. Thus, we have realized the normal communication between serial port and wifi network.

    Figure 2-10 WIFI connection based on Arduino shield board

    Figure 2-11 Communication between serial port and wifi network

Seg 6: Software settings

2.4 Software debug

You can also use computer (PC) and/or mobile phone software to debug the wifi module. After the connection among the wifi board, Arduino shield board, USB to RS232 cable, and power, then we can test the wifi module shown by the following.

一. Computer (PC) version software

(1) software setting

Open the network serial software (which can be download from the website, if cannot find, can be contact me by my skype: yichone). Firstly, we should set simply the software environment, as shown in Figure 2-6, especially for the red label.

Figure 2-6 Simple settings for the PC network serial debug software

Some notes on the settings:

  1. PortNum: can be found at “computer (or my computer)”→right click “property”→click “device manager”→click “COM and LPT”. We can get the PortNum is COM6. So, we choose “COM6″ in the software, as shown in Figure 2-7.

Figure 2-7 query of PortNum

  1. Baud rate (BauR): during the wireless communication, the rate is generally chosen as 115200. It is also the wifi transmission rate 11MHz.
  2. Protocol: during the wireless communication, we should let wifi module as TCP Client mode. In other words, let wifi as client to visit the server.
  3. ServerIP (server IP address): :in the default factory setting, please input the IP address: Note that, in the default factory setting, the IP address is However, if the wifi board has ever been used, the IP address maybe is not this address. So, before using it, we must confirm the default factory setting for the wifi module. The way to default factory setting is introduced at Section 2.3.
  4. ServerPort (server port): the value is 8080.

Seg 5: Get a better view of the LED lights on wifi board

  1. Get a better view of the LED lights

    If you get a better view of the wifi board, there are three LED lights. As the above-mentioned, if the insertion direction is right on the wifi board, the three LED lights would be lightened, as shown in Figure 2-4, where LED1 is the indicator for the power source, if the LED is light with red all the time, it shows that the power source works normally; LED2 is lighting with green, which shows the wifi module works normally; vice versa, the wifi module cannot work normally if LED2 is dark. LED3 is denoted by the state of wireless transmission. If LED3 is shining fast, it shows that the wifi module is transmitting data, and shining slowly shows that the wifi module is idle and has no data to transmit. Moreover, if LED3 is dark, it shows the wifi module close the wireless transmission.

Note that, if the wifi module has ever been used (i.e., it is not a new wifi module). To ensure the configuration is right, the wifi board should recovery the factory default setting. If wifi board is already default setting, you can skip over this step. Firstly, give the wifi board a 5V (350mA) power and wait about 30 seconds. Then press the RST button on the Arduino shield board for about 6s, as shown in Figure 2-5. The wifi board would reboot. After this, the wifi board can return to the default factory setting.

Fgure 2-5 RST button on the Arduino shield board