Introduction: Particle Photon: Internet Button (Notification Lamp)

Picture of Particle Photon: Internet Button (Notification Lamp)

A Particle Photon is a really cool micro-controller to get started with IoT, programming the photon is similar to that of an arduino. With a few extra functions that give it access to the Particle Cloud. The functions can be called using online APIs accessible from the Particle Cloud. The particle photon comes with various shields and one popular shield is the Internet Button, this is a shield with 11 RGB LEDs, 4 Buttons and a Buzzer that can add various features to your project.

In today's instructable I'm going to show you how to work with the Particle Photon and the Internet Button, to make a Lamp that notifies you each time you receive and android notification. You can also customize it notify you of various other things such as email, twitter feed, etc

Step 1: Materials and Components

Picture of Materials and Components

To start of with here is a list of all the components required to get started with the project, you don't have to make separate purchases as all of the below parts is included when you purchase an Internet Button, that also includes the Particle Photon.

  • Particle Photon
  • Internet Button
  • Micro USB Cable

With the addition to the above tools you will need a PC to program the photon on and an active internet connection (over WiFi).

Step 2: Circuit

Picture of Circuit

There is not much of a circuit for this project all you need to do is plug the photon on the Internet Button. If you recently purchased the Internet Button you are most likely to have the newer model with an on board Buzzer. If you purchased it some time ago (like I did), you will have an older model that doesn't have a buzzer on board.

It is necessary to know which of the two models you are using because the code varies a bit, for the two models.

Step 3: Connecting Photon to the Internet

Picture of Connecting Photon to the Internet

A first time setup requires you to connect the photon to the internet and claim it or link it to your account. This process is really simple all you need to do is download the particle app from the android play store or the IOS app from the apple store.

You need to login into your account in the app and then follow the onscreen steps to claim your photon. Make sure your photon is powered on this whole procedure and your phone is connected to the same WiFi network you want your photon to be connected to.

After claiming your photon, it should be breathing cyan, indicating a successful connection to the particle cloud.

Step 4: Web IDE (Uploading Code)

Picture of Web IDE (Uploading Code)

Next, visit open the Particle web IDE, copy and paste the code below. If you are using the newer model of the Internet button upload the code as it is, but if you are using the older model of the Internet button (without the on board buzzer) change the line of code to this

b.begin(1);

Code

#include "InternetButton/InternetButton.h"

InternetButton b = InternetButton();

void setup() {
b.begin(); Spark.function("setColor", setColor); }

void loop(){ } int setColor(String null) { b.allLedsOn(0,100,100); delay(10000); b.allLedsOff(); return 0; }

Step 5: IFTTT

Picture of IFTTT

Now time to setup your IFTTT to turn on the LEDs of the Internet Button each time you receive an android notification.

You first need to install the IFTTT app on you android phone, next you need to create an account and then login. After successful login you should see the option to create a new recipe.

  1. For the if part of the statement select the android sms and then select, each time a new sms is received.
  2. For the then part select the particle, it will ask you to login to the particle account.
  3. Then select Call a Function and select the function setColor.
  4. Create Recipe

Step 6: Finishing

Picture of Finishing

After completing all of the previous steps it is now time to test your project, now send an sms to the phone with the IFTTT app and you should see the Internet Button light all the LEDs for about 10 seconds. You can modify the code or the IFTTT statement to your will and trigger various different events.

Comments

About This Instructable

2,762views

50favorites

License:

More by go_cool:Particle Photon: Pulse Sensor Particle Photon: Internet Button (Notification Lamp)Arduino 8x8 LED Matrix
Add instructable to: