---
title: "Home devices control system with cayanne"
url: "https://maker.wiznet.io/WIZnet/projects/home-devices-control-system-with-cayanne/"
markdown_url: "https://maker.wiznet.io/WIZnet/projects/home-devices-control-system-with-cayanne/md"
type: "UCC: User Created Content"
author: "WIZnet"
author_url: "https://maker.wiznet.io/WIZnet/"
original_url: "https://www.hackster.io/bilal-malik/home-devices-control-system-with-cayenne-c29ca9"
published: "2023-02-09"
language: "en"
likes: 4
views: 453
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Home devices control system with cayanne

> .

Original source: https://www.hackster.io/bilal-malik/home-devices-control-system-with-cayenne-c29ca9

## Article

**DETAILS**

Home devices control system with cayanne

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.

Hardware components:

-. Arduino UNO & Genuino UNO

-. Arduino Ethernet Shield

-. Arduino Leonardo

-. Relay (generic)

Software apps and online services:

-. Cayenne

## **Story**

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 the Arduino with internet. So it makes my life so easy. Now I can connect my devices with internet within 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](http://microcontrollerslab.com/relay-module-interfacing-arduino-arduino/)with Arduino

**Code:**

```
#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 <CayenneEthernet.h>

#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();
}
```

If you want to know more in detail, refer to

Source : <https://www.hackster.io/bilal-malik/home-devices-control-system-with-cayanne-c29ca9>[рубли онлайн займ](http://mirziamov.ru/zaym-onlayn/)

---

Source: https://maker.wiznet.io/WIZnet/projects/home-devices-control-system-with-cayanne/
