Problem sending data ph sensor to blynk 2.0

i have problem with sending data sensor to the blynk cloud, it connected blynk but the value is not shown. im using arduino uno + ESP 8266-01
does anybody can find where the problem is ?

my program :
'''
#define BLYNK_TEMPLATE_ID
#define BLYNK_DEVICE_NAME
#define BLYNK_AUTH_TOKEN

#define BLYNK_PRINT Serial

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;

char ssid[] =
char pass[] = ;

#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

#define ESP8266_BAUD 38400

ESP8266 wifi(&EspSerial);
SimpleTimer timer;

#include <Wire.h>

#include "DFRobot_PH.h"
#include <EEPROM.h>

#define PH_PIN A1
float voltage,phValue,temperature = 25;
DFRobot_PH ph;

void sendsensor2()

{
static unsigned long timepoint = millis();
if(millis()-timepoint>1000U){ //time interval: 1s
timepoint = millis();
//temperature = readTemperature(); // read your temperature sensor to execute temperature compensation
voltage = analogRead(PH_PIN)/1024.0*5000; // read the voltage
phValue = ph.readPH(voltage,temperature); // convert voltage to pH with temperature compensation
Serial.print("voltage:");
Serial.print(voltage,1);
Blynk.virtualWrite(V1, voltage);
Serial.print("V pH:");
Serial.println(phValue,2);
Blynk.virtualWrite(V0, phValue);

}
ph.calibration(voltage,temperature);           // calibration process by Serail CMD

}

void setup()
{
// Debug console
Serial.begin(115200);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
ph.begin();

Blynk.begin(auth, wifi, ssid, pass, "blynk.cloud", 80);
timer.setInterval(1000, sendsensor2);

}

void loop()
{

Blynk.run();
timer.run();
}
'''

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

#define PH_PIN A1

Esp8266 does not have a pin "A1". It's only analog pin is A0. If that is the problem, you would not see a value on serial monitor either, but you did not mention that.

EDIT: ah, we don't actually know what Arduino you are using, you forgot to tell us. Could be Uno with an ESP-01 connected by serial, I understand some people are still doing that for some reason.

yes im using uno + esp 01

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.