Skip to main content

Analog sensor data send to blynk cloud

 


Analog sensor data send to blynk cloud



The analog sensor data can be sent from your ESP8266 to the blynk cloud to monitor the data. First of all we will send the analog data value from 0 to 1023 and after that we will send calculated data of different sensors.


Circuit Diagram 


Code 


#define BLYNK_PRINT Serial

#define BLYNK_TEMPLATE_ID "TMPL09mgzGQd"

#define BLYNK_DEVICE_NAME "project1"

#define BLYNK_AUTH_TOKEN "qT1XpiEBwwW-U54IdimqyOfrEtFFNHsp"

#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>


// You should get Auth Token in the Blynk App.

// Go to the Project Settings (nut icon).

char auth[] = "qT1XpiEBwwW-U54IdimqyOfrEtFFNHsp";


// Your WiFi credentials.

// Set password to "" for open networks.

char ssid[] = "YourNetworkName";

char pass[] = "YourPassword";

int sensor1;

BlynkTimer timer;


void mytimer()

{

      Blynk.virtualWrite(V2, sensor1);

}


void setup()

{

  // Debug console

  Serial.begin(9600);

pinMode(A0,INPUT);

  Blynk.begin(auth, ssid, pass);

   timer.setInterval(1000l, mytimer);

   

}


void loop()

{

  sensor1=analogRead(A0);

  Blynk.run();

  Timer.run();

}



Now go to your blynk dashboard and follow the following command serially.


  1. Go to templates

  1. Click on edit button.


  1. Then go to datastreams. And click on the  new datastream and choose the virtual pin. 

  1. Then choose pin V2 and change maximum value to 1023 and create it.









  1. Now go to web dashboard and drag the gauge and go to setting to choose the virtual pin V2.

  2. Then choose v2 and save it.



  1. Then click on save and apply .

  1. Then go to the search button and click on your project which you will see below.



  1. Circuit diagram:


Components required:

i) Breadboard

ii) NodeMCU ESP8266

iv) Jumper wires

v) MQ6 gas sensor

vi) Type B USB cable


  1. Now upload the code after selecting the port. After uploading, go to your blynk dashboard. And observe the sensor data.



Comments

Popular posts from this blog

2017//2(b)//Engineering Eco//KU

A loan of $10,000 is to be repaid over a period of eight years. During the first four years, exactly half of the loan principal is to be repaid (along with accumulated compound interest) by a uniform series of payments of A1 dollar per year. The other half of the loan principal is to be repaid over four years, with accumulated interest, by a uniform series of payments of A2 dollar per year, If i=9% per year, what are A1 and A2?

Testing servo motor with arduino

  Testing servo motor with arduino  Components Needed: Arduino board (e.g., Arduino Uno) Servo motor Jumper wires Steps for Connection: Servo Motor Pins: Ground (GND): Usually the brown or black wire of the servo motor. Power (VCC): Usually the red wire of the servo motor. Control Signal (PWM): Usually the yellow, orange, or white wire of the servo motor. Connecting to Arduino: Ground (GND): Connect the ground wire of the servo motor to one of the GND pins on the Arduino. Power (VCC): Connect the power wire of the servo motor to the 5V pin on the Arduino. Control Signal (PWM): Connect the control signal wire of the servo motor to digital pin 9 on the Arduino, as specified in the code by myservo.attach(9); Connection Arduino  Servo motor  VCC/ 5V Red wire  GND Black Wire  9  Yellow wire Explanation: Ground (GND): This connection ensures that the servo motor and the Arduino share a common ground, which is necessary for proper operation. Power (VCC): The servo motor needs a power supply t

CanSat

  CanSat is a type of small satellite that is designed to fit inside a soda can. These miniature satellites are used for a variety of purposes, including educational projects, scientific research, and commercial applications. The CanSat concept was first developed in 1998 by Bob Twiggs, a professor at Stanford University, and Jordi Puig-Suari, a professor at California Polytechnic State University. They wanted to create a low-cost, hands-on way for students to learn about satellite technology and space science. Since then, CanSats have become a popular platform for educational projects around the world. They are often used in STEM (Science, Technology, Engineering, and Mathematics) education programs, where students are tasked with designing, building, and launching their own CanSats. A typical CanSat consists of a soda can-sized container that houses a variety of sensors, such as temperature, humidity, pressure, and acceleration sensors. It also includes a small computer, a radio tran