#define BLYNK_TEMPLATE_ID "TMPL6_9oCpk-h"
#define BLYNK_TEMPLATE_NAME "Water Filter"
#define BLYNK_AUTH_TOKEN "iCCQPUx4ziQcaSlLlguWETGeESorPvjx"
#include <OneWire.h>
#include <DallasTemperature.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#define BLYNK_PRINT Serial
#define ONE_WIRE_BUS 5
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
const int photoresistorPin = 15;
const int potPin = 34;
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
sensors.begin();
Blynk.begin(auth, ssid, pass);
}
void loop() {
// put your main code here, to run repeatedly:
Blynk.run();
sensors.requestTemperatures();
float temperatureC = sensors.getTempCByIndex(0);
int sensorValue = analogRead(photoresistorPin);
int potValue = analogRead(potPin);
Serial.print("Temperature Celcius: ");
Serial.print(temperatureC);
Serial.print("C");
Serial.print("Light intensity: ");
Serial.println(sensorValue);
Serial.print("Potentiometer Value: ");
Serial.println(potValue);
delay(1000); // this speeds up the simulation
}