ESP8266 - THE BIG STEP
ESP8266 controlling a servo through a webpage |
This Wifi module is very similar to your HC-05 bluetooth modules except somebody decided to make it very hard to use, at least to a beginner. It took me on - off a month to finally get the hang of it but chill out my bros you don't have to. You came to the one stop destination, where I give you nothing but only the necessary morsels of information to make the darn thing work as fast as possible.
Okay i assume you've just bought the ESP8266 ( just the module ) , it's arrived but now what . Here's what, if you don't have these things buy them :
1. 1k ohm Resistors - 3
2. Breadboard Power Supply module - optional but makes life very easy
Now, check if you have these things or get them too.
1. Arduino UNO
2. Breadboard
3. Male to Male Jumpers
4. Female to Male jumpers
5. Patience ...
Out of the box, your wifi module needs to be configured to communicate with the Ardiuno .
Use the Circuit Diagram given below to set up the system.
IMPORTANT - DON'T POWER THE ESP8266 USING THE ARDUINO'S 5V PIN . USE IT'S 3.3V PIN OR BETTER USE A BREADBOARD POWER SUPPLY. BE CAREFUL WITH THE CONNECTIONS.
Once it's all connected, switch on the power supply and upload the following code to your Arduino
Or use this link CLICK ME!
If you get an OK awesome, we're talking with the ESP8266.
If you get back an OK awesome again , we have changed the modules' baud rate to 9600. If you try giving it any commands it shouldn't work as intended.
Close the serial monitor and change this in the code
Upload the code.
We changed the baud rate and now we'll try connect to a network.
Open the serial monitor and send the command AT
If it looks like this after sending the command . cool
Now, send this command to set the module on mode 1 - AT+CWMODE=1
The result should look like this.
Dessert Time - We'll search for nearby Wifi networks by sending this command - AT+CWLAP
The monitor should show you the networks like this.
As an example , let's try connecting to Liberty Media
Send the command - AT+CWJAP="Liberty Media","nlj-hyiyk187"
As understood just replace Liberty Media with your wifi's name and nlj..... with your password.:)
If you get WIFI CONNECTED and WIFI GOT IP. Damn kid you did it We connected !!
To know the IP address send in this command - AT+CIFSR
And that's your IP address . Congratulations you've just opened up to an exciting field in robotics - IoT ( Internet of things)
Next post , we'll learn how to control a servo using an ESP8266 and an arduino through a webpage
So stay connected !
my setup |