Project tutorial
Controlling a Philips Hue via a Arduino

Controlling a Philips Hue via a Arduino © GPL3+

Turn on/off a Philips Hue LED via a push button attached to a Arduino.

  • 11,953 views
  • 2 comments
  • 9 respects

Components and supplies

About this project

This is an introductory project for students to learn about IoT. Our site, iotSky provides coursework and cloud infrastructure to experiment with connected devices.

With this experiment, students can control a Philips Hue LED by pushing a button connected to a Arduino Yun. When the button is pressed, a message is published on a topic. The broker in the cloud receives it and forwards it to a subscriber listening on the same topic. That subscriber then checks the status of the Philips Hue LED and then toggles it.

Instructions:

  • Before you start you should have your arduino (loaded with the micro sd card) connected to your computer and ready to go
  • Create a basic project on iotSky. (For this exercise, you do not need any plugins)
  • Assuming your Micro SD Card is mounted on /mnt/sda1 create a directory called ex_2.
mkdir /mnt/sda1/arduino/ex_2
  • Click the 'Cert' button and 'Private Key' button on the project details page to show their values. These need to be copied onto the Micro SD Card. You can do this like:
scp hue_me_on_cert.pem root@linino.local:/mnt/sda1/arduino/ex_2 
scp hue_me_on_private_key.pem root@linino.local:/mnt/sda1/arduino/ex_2
  • Copy the root aws cert from here, onto the root arduino directory on the SD card. i.e. it should have a file called /mnt/sda1/arduino/rootaws_cert.pem
  • Assemble the circuit as shown in the Fritzing diagram
  • Set up the Philips Hue bridge by using their getting started guide. At the end of this your should have a authorized username
  • Open the Arduino IDE and create a new sketch. Copy the sketch_hue_me_on.ino and aws_iot_config.h files from github. Edit the publish topic to match your own
  • Download this sketch onto the Arduino Yun board
  • Download the sample subscribe program. Edit the authorized username to be the one you got in step 7.
  • When you press the pushbutton, you should see the Philips Hue LED turn on. If you press it again, it will turn off

More details on our catalog page for this exercise.

Code

Control a Philips Hue LED via Arduino Hue

Schematics

fritzing diagram
Jo8wtcdmao27o1nobhob

Comments

Similar projects you might like

Arduino with NeoPixel Optocouplers Controlling Many Relays

Project tutorial by Pedro52

  • 9,118 views
  • 10 comments
  • 46 respects

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 49,295 views
  • 22 comments
  • 141 respects

Control Arduino Uno Using ESP8266 WiFi Module and Blynk App

Project tutorial by Adithya TG

  • 48,918 views
  • 14 comments
  • 46 respects

Ultrasonic Sensor with Alarm, LCD and Temperature

Project tutorial by MichDragstar

  • 12,142 views
  • 7 comments
  • 26 respects

Amazon Dash Button for Arduino!

Project tutorial by Brian Carbonette

  • 10,977 views
  • 4 comments
  • 23 respects

Pet Feeder

Project tutorial by Namsulee

  • 6,679 views
  • 0 comments
  • 16 respects
Add projectSign up / Login