Arduino ESP8266 WiFi Shield Version 1.0 by WangTongze (The crappy "Moer" version)

On a beautiful sunny day, I decided to start exploring the Internet of Things (i.e. IoT) universe by getting started with a project as simple as turning on an LED via WiFi. I had that intention that once I had done with turning on and off an LED, I would move on to making a WiFi RC robot with a WiFi camera that could allow me to control the robot while sitting at any corner in the world. With that in mind, I bought an Arduino ESP8266 WiFi Shield from an online store to use with my available Arduino Uno R3. Actually, there were many options for IoT projects such as Arduino Uno WiFi or NodeMCU, but I went with a WiFi shield since I thought that the other options might provide more functionalities than needed with a bit costlier price.

After obtaining the WiFi shield, I looked up how to use it at this link just to realize that I had inadvertently bought a crappy one with wrong components already soldered to the board (The "Moer" shield). The article suggests that to solve the problem I should replace some transistors on the board with another type. However, I couldn't find that type of transistors anywhere online and I was too lazy to search for such components directly in a hardware store. Sadly enough, after fail attempts to establish the UART serial communication between the Arduino Uno and the ESP8266 WiFi module on the shield, I decided to postpone my IoT exploration journey in preparation for the following academic semester in October 2020.

The "Moer" WiFi shield

Fortunately, I've given another attempt at the communication recently, and it was unexpectedly successful. To have a grasp of the method I'm going to discuss below, I would recommend you to first read the Instructables article from the link above. If you have read the guide before, I believe that you may get what I'm going to say.

Before any IoT project, I found out that it is essential to check whether AT commands could be sent from Arduino as a bridge to ESP8266 or not. For this stage, I followed exactly what was mentioned in step 2 in the article (I typed in the commands manually since the serial monitor didn't get the text copied from other places properly). However, there are also a few AT commands that I'd like to use as a procedure to ensure the stability of the ESP8266 module. Those commands and their corresponding responses are listed in order as follows: 

1. If I type "AT" in the serial monitor, it should respond "OK".

2. I check the current operating mode of the ESP8266 by typing "AT+CWMODE?". The WiFi module should be working in mode 3, which means it is operating as both a host and a client. This allows the ESP8266 to connect to another WiFi access point in my house.

3.  I also check whether the module is being connected to any other WiFi or not by typing in "AT+CWJAP?". If connected to any network, the serial monitor should display its correspondent WiFi credentials.

4. If I wanted to quit joining the current network, I would type in "AT+CWQAP".

5. Before joining another access point, I will check to see which network the ESP8266 is capable of detecting by typing in "AT+CWLAP". This is crucial since the ESP8266 won't connect to the WiFi if that network can't be found.

For turning on and off an LED, first off I downloaded an IoT app called "Blynk", which is available on both iOS and Android. Then I created a new project with Arduino UNO as the project's device, and WiFi as the connection type. 

Project settings in Blynk

To make it work, the wiring connection was made only between the ESP8266 module and the Arduino Uno. In other words, the WiFi shield was no longer used as a shield but instead as a separate board from the Arduino. The TX pin from the Debug port on the shield was connected to pin D2 (i.e. digital pin 2) on the Arduino, RX to pin D3, 3.3V to 3.3V, and GND to GND.

WiFi shield as a separate board from Arduino Uno

For the Arduino sketch, I use an example code titled "ESP8266_Shield" from the Blynk library. Then I only need to change the Auth Token as shown in the Blynk app and type in the WiFi credentials that I want to use. Next, after the sketch has been uploaded to the Arduino, I turn on the Serial Monitor and wait until it shows "Ready".

Finally, I set up a virtual button connected to the same pin to the LED's anode and tap the "Run" button on the top right of the screen. Now as the button is switched on, the LED will turn on and vice versa.

Sample interface set-up for WiFi RC robot project

Comments

  1. Stay connected on the go with our reliablePocket Wifi solution. Enjoy seamless internet access wherever you are.

    ReplyDelete

Post a Comment