Introduction: Home Devices Control System With Cayanne

This project is about controlling home devices through cayenne and Arduino. It is very easy to connect your devices with internet through Cayenne IOT solutions. I am very happy to post my first project using this amazing and unique service.In home devices control system, I have used two devices to control through internet by using Cayenne IOT server and trust me I completed this task in 5 minutes which in past took me more than 15 days to connect arduino with internet. So it makes my life so easy. Now I can connect my devices with internet with in minutes.

Home devices control system using Cayenne This project is about controlling home devices through cayenne and Arduino. It is very easy to connect your devices with internet through Cayenne IOT solutions. I am very happy to post my first project using this amazing and unique service.In home devices control system, I have used two devices to control through internet by using Cayenne IOT server and trust me I completed this task in 5 minutes which in past took me more than 15 days to connect arduino with internet. So it makes my life so easy. Now I can connect my devices with internet with in minutes.user can simply press on and off button to turn and turn off device which is interfaced through and it is very easy to interface relay with Arduino

Project video:

https://www.youtube.com/watch?v=nszvI7JlFho

Code of project

#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
// If you're not using the Ethernet W5100 shield, change this to match your connection type. See Communications examples. #include

#define VIRTUAL_PIN1 1 #define VIRTUAL_PIN2 2 #define RELAY_DIGITAL_PIN1 4 #define RELAY_DIGITAL_PIN2 5 // Cayenne authentication token. This should be obtained from the Cayenne Dashboard. char token[] = "kcqd0oywxa";

void setup() { // set digital pin to output pinMode(RELAY_DIGITAL_PIN1, OUTPUT); pinMode(RELAY_DIGITAL_PIN2, OUTPUT);

Serial.begin(9600); Cayenne.begin(token); }

CAYENNE_IN(VIRTUAL_PIN1) { // get value sent from dashboard int currentValue = getValue.asInt(); // 0 to 1

// assuming you wire your relay as normally open if (currentValue == 1) { digitalWrite(RELAY_DIGITAL_PIN1, HIGH); } else { digitalWrite(RELAY_DIGITAL_PIN1, LOW); } } CAYENNE_IN(VIRTUAL_PIN2) { // get value sent from dashboard int currentValue = getValue.asInt(); // 0 to 1

// assuming you wire your relay as normally open if (currentValue == 1) { digitalWrite(RELAY_DIGITAL_PIN2, HIGH); } else { digitalWrite(RELAY_DIGITAL_PIN2, LOW); } }

void loop() { Cayenne.run(); }