Hello everyone, … i have a project to control selenoid valve to make an irgation system using moisture senso and arduino pro mini with esp8266 as shield. it can be monitoring using gauge and controlled by widget button. and the problem is when i hit play button it working just a 5-8 second and then the notification come up and said “your arduino pro mini is disconected”. after that it will reconect again but and in 5-7 second it will disconected again. on my esp8266 i see the blue led blinking until notification came adn stop blinking
But when i dont open blynk apps and hit the play button and i watch blink led on esp it never stop blinking
and look normally
my serial monitor and it come like this when i dont hit play button
my serial monitor and it come like this when i hit play button
and this my code
indent preformatted text by 4 spaces
/**************************************************************
* Blynk is a platform with iOS and Android apps to control *
* Arduino, Raspberry Pi and the likes over the Internet. *
* Blynk library is licensed under MIT license *
**************************************************************/
//Library
#define BLYNK_PRINT Serial
#include <ESP8266.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <SoftwareSerial.h>
#include <SimpleTimer.h>
#include <OneWire.h>
#include <DallasTemperature.h>
SimpleTimer timer;
#define ONE_WIRE_BUS 12
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
SoftwareSerial EspSerial(2, 3); // RX, TX
ESP8266 wifi(EspSerial);
int LDR = A6;
int Moisture = A7;
int sensorLDR = 0;
int sensorMoisture = 0;
int merah = 4;
int biru = 8;
int selenoid = 13;
int buzzer = 9;
int Override = 6;
int buttonPin = 10;
int tombol = 0;
int tes = 0;
char auth[] = "02bb3311430d49df8237dfe6d51bb46f";
WidgetLED led1(2);
WidgetLED led2(3);
WidgetLED led3(4);
WidgetLCD lcd(5);
void setup()
{
Serial.begin(9600); // Set console baud rate
delay(10);
EspSerial.begin(9600); // Set ESP8266 baud rate
delay(10);
pinMode(13, OUTPUT);
pinMode(4, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(buttonPin, INPUT);
pinMode(LDR, INPUT);
pinMode(Moisture, INPUT);
digitalWrite(buzzer, HIGH);
Blynk.begin(auth, wifi, "R101 Andrians.Net", "notonline123");
timer.setInterval(1000L, ldr);
timer.setInterval(1000L, moisture);
timer.setInterval(1000L, sendUptime);
lcd.clear();
lcd.print(3, 1, "System Online");
lcd.print(0, 2, "Sprinkler System");
}
/////////////////////////////////////////////////////////////////
void loop()
{
digitalWrite(merah, HIGH);
Blynk.run();
timer.run();
cek_ldr();
cek_moisture();
cek_tombolf();
}
//++++++++++++++++++++++Blynk App++++++++++++++++++++++++++++++//
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
void ldr()
{
sensorLDR = analogRead(LDR);
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(0, sensorLDR);
}
/////////////////////////////////////////////////////////////////
void moisture()
{
sensorMoisture = analogRead(Moisture);
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(1, sensorMoisture);
}
void sendUptime()
{
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(8, millis() / 1000);
}
//===================Akhir Blynk APP===========================//
//++++++++++++++++++++++Input Fisik+++++++++++++++++++++++++++//
void cek_ldr()
{
sensorLDR = analogRead(LDR);
if (sensorLDR < 200)
{
led1.on();
}
else
{
led1.off();
}
}
/////////////////////////////////////////////////////////////////
void cek_moisture()
{
sensorMoisture = analogRead(Moisture);
if (sensorMoisture > 250)
{
led2.on();
sprinklerOn();
}
if (sensorMoisture < 250 && tes == 0)
{
led2.off();
sprinklerOff();
}
}
/////////////////////////////////////////////////////////////////
void cek_tombolf()
{
tombol = digitalRead(buttonPin);
if (tombol == HIGH)
{
sprinklerOn();
}
}
//===================Akhir Input Fisik========================//
//+++++++++++++++++++Manipulasi Output+++++++++++++++++++++++++//
void sprinklerOnTask()
{
led3.on();
digitalWrite(selenoid, HIGH);
digitalWrite(buzzer, LOW);
digitalWrite(biru, HIGH);
delay(2500);
}
void sprinklerOn()
{
led3.on();
digitalWrite(selenoid, HIGH);
digitalWrite(buzzer, LOW);
digitalWrite(biru, HIGH);
}
/////////////////////////////////////////////////////////////////
void sprinklerOff()
{
led3.off();
digitalWrite(buzzer, HIGH);
digitalWrite(biru, LOW);
digitalWrite(selenoid, LOW);
}
//===================Akhir Manipulasi Output========================//
Edited : It’s working right now, it’s my bad,i have ro use reading frequency to fast (500ms). and also maybe my internect conection not good to reach the server blynk, assuming with ping hit 4xxxms. so i will deploy local server to see maybe it will be more responcsive.