Arduino (IoT): Proyecto Monitor Remoto de Temp y Humedad Cafe Honduras

Arduino Honduras Santiapps Marcio Valenzuela

Tutorial Monitor Remoto de Cafe

En este proyecto construimos un monitor de temperatura y humedad para monitorear las condiciones en una bodega de cafe.

Arduino IoT Proyecto Monitor Remoto Temperatura Humedad Cafe Honduras by Santiapps Marcio Valenzuela
Arduino IoT Proyecto Monitor Remoto Temperatura Humedad Cafe Honduras

Requisitos:

  1. Computadora (mac)
  2. Arduino Nano
  3. DHT11
  4. Modulo SIM900 GSM
  5. Breadboard
  6. Arduino IDE (https://www.arduino.cc/en/Main/Software)

El código (SIM900NanoW_OLibrary):

#include <Time.h>
#include <TimeLib.h>
#include <SoftwareSerial.h>
#include <TimeAlarms.h>
#include <dht.h>

dht DHT;
#define DHT11_PIN 5
char number[]="+504numero";
boolean started=false;
SoftwareSerial sim900(9,10);

void setup(){
Serial.begin(9600);
Alarm.timerRepeat(21600, MainAlarm); //21600s/60s/m=360m
}

void loop(){
Alarm.delay(10); // wait one second between clock display
}

void MainAlarm(){
Serial.println("Main Alarm...");
int chk = DHT.read11(DHT11_PIN);
Serial.print("Temperature = ");
double temp = DHT.temperature;
Serial.println(DHT.temperature);
Serial.print("Humidity = ");
double hum = DHT.humidity;
Serial.println(DHT.humidity);
sendData(temp,hum);
}

void sendData(double temp, double hum){
sim900.begin(9600); //Default serial port setting for the GPRS modem is 19200bps 8-N-1

static char outTempStr[15];
static char outHumStr[15];
String tempString = dtostrf(temp,5,2,outTempStr);
String humString = dtostrf(hum,5,2,outHumStr);

delay(10000);
sim900.print("\r");
delay(1000); //Wait for a second while the modem sends an "OK"
sim900.print("AT+CMGF=1\r"); //text mode
delay(1000);
sim900.print("AT+CMGS=\"+504numero\"\r");
delay(1000);
sim900.print("Temp=" + tempString +  "Hum=" + humString); //The text for the message
sim900.print("\r"); //EOL message
delay(1000);
sim900.write(0x1A); //Equivalent to sending Ctrl+Z
}


Asi podemos reportar las condiciones de manera constante.  Podríamos agregar una fuente solar recargable de poder.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s