Introduction About Osoyoo Wifi Shield for Arduino:
Osoyoo Wifi Shield for Arduino is Wifi device which allows Arduino compatible boards(UNO,MEGA2560,Leonardo etc) to connect to Wifi network and become a node of Internet of Things(IoT).

To exchange data with other IoT devices, Osoyoo Wifi shield can make Arduino to work under three different roles:

  1. Work as an IoT client and send data to remote web server by HTTP protocol.
  2. Work as as a Web Server which allows other clients(browser or mobile APP etc) to get data from Arduino or send control command to Arduino through HTTP.
  3. Work as MQTT client which allows Arduino to Publish data to remote MQTT broker.

Purpose of this lesson:

In this lesson, we will tell you how to make Arduino+Osoyoo Wifi shield working as a web server(Role 2). After you connect the hardware and install software in this lesson, you can  use web browser  to get Temperature/humidity data from a remote DHT11 sensor and to turn on/off a remote LED which is connected to Arduino .

Parts and Device:
Osoyoo Wifi Extension shield x 1 pc
Arduino UNO compatible board x 1 pc
DHT11 Temperature/Humidity sensor x 1 pc
LED x 1 pc
Broadboard x 1 pc
Jumper wires

Circuit Connection Graph:

GNDGNDDataD5

DHT11 pin Wifi Shield on Arduino
VCC VCC
GND GND
Data D5
LED Wifi Shield on Arduino
long pin D13
short pin GND(through 400 ohm resistor)

Software Installation:

The Osoyoo Wifi Shield connects ESP8266 TX/RX pin to Arduino D3/D2 pin by default. So in Arduino sketch code, we need use Software Serial Port to communicate with ESP8266 (set D3 as RX and D2 as TX in softwareserial object).

To use this wifi shield in Arduino IDE, we need download WiFiEsp-master library from following link:
http://osoyoo.com/driver/WiFiEsp-master.zip

To use DHT11 sensor, we need use DHT library which should be downloaded from following link:
http://osoyoo.com/wp-content/uploads/samplecode/DHT.zip

You need go to Arduino IDE ->Sketch ->Include Library ->Add ,Zip library to load above zip files into Arduino IDE.

After Installing DHT.zip library, you need download sample sketch code from following link:
http://osoyoo.com/download/code/esp_webserver.ino

Then load the sketch into Arduino. Remember to change line 28/29 and make the wifi_hotspot_ssid and wifi_password to match your wifi router setting.

Result:
Once the code is running, you can go to your Arduino Serial window(top right corner) and see the IP address of your wifi shield as following:

you can also type AT+CIFSR command in above window and click send to get ip address.
Now go to your browser and visit above IP address, you will see following page:

You can see the temperature and humidity data has been sent by internet to your browser.

You can click Turn On or Turn Off button to toggle LED . This means you can send control command to remote device.