Can you help me in my code using these material, i need automatic send call if dht11 reach the 40 degree celsius the sim800l v2 automatic send call in my phone number
What code? Please show your code
this is my code
// Libraries
#include <DHT.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display
// Constants
#define DHTPIN A3 // what pin we're connected to
#define DHTTYPE DHT11 // DHT 11
#define BUZZER_PIN 9 // Pin connected to the buzzer
#define TEMP_LIMIT 40 // New temperature limit (adjust as needed)
DHT dht(DHTPIN, DHTTYPE); // Initialize DHT sensor for normal 16mhz Arduino
// Variables
int h; // Stores humidity value
int t; // Stores temperature value
void setup() {
Serial.begin(9600);
Serial.println("Temperature and Humidity Sensor Test");
dht.begin();
lcd.init(); // Initialize the lcd
lcd.backlight(); // Open the backlight
pinMode(BUZZER_PIN, OUTPUT); // Set buzzer pin as output
}
void loop() {
// Read data and store it to variables h (humidity) and t (temperature)
h = dht.readHumidity();
t = dht.readTemperature();
// Print temp and humidity values to serial monitor
Serial.print("Humidity: ");
Serial.print(h);
Serial.print(" %, Temp: ");
Serial.print(t);
Serial.println(" ° Celsius");
// Set the cursor to (0,0) and print
lcd.setCursor(0, 0);
lcd.println(" TEMP AND HUMI ");
lcd.setCursor(0, 1);
lcd.print(" T:");
lcd.print(t);
lcd.print("C");
lcd.setCursor(11, 1);
lcd.print("H:");
lcd.print(h);
lcd.print("%");
// Check temperature against the limit
if (t > TEMP_LIMIT) {
digitalWrite(BUZZER_PIN, HIGH); // Turn buzzer on
} else {
digitalWrite(BUZZER_PIN, LOW); // Turn buzzer off
}
delay(100);
}
I don't have code in sim800l v2 that's why I need your help. Thanks
Duplicate topic, same subject.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.