Project tutorial
MKR1000 Christmas IoTree with Cayenne Project Builder

MKR1000 Christmas IoTree with Cayenne Project Builder © GPL3+

Automate your Christmas tree and get notified when motion is detected around the tree!

  • 9 respects

Components and supplies

Abx00004 iso both
Arduino MKR1000
13285 01
PIR Motion Sensor (generic)
11026 02
Jumper wires (generic)
Relay (generic)
This is a really easy relay to use, plug and play!

Apps and online services

About this project


I wanted to automate various aspects of my Christmas tree, namely the lights. I also wanted to know if there is any activity around the tree. This could include someone peeking too early at a present, or even when Santa Claus arrives. I have an IP camera pointed at the Christmas tree so I can view the activity when motion is detected.

One MKR1000 is location on the Christmas tree (it looks like an ornament!) and the other MKR1000 is located on my office desk. The MKR1000 on my office desk will turn on an alarm light if motion is detected by my Christmas tree at home. I will also receive a text message when motion is detected.

I used the MKR1000 and Cayenne Scheduling to turn my Christmas tree lights on at sunrise and off at sunset.

I used an Arduino MKR1000 with Cayenne IoT Project Builder. Cayenne handled all of the automation, trigger events, scheduling, and text message notifications used in the project.

Here is an overview video I created:

Arduino MKR1000 Automating Christmas Tree Using Cayenne

Cayenne Web Dashboard:

Scheduling Christmas Lights

MKR1000 Triggers and Notifications

Christmas IoTree Setup:


MKR1000 Cayenne Sketch FileC/C++
This sketch file comes as an example when the Cayenne Arudino library is download. Just copy and paste the sketch file into the Arduino IDE and input user auth token along with WiFi credentials.
Cayenne MKR1000 Example

This sketch connects to the Cayenne server using an Arduino/Genuino MKR1000 and runs the main communication loop.

The Cayenne Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager.

1. Install the Arduino SAMD Boards from the Arduino Boards Manager if you have not done so already.
2. Install the WiFi101 library ( from the Arduino Library Manager if you have not done so already.
3. Select the Arduino/Genuino MKR1000 board and the correct port in the Arduino IDE.
4. Set the token variable to match the Arduino token from the Dashboard.
5. Set the network name and password.
6. Compile and upload this sketch.

For Cayenne Dashboard widgets using digital or analog pins this sketch will automatically
send data on those pins to the Cayenne server. If the widgets use Virtual Pins, data
should be sent to those pins using virtualWrites. Examples for sending and receiving
Virtual Pin data are under the Basics folder.

//#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <CayenneMKR1000.h>

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "AuthenticationToken";
// Your network name and password.
char ssid[] = "NetworkSSID";
char password[] = "NetworkPassword";

void setup()
	Cayenne.begin(token, ssid, password);

void loop()
Cayenne Arduino Library
You can download the Cayenne library for Arduino IDE here.


Similar projects you might like

Christmas Tree Water Level via Cayenne and MKR1000

Project showcase by Ian Zahn

  • 7 respects

Hackable Christmas Greeting Card

Project tutorial by Neoxelox

  • 4 respects

Home Automation with Arduino MKR1000 and Windows 10

Project tutorial by Ioannis Kydonis

  • 1 comment
  • 38 respects

Feel the Heat with Arduino and Cayenne

Project showcase by PauliusPlus

  • 25 respects

Home Control With Cayenne

by VinothKumar

  • 1 comment
  • 13 respects
Add projectSign up / Login