Project tutorial
IOT Lighted Xmas Tree

IOT Lighted Xmas Tree © CC BY-NC

Do you want to conserve energy and turn the Christmas tree lights on/off when not required? In IOT era, that can be done using MKR1000.

  • 874 views
  • 0 comments
  • 2 respects

Components and supplies

Apps and online services

About this project

This project uses MKR1000 as a REST API server with the help of MKR1000RESTServer library. When POST method on the API is called, it initiates the relay pin in OUTPUT mode. When PUT method is called, the pin is set HIGH/LOW based on the value of the parameter. Effectively it turns the lights on/off.

API

The API on the server can be called using tools such as Postman or using the app source code that is supplied.

Steps:

  • Connect the relay and the lights
  • Start Arduino IDE
  • Click Sketch Menu -> Include Library -> Add .zip library
  • Choose the downloaded library
  • Open the solution
  • Update your SSID name and password
  • Start the serial port monitor
  • Build and upload the sketch to the MKR1000. It will print the IP address on the monitor. (e.g 192.168.0.13)

Using the App

To control the lights using the app (iOS, Android, Windows (UWP) platform).

  • Download Visual Studio 2015 Community Edition.
  • Install the necessary Xamarin Forms extensions.
  • Run the app on the connected device.
  • Enter the IP address
  • Click "Start". This will return message box with results.
  • Switch the light on/off.

Using Postman

If you want to control the lights using Postman, here are the steps:

  • Select the POST verb and enter address as http://192.168.0.13/Pin3/
  • Click send. This will initiate the pin.
  • Select PUT verb and enter address as http://192.168.0.13/Pin3/on/
  • Click send. This will turn the lights on.
  • Select PUT verb and enter address as http://192.168.0.13/Pin3/off/
  • Click send. This will turn the lights off.

Code

Code for both Sketch and the App

Schematics

Schematics
Schematics
iotxmastree_7GuDkKIy0y.fzz
breadboard
breadboard
Breadboard v3wdxz3z6m

Comments

Similar projects you might like

LED Straw XMAS Tree

Project showcase by Auri Botines

  • 2,365 views
  • 1 comment
  • 9 respects

IoT Blink - Getting started with IoT

Project showcase by AppShed Support

  • 2,026 views
  • 0 comments
  • 11 respects

IoT Christmas Tree Topper

Project tutorial by Balázs Simon

  • 1,559 views
  • 0 comments
  • 9 respects

OH HAI! on Windows 10 IoT Core

Project in progress by BuddyC

  • 12,748 views
  • 3 comments
  • 48 respects

SmartQ Notification with Azure IOT Hub and Virtual Shields

Project showcase by vincent wong

  • 1,728 views
  • 0 comments
  • 6 respects
Add projectSign up / Login