details
Gas, Smoke, Temperature and Humidity With Cayenne
This project is an example of Ethernet shield.
User can monitor sensors easily by using Arduino platform through Web.
This project would be included in Sensing & Gathering category of WIZnet Museum.
Hardware components:
-. Arduino Mega 2560
-. W5100 Ethernet shield
-. DHT22 Temperature Sensor
-. MQ2 Gas Sensor
Software apps and online services:
-. Arduino IDE
-. Cayenne
Schematics
Code
#include "CayenneEthernet.h" #include "DHT.h" #define DHTPIN 22 #define DHTTYPE DHT22 DHT dht(DHTPIN, DHTTYPE); char token[] = ""; //fill with your token const int MQ2 = A0; void setup() { Serial.begin(115200); Cayenne.begin(token); dht.begin(); } void loop() { Cayenne.run(); } CAYENNE_OUT(V0) { float t = dht.readTemperature(); Cayenne.virtualWrite(V0, t); //virtual pin } CAYENNE_OUT(V1) { float h = dht.readHumidity(); Cayenne.virtualWrite(V1, h); //virtual pin } CAYENNE_OUT(V2) { Cayenne.virtualWrite(V2, MQ2); }
If you want to know more in detail, refer to
Source : https://www.hackster.io/sinchan0009/gas-smoke-temperature-and-humidity-with-cayenne-4b96df?ref=part&ref_id=20268&offset=53какой лучше взять автокредит
COMMENTS