I want to ask about my thesis

Jadi begini om om, saya pertama kali menngunakan IoT untuk Skripsi/Tugas Akhir saya. Saya memiliki kendala, dimana kendalanya program ini tidak mau membaca sensor. Jadi alat saya adalah Penyiram Tanaman Otomatis Berbasis IoT. menggunakan 3 sensor kelembaban, dan 1 sensor hujan. Output yang di inginkan yaitu melakukan penyiraman ketika tida terjadi hujan, dan sensor membaca kelembaban pada tanah dinyatakan layak untuk disiram.
dari logika program sudah saya coba, dan hasilnya sesuai kemauan saya. tetapi ketika saya masukan program untuk ke Blynk, di serial print tidak mau membaca nilai analog. apakah ada saran dari guru guru disini? saya sangat mohon, saya sangat butuh ini, karena masa kuliah saya sisa sebentar lagi.
Terimakasih :slight_smile:

So here's om om, I first used IoT for my Thesis / Final Project. I have a problem, where the problem is that this program does not want to read the sensor. So my tool is IoT Based Automatic Plant Sprinkler. uses 3 humidity sensors, and 1 rain sensor. The desired output is to do watering when there is no rain, and the sensor reads the moisture on the soil is declared suitable for watering. from the logic of the program I have tried, and the result is according to my will. but when I put the program to Blynk, in serial print it didn't want to read analog values. is there any suggestion from the teacher teacher here? I'm very beg, I really need this, because my college days are just around the corner.
Thanks :slight_smile:

</>
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
char auth[] = "JGiPCSkg36zOa8DDZpcE1cxxxxxxxxx";
char ssid[] = "PAKE LAH KALO DAK MALU";
char pass[] = "ingatumur";

void setup() {
Serial.begin (115200);
Blynk.begin(auth, ssid, pass);
}

void loop ()
{
Blynk.run();
}

void sendSensor()
{
//sensor hujan
const int pinHujan = 2;
int sensorHujan = analogRead(pinHujan);
Serial.print ("Tingkat Hujan =");
Serial.println (sensorHujan);
Blynk.virtualWrite(V2, pinHujan);

//sensor kelembaban 1
const int soilPin1 = 14;
int sensorKelembaban1 = analogRead(soilPin1);
Serial.print ("Tingkat Kelembaban 1 =");
Blynk.virtualWrite(V3, soilPin1);

//sensor kelembaban 2
const int soilPin2 = 27;
int sensorKelembaban2 = analogRead(soilPin2);
Serial.print ("Tingkat Kelembaban 2 =");
Blynk.virtualWrite(V4, soilPin2);

//sensor kelembaban 3
const int soilPin3 = 32;
int sensorKelembaban3 = analogRead(soilPin3);
Serial.print ("Tingkat Kelembaban 3 =");
Blynk.virtualWrite(V5, soilPin3);

//relay
int relayPompa = 18;
int relayValve1 = 19;
int relayValve2 = 21;
int relayValve3 = 23;

if (sensorHujan > 2000){
Serial.println ("TIDAK ADA HUJAN");
delay(1000);
if (sensorKelembaban1 >3500){
Serial.println ("TANAH POT 1 KERING");
digitalWrite(relayValve1,LOW);
digitalWrite(relayPompa,LOW);
Serial.println("POT 1 PROSES MENYIRAM");
}
else{
Serial.println("POT 1 TIDAK MENYIRAM");
digitalWrite(relayValve1, HIGH);
}
if (sensorKelembaban2 >3500){
Serial.println ("TANAH POT 2 KERING");
digitalWrite(relayValve2,LOW);
digitalWrite(relayPompa,LOW);
Serial.println("POT 2 PROSES MENYIRAM");
}
else{
Serial.println("POT 2 TIDAK MENYIRAM");
digitalWrite(relayValve2, HIGH);
}
if (sensorKelembaban3 >3500){
Serial.println ("TANAH POT 3 KERING");
digitalWrite(relayValve3,LOW);
digitalWrite(relayPompa,LOW);
Serial.println("POT 3 PROSES MENYIRAM");
}
else{
Serial.println("POT 3 TIDAK MENYIRAM");
digitalWrite(relayValve3, HIGH);
}
}
else{
Serial.println("TERJADI HUJAN, PENYIRAMAN DINONAKTIFKAN");
digitalWrite(relayPompa,HIGH);
delay(1000);
}
}
</>

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

When you posted your code without code tags did you receive a warning message ?

1 Like

I can't see where sendSensor gets called.

(I wouldn't put WiFi credentials in a forum post, if I were you)

Please remember to use code tags when posting code

1 Like

Hi, @ringgaadis
Welcome to the forum.

Did you write this code?

Can you please tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

1 Like

Don't you want to tell blynk about the reading, not the pin it came from?

1 Like

my first time posting. Sorry if I don't understand what you mean

Read the advice in the link about using code tags then follow it

Did you @ringgaadis read post #3 from the same day you started the thread?

You have all your code in a function sendSensor(), but you don't ever call it.

And post #5 on the same day by same member tells you that you are writing the number of soilPin2 (which is 27) to Blynk, not the reading at the pin which is analogRead(soilPin2) which you have already read into sensorKelembaban2. (And you do that same stuff for soilPin3). All academic of course, since they're in that function that you aren't calling.

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