Weather Monitoring System
hi guys, having kind of problem since new arduino. have project called weather monitoring system detects environmental condition using sensors dht11 , bmp180. want receive message contains data gathered sensors sim800l gsm module , cell phone know condition of weather. here progress/code:
code: [select]
#include <sim800l.h>
#include <softwareserial.h>
#include <dht.h>
#include <wire.h>
#include <sfe_bmp180.h>
#define sim800_tx_pin 11
#define sim800_rx_pin 10
#define dht11_pin 7
#define altitude 35 //altitude live (change altitude)
sfe_bmp180 pressure; //creating object
dht dht;
softwareserial serialsim800(11,10);
void setup() {
serial.begin(9600); //starting serial communication
while(!serial);
serialsim800.begin(9600);
delay(1000);
serial.println("setup complete!");
serial.println("sending sms....");
serialsim800.write("at+cmgf=1\r\n");
delay(1000);
serialsim800.write("at+cmgs=09359652262");
delay(1000);
serialsim800.write("test");
delay(1000);
serial.println("zeus");
if (pressure.begin()) //if initialization successful, continue
serial.println(" ");
else //else, stop code forever
{
serial.println("bmp180 init fail");
while (1);
}
}
void loop() {
int chk = dht.read11(dht11_pin);
char status;
double t, p, p0; //creating variables temp, pressure , relative pressure
serial.print("humidity= ");
serial.println(dht.humidity);
serial.print("temperature=");
serial.println(dht.temperature);
status = pressure.starttemperature();
if (status != 0) {
delay(status);
status = pressure.gettemperature(t);
if (status != 0) {
serial.print("temp: ");
serial.print(t, 1);
serial.println(" deg c");
status = pressure.startpressure(3);
if (status != 0) {
delay(status);
status = pressure.getpressure(p, t);
if (status != 0) {
serial.print("pressure measurement: ");
serial.print(p);
serial.println(" hpa ");
p0 = pressure.sealevel(p, altitude);
serial.print("relative pressure: ");
serial.print(p0);
serial.println("hpa");
}
}
}
}
delay(2000);
}
please read "how use forum" post, , post code properly, using code tags.
describe problem.
describe problem.
Arduino Forum > Using Arduino > Sensors > Weather Monitoring System
arduino
Comments
Post a Comment