I should be turning on the lights, a filter, a heater via relay. This I managed to do it. I can not manage to eventor the temperature sensor the flow meter and light-sensitive sensor. I combine it with a virtual pin, but do not understand how.
The KY-018 is a simple Light Detecting Resistor on a board, outputting an analog range of 0-1023, no library required for that.
But any libraries required by any other sensor will need to be sourced from the manufacture site, sellers site, or found through Google on some instructable or something. That is not something supplied by Blynk.
We would also need to see your existing code to even begin to understand what you are doing.
#include <SoftwareSerial.h>
#define BLYNK_PRINT Serial
#include <SPI.h>
char auth[] = "*****";
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
int sensorPin = 0; //define analog pin 1
int value = 0;
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "******";
char pass[] = "******";
// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial
// or Software Serial on Uno, Nano...
SoftwareSerial softSerial(10, 11); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200
ESP8266 wifi(&EspSerial);
// This function will be called every time Slider Widget
// in Blynk app writes values to the Virtual Pin V1
BLYNK_WRITE(V1)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
// process received value
}
#include <math.h>
#define Ro 10000 // Valore NTC a 25°C
#define NTCPIN A0 // Pin di collegamento NTC
#define Tnom 25 // Temperatura nominale NTC
#define B 3960 // Coeff. Beta della NTC (dai datasheet)
#define R1 10000
float Temp; //7 serve al sensore
float RNTC;
float x;
float t;
float T;
void setup()
{
uint32_t baud = 115200;
Serial.begin(baud);
softSerial.begin(baud);
Serial.print("SETUP!! @");
Serial.println(baud);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
}
void loop()
{
Serial.print("Temp=");
Serial.println(misTemp());
delay(1000);
}
// Funzione che misura la temperatura
float misTemp() {
Temp=analogRead(A0);
x=(Temp/1023)*5; // proporzione
RNTC=(R1*5/x)-R1;
t=(1/Tnom)*(log(RNTC/Ro)/B);
T=(1/t)-273,15;
Blynk.virtualWrite(1, T);
Blynk.run();
}
This forum is not a code factory… or general repair depot for broken code…
However, your void loop() contains a delay that will compromise connection, and is broken… no Blynk.run(); or proper timer usage for your misTemp() loop.