Soil Moisture sensor with Arduino in Tinkercad | how to use soil moisture sensor in Tinkercad Circuit diagram: Arduino Sketch: // C++ code // int moisture_data = 0; void setup() { pinMode(A0, INPUT); Serial.begin(9600); pinMode(12, OUTPUT); pinMode(6, OUTPUT); } void loop() { moisture_data = analogRead(A0); Serial.println(moisture_data); if (moisture_data < 21) { digitalWrite(12, HIGH); digitalWrite(6, HIGH); } else { digitalWrite(12, LOW); digitalWrite(6, LOW); } delay(10); // Delay a little bit to improve simulation performance }
IoT based Noise pollution monitoring using Blynk IoT platform | Final year ECE engineering project
Code:
/************************************************************************************
* My Channel:https://www.youtube.com/c/ImpulseTech/featured Visit for More Project Videos
*
* *********************************************************************************
* Preferences--> Aditional boards Manager URLs :
* For ESP32:
* https://dl.espressif.com/dl/package_esp32_index.json
* https://blynk.cloud/external/api/logEvent?token=YourAuthToken&code=hello for loging the events using rest API
* You can send only 100 events per devices per day
When the limit is reached you'll see the notification on the UI in the Device Timeline section
The maximum description length for the event is 300 chars
* *********************************************************************************/
#define BLYNK_TEMPLATE_ID "TMPLn9VfWrsx"
#define BLYNK_DEVICE_NAME "IoT based Noise Pollution Monitoring"
#define BLYNK_AUTH_TOKEN "CC9dmUb0HwvPIngt13G_KRj8xhqTV4oC"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
int sound_sensor=34;
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "impulsetech"; // type your wifi name
char pass[] = "impulse567"; // type your wifi password
BlynkTimer timer;
void sendSensor()
{
// Request temperature to all devices on the data line
int sound_value=analogRead(sound_sensor);
Serial.print("Sound sensor data: ");
Serial.print(sound_value);
delay(1000);
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V0, sound_value);
delay(500);
}
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
timer.setInterval(100L, sendSensor);
}
void loop()
{
Blynk.run();
timer.run();
}
Comments
Post a Comment
If you any query please comment