LinkIt One - Mood Lamp

by ThisIsSteve in Circuits > Microcontrollers

745 Views, 4 Favorites, 0 Comments

LinkIt One - Mood Lamp

FMV2TWRHVXC13DQ.jpg
F03W5DQHVXC14HC.jpg
IMG_20151103_222856.jpg
155.jpg
144.jpg

In the last instructable I showed you how to monitor your room temperature online with the help of the LinkIt One board. Now in this tutorial I would show you how to make a internet controlled mood lamp, that monitors your temperature and lets you know when your internet is down.

This is the upgrade to a previous instructable that I assembled using an Arduino but this has a lot IoT features add to it. This instructable uses the Blynk app which is a popular IoT control app and it works great with the Linkit One. The Blynk app is available for Android and iPhone devices.

Components

2.jpg

As always lets start with getting all the components required.

Components

  • LinkIt One
  • RBG LED (or Individual red, blue, green LEDs)
  • Bluetooth Module (I used HC-05)
  • Li-ion Battery
  • An old bulb
  • Plywood

Circuit

199.jpg
IMG_20151103_222728.jpg
IMG_20151103_222910.jpg

The circuit is very simple, all the connections you have to do is the RGB LED. The RBG LED that I'm using is a common anode LED and if you are using a common cathode make sure to connect cathode to the ground pin. The connections goes as follows -

  • LED anode terminal to +3.3V of the LinkIt One
  • LED red terminal to Digital Pin 3 of the LinkIt One
  • LED green terminal to Digital Pin 4 of the LinkIt One
  • LED blue terminal to of the LinkIt One

Code

After you complete the circuit, now it is time to upload the code to the LinkIt One. You can upload the code found below in the arduino IDE and make sure you enter your WiFi SSID and password in the field where it says SSID and password. Upload the code to the suitable Com port.

#define ARDUINO 150

#include

#include

#include

// You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "ACCESS TOKEN";

#define WIFI_AP "SSID" #define WIFI_PASSWORD "PASSWORD" #define WIFI_AUTH LWIFI_WPA // choose from LWIFI_OPEN, LWIFI_WPA, or LWIFI_WEP according to your WiFi AP configuration int tempPin = A0; float temp; void setup() {

Serial.begin(9600);

Blynk.begin(auth, WIFI_AP, WIFI_PASSWORD, WIFI_AUTH);

Serial.println("System start!");

}

uint16_t loop_id=0;

void loop() {

loop_id++;

Serial.println(loop_id);

Blynk.run();

temp = analogRead(tempPin); temp = temp * 0.09765625 *5; // costance (1/1024*100) Blynk.virtualWrite(10, temp); delay(500); }

BLYNK_READ(0) {

Serial.println("Blynk comes to read!");

Blynk.virtualWrite(0, loop_id);

}

Blynk App

Screenshot_20151103-223006.png
Screenshot_20151103-223039.png

After uploading the code it is now time to test it and to do that we require the Blynk app you can install the app on your smart phone and register for an account later you need to create a new app and select linkit one as the board update the code with the access token.

Then load in the zebra element and select digital pin 3 for red pin4 for blue and pin 5 for green. Then all you need is to power on the LinkIt One board and run the project. Now as you move the pointer the color of the LED changes with respect to the pointer.

The Wooden Box

133.jpg
111.jpg
122.jpg

You see the pics you would probably realize that I'm not so good at woodworking. I tried working with plywood and finally I got this. So I'm not good at instructing it either you may need someone help with this or watch some YouTube videos like I did.

Light Bulb

100.jpg
188.jpg

I did not want to leave it at just plane old LEDs, that's when I had an idea of lighting a bulb with it. So all you need is a fused bulb and you have to remove the holder by using a cutter. There are plenty of YouTube videos that demonstrate how to do this.

Finishing

66.jpg
Screenshot_20151103-223011.png

By this stage you should have a working mood lamp which looks like the picture. So you may want to add the notify element in the Blynk app which notifies you when your lamp can not connect to the internet (that's when your WiFi is down). Hope you liked this instructable, if you make your own don't forget to use the IMadeIt button.