Bonjour tout le monde! donc voila jai un projet arduino plutôt complexe. je vous explique, je suis en trin de réalisé un projet arduino pour géré automatiquement un terrarium. De ce fait jai déja commencé le code avec une sonde de température étanche (le DS18B20) pour le point chaud et une autre sonde pour la T°C et l'hygrométrie général du terrarium (le DHT22). Le tout et noté sur un écran lcd avec un système de relais pour allumé ou éteindre le ventilateur et la lampe chauffante en fonction de la température (remplacé par des led pour l'instant).
Voici mon problème : Je voudrais la même chose annoté sur le lcd mais sur mon smartphone via un module esp8266 pour voir si tous va bien depuis toute la france. le souci c'est que je vois pas comment procédé pour le code et l'application mobile.
Un coup de main serais la bienvenue.
Je vous donne mon code actuel et une photo du montage pour y voir plus claire.
https://www.facebook.com/photo.php?fbid=2009595249062438&set=a.2009595005729129&type=3&theater
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
#include "DHT.h"
#define DHTPIN 7
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
int LedvertPin = 9;
int LedbleuPin = 10;
int LedrougePin = 8;
int temp_sensor = 13;
float temperature = 0;
int lowerLimit = 15;
int higherLimit = 25;
OneWire oneWirePin(temp_sensor);
DallasTemperature sensors(&oneWirePin);
void setup(void){
lcd.begin(16,2);
Serial.begin(9600);
//Setup the LEDS to act as outputs
pinMode(LedrougePin,OUTPUT);
pinMode(LedvertPin,OUTPUT);
pinMode(LedbleuPin,OUTPUT);
dht.begin();
sensors.begin();
}
void loop(){
delay(1000);
Serial.print("Initialisation de la sonde 1: ");
sensors.requestTemperatures();
Serial.println("OK");
temperature = sensors.getTempCByIndex(0);
digitalWrite(LedrougePin, LOW);
digitalWrite(LedvertPin, LOW);
digitalWrite(LedbleuPin, LOW);
Serial.print("T°C ");
Serial.print(temperature);
lcd.setCursor(0,0);
lcd.print("Sonde 1 : ");
lcd.print(temperature);
lcd.print(" C");
//Setup the LEDS to act as outputs
if(temperature <= lowerLimit){
lcd.setCursor(0,1);
lcd.print("Attention ! ");
Serial.println(", LED Bleu Activé");
digitalWrite(LedbleuPin, HIGH); }
else if(temperature > lowerLimit && temperature < higherLimit){
lcd.setCursor(0,1);
lcd.print("Tout va bien ! ");
Serial.println(", LED vert Activé");
digitalWrite(LedvertPin, HIGH);
}
else if(temperature >= higherLimit){
lcd.setCursor(0,1);
lcd.print("Attention ! ");
Serial.println(", LED rouge Activé");
digitalWrite(LedrougePin, HIGH);
}
delay(5000);
{
float h = dht.readHumidity();
float t = dht.readTemperature();
float f = dht.readTemperature(true);
if (isnan(h) || isnan(t) || isnan(f))
{
Serial.println("Failed to read from DHT sensor!");
return;
}
lcd.setCursor(0,0);
lcd.print("Hygro. : ");
lcd.print(h);
lcd.print(" % ");
lcd.setCursor(0,1);
lcd.print("Sonde 2 : ");
lcd.print(t);
lcd.print(" C ");
delay(5000);
}
}