Get Started with Wifi sheild
Last revision 2026/01/20
In this section, we will use the Wifi shield to create a Web server as an sample application.Let's follow the steps below to make it work!
Hardware Preparation
Here's all the hardware needed.
- Arduino UNO processor x1
- WIFI shield for Arduino v2.2 x1
- WIFI Antenna
- A to B USB Cable x1
- Router x1
Hardware Setting
- Program a simple led blinking sample code for your Arduino UNO first to avoid the serial communication conflict between USB port to the WIFI shield.
- Stack the WIFI shield to the Arduino Uno and connect the antenna to the WIFI shield
- Set the "USB/Arduino" Switch to the USB side to enable PC com port to send AT command to WIFI shield directly
- Set the "Run/Prog" Switch to RUN side
- Plugin the A to B USB to the Arduino microcontroller. The "POWER" LED turns on at the same time.
Config the WIFI shield setting via USB com port
We need a serial monitor for configuring the WIFI shield setting in this part. There're lots of good tools like putty, CoolTerm and Arduino serial monitor. In this case, we choose the Serial monitor included in Arduino IDE. Please set the baud rate to 115200 bps and Both NL&CR.
- Open the com port of your Arduino UNO. Enter "at" to test the communication between WIFI shield and the USB port.
- Enter "AT+WS" command to scan the network and get the list of found networks like the picture(Fig1) shown.
- Setting the WIFI shield according to the router information. List the sample command below(Fig2).
- The SSID,password and the security setting depends on the your router setting. So please check the router first.Otherwise,if the setting isn't correct,the wifi shield can't connect the router properly.
- The gateway of my router is "192.168.0.1". But usually it's "192.168.1.1".So please check the setting of your network also. And set the right IP address for your WIFI shield.
- Then save the setting(Fig3). Otherwise all the setting above will be cleared after resetting.
- After getting the feedback from WiFi shield correctly, we finish the setting for the WiFi shield and create a TCP server in the local network.And the indicator LEDs(marked "STW" and "ASSOC")will turn on to indicate the connection with the router.
Connect to the TCP server from WiFi shield
In this section, I choose putty to work as an TCP client and send commands to the WIFI shield.
- Config the Host Name and Port.Set the connection type to Raw and Press open! Then you will connect to the server created by WIFI shield.
- Now you could send commands via the TCP client simulated by putty to the WIFI shield. And putty will receive the strings sent from the Serial monitor also.
Was this article helpful?
