Esp8266- Uploading values to cloud- Thingspeak using Arduino.
ESP8266 is a cheap wifi module with gpio pins. It can be easily used for iot applications. It is completely compatible with Arduino Uno and hence lots of iot projects are made using Esp8266 Arduino.
What is Thingspeak?
Thingspeak is an open source website provided by Mathworks-Matlab. It helps you upload the values on their servers. They provide API keys which are used to access any channel. A channel is created by user which contains different fields. This fields are basically a graph on which our values are plotted.
Getting Started with Thingspeak.
- Go to thingspeak.com and sign up.
- Veirfy your account and login.
- You will see the window as shown below.
- Now click on New Channel- Green colour at top left. (I have already created one channel named as Meter. I am creating a new channel named as Elexfocus.
- Enter name, Give small description, and make fields. I have created 3 fields as I will upload voltage, current, and power values to the thingspeak server. Click on Save Channel.
- Go to sharing and check the box- Share channel with Everyone.
- Go to api keys and note down the Write API key. This key will be used to upload the values to Thingspeak.
Now your channel is created. You are ready to upload values to the server.
Interface your Esp8266 to Arduino Uno. Check this guide if you need help in interfacing method[easiest and safest method] -Link- Esp8266 Arduino interface.
BUY ESP8266 WIFI MODULE
AFTER CONNECTING ARDUINO TO ESP8266: [2 WAYS]
- Open Arduino software in your PC and copy-paste the code [Download Code from Here.]
- The ESP8266 default baudrate is 115200. I have changed it to 4800 using AT+UART_DEF=4800,8,1,0,0
- Edit the following details in your Code- Your Write Api Key. [Replace My Write Api key]
- Click on Verify to burn the code into Arduino. If everything goes fine Login to your Thingspeak and see field1 values will be updated LIVE.
- To monitor if everything is running properly then go to Serial Monitor and select Baud Rate to 9600. You will see the response from ESP8266 there.
- Open Serial Monitor.
- Select Baudrate 4800.
- Type the Following commands one by one.
GET /update?key=enter your api&field1=45
- You must receive response from the ESP8266 like OK. Check your thingspeak channel. You will see values uploading. Check my below images of values updated.
Please comment or mail us at email@example.com to get any help.