ESP8266 + WS-420 + Blynk

ESP8266 + WS-420 + Blynk

Could anyone assist in the code to enable blynk to record the vibration levels from the above combinations.

more than greatful.

I assume you mean SW-420 ?

The forum isn’t a code factory, and you’re unlikely to find a forum member that is going to provide you with a working solution.

If you have good C++ programming skills, and can articulate exactly what it is that you are trying to achieve with your project, then you’ll probably be able to get some assistance with adding Blynk to a working sketch.

Pete.

Thanks for the reply, I am 74 yrs old and have no programing experience. I have a working program for the ESP 8622 but do not know how to intergrate blynk to achieve my aims.

If you share your working program (post the code with triple backticks at the beginning and end) and explain exactly what it is that you’re trying to achieve then I’m sure you’ll get some help.

Pete.

[Unformatted code removed by moderator]

I was ok with the original version of blynk, but fail completely the new version. I would like to show the vibrations as a graph with a time and date. but am unable to do in Blynk IOT

Please help

@Tesla6518 Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

You will need to remove the triple forward slashes (///) from the beginning and end of each line of your code, so you may be better deleting your code from your post and replacing it with your code from the IDE, plus the triple backticks at the beginning and end of the entire block of code (not each line).

Pete.

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
 
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "be87fc5249a94f38a39941b3e01c4cd6";
 
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "";
char pass[] = "e";
 
SimpleTimer timer;
 
// sensors 
int vs = D0; // vibration sensor 
int sdata = 0; // sensor data will be stored in this variable.
 
String vdata = ""; 
 
// This function sends Arduino's up time every second to Virtual Pin (1).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V1, millis() / 1000);
 
}
 
void setup()
{
  // Debug console
  Serial.begin(9600);
  pinMode(vs ,INPUT); 
  Blynk.begin(auth, ssid, pass);
 
  // Setup a function to be called every second
  timer.setInterval(10L,sensorvalue); // 1000L
}
 
void loop()
{
  Blynk.run();
  timer.run(); // Initiates BlynkTimer
 
}
 
void sensorvalue()
{
  long measurement =vibration();
 //delay(50);
  Serial.println(measurement);
   Blynk.virtualWrite(V3, measurement);
  if( measurement > 1000 )
  {
    Blynk.notify("Vibration detected!!");
  }
vdata = vdata + "Vibration: " + measurement;  
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, vdata);
vdata = ""; 
}
 
long vibration(){
  long measurement=pulseIn (vs, HIGH);  //wait for the pin to get HIGH and returns measurement
  return measurement;
} ```

I suggested that you…

Instead you’ve shared a sketch that has some random Blynk code added to it and which won’t compile, and explained nothing about what you’re trying to achieve.

Pete.