Tag Archives: software

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: 192.168.16.254. Note that, in the default factory setting, the IP address is 192.168.16.254. 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 3: hardware and software for removing jitters

The first method: remove jitter from hardware

Firstly, we should get a thorough understanding of the reasons of generating jitters. From Figure 3-5, 3-6, we know that, even if the analog port A0 is cut, there exists voltage to trigger LED light. This shows that there exists some interference around us. If the interference is expressed as voltage, its value may be bigger than 512. Therefore, according to Figure 3-3, a bias resistor can be paralleled between ports 1, 2 and 3, 4. In this way, if the button doesn’t be pressed down, and if there are some interference existing as a voltage level, the voltage will be consumed on the bias resistor. Thus, the LED does not light, if the button doesn’t be push down. By adding a bias resistor (i.e., pulldown resistor), the circuit is changed, as shown in Figure 3-8. Evidently, from this Figure, the extra voltage has been already consumed on the bias resistor. Equivently, the extra voltage is already masked. At this time, if the button doesn’t be pressed down, the LED light doesn’t light. When the circuit is prepared by Figure 3-9, the LED light would light after the code in Program 3 is burn into the Arduino board. Everything is the same as expected.


Figure 3-9 Circuit after adding a bias resistor

Appendix: pulldown resistor (bias resistor)

As shown in Figure 3-10, the bias resistor is connected to GND in the above, so its name is called as pulldown resistor, which means the voltage in location A is pulled down to a low voltage level (GND). Its main function is to make the circuit generate a stable voltage with other resistors and driven circuit.


Figure 3-10 Pulldown resistor

The second method: remove jitter from software

Principle: as the above-mentioned description, once the button is pressed down, there is a delay 5~10ms because of the jitter. So, we can let the trigger delay 5~10ms to make the jitter disappeared in this time. Then, we can make a decision by the voltage after this time. This way better fits for many buttons, since many pulldown resistors are very complex to be arranged. However, during our experiment, if the pulldown resistor doesn’t be connected to the circuit, the LED is still lighting for any long time. Generally, we can combine software and hardware to remove the jitters. In the following appendix is attached here.

Appendix: the code removed jitters by software

01 /*
02 Program 3.1: Remove the jitters by software and hardware
03  */
04  
05 int Button=3; 
06 int LED=13; 
07 boolean onoff=LOW; 
08 void setup()
09 {
10   pinMode(Button,INPUT); 
11   pinMode(LED,OUTPUT); 
12 }
13 void loop(){
14   if(digitalRead(Button)==LOW
15   {
16     delay(10); 
17     if(digitalRead(Button)==HIGH
18     {
19       digitalWrite(LED,onoff);  
20       onoff=(!onoff); 
21       delay(10);  
22       while(digitalRead(Button)==HIGH
23       {
24         delay(1);
25       }
26     }
27   }
28 }