Introduction: 千思万绪

This project is made by Zhenxuan and Bi, which we have named it as 千思万绪. This lamp was

designed for the couple who might not live together yet or long-distance relationships. They would have each have a light and the remote which could control each other’s light.

Sometimes in a relationship, you will be kept thinking what is he/she doing right now, did he/ she eat or some kind of questions around in your mind. Or when we don’t have something worth to discuss but we want to communicate with each other. That’s why this lamp came out to address these issues between the couples with the emotional lamp to tell your feeling to your partner. For instance, when you feel sad, annoyed or happy, but words is not enough to reflect how your feeling now or negative impact reflect on your love. For that moment, turning on the light is assisting you to send a silent message that you want her/ him to know you miss him/ her, need comfort or what are you doing to your partner.

The lamp would be separated two-part to different places because the switch will put it in your partner’s home. Therefore, each of them can control each light to tell their needs without direct language. Also, the would-be installed on the ceiling at each home and the remote would be portable so that people could carry it or put it everywhere at home.

Step 1: Prepare These Material to Build This Lamp

1.plastic ball

2.fish line

3.glue gun

4.5v 4a switching power supply

5.arduino board

6.plastic tube

7.wire cutter

8.soldering wire

9.drill

10.wood box

11.acrylic board

12.paper box

Step 2: Installation

Using a drill to make three holes in the opening of the plastic ball

Use the fishing line to go through the previous three holes, and adjust the length of the three fishing lines so that the ball can maintain balance when suspended in the air.

Prepare an acrylic board and laser cut a circle with a diameter of 6’’ and a of 3” cycles.

Correspond to the holes of the plastic ball and make three holes in the acrylic disc.

Cut a small piece of plastic tube and add glue as a fixed line.

Cut out different examples of three-section plastic tubes and put them on the led lights to hide the welded wires.

Next, drill a hole in the center of small cycle. The size of the hole depends on the size of all the wires tied to one.

When these basic entities are done, start writing code

Step 3: Coding + Circuit

/ Modified by Becky Stern 2017

// based on examples from Adafruit IO Arduino Library:

// https://github.com/adafruit/Adafruit_IO_Arduino

/

/ Adafruit invests time and resources providing this open source code.

// Please support Adafruit and open source hardware by purchasing

// products from Adafruit!

/

/ Written by Todd Treece for Adafruit Industries

// Copyright (c) 2016 Adafruit Industries

// Licensed under the MIT license.

/

/ All text above must be included in any redistribution.

/************************ Adafruit IO Configuration *******************************

/ visit io.adafruit.com if you need to create an account,

// or if you need your Adafruit IO key.

#define IO_USERNAME "zwang27"

#define IO_KEY "018fb55d4e004224be4f50ca7f182d68"

/******************************* WIFI Configuration **************************************/

#define WIFI_SSID "MFA PoD"

#define WIFI_PASS "il0vedesign"

#include "AdafruitIO_WiFi.h"

AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);

/************************ Main Code Starts Here *******************************/

#include

#include

#include

#include

#define LED1_PIN 13

#define LED2_PIN 15

#define LED3_PIN 5

#define BUTTON1_PIN 14

#define BUTTON2_PIN 2

#define BUTTON3_PIN 4

// button state

int current = 0;

int last = 0;

// set up the 'digital' feed

AdafruitIO_Feed *command = io.feed("command");

void setup() {

// set button pins as inputs with internal pull-up resistor

pinMode(BUTTON1_PIN, INPUT_PULLUP);

pinMode(BUTTON2_PIN, INPUT_PULLUP);

pinMode(BUTTON3_PIN, INPUT_PULLUP);

// set led pin as a digital outputs

pinMode(LED1_PIN, OUTPUT);

pinMode(LED2_PIN, OUTPUT);

pinMode(LED3_PIN, OUTPUT);

// start the serial connection

Serial.begin(115200);

// connect to io.adafruit.com

Serial.print("Connecting to Adafruit IO");

io.connect();

// set up a message handler for the 'command' feed.

// the handleMessage function (defined below)

// will be called whenever a message is

// received from adafruit io.

command->onMessage(handleMessage);

// wait for a connection

while(io.status() < AIO_CONNECTED) {

Serial.print(".");

delay(500);

}

// we are connected

Serial.println();

Serial.println(io.statusText());

}

void loop() {

// io.run(); is required for all sketches.

// it should always be present at the top of your loop

// function. it keeps the client connected to

// io.adafruit.com, and processes any incoming data.

io.run();

// grab the current state of the button.

// we have to flip the logic because we are

// using INPUT_PULLUP.

if(digitalRead(BUTTON1_PIN) == LOW)

current = 1;

if (digitalRead(BUTTON2_PIN) == LOW)

current = 2;

if (digitalRead(BUTTON3_PIN) == LOW)

current = 3;

// return if the value hasn't changed

if(current == last)

return;

// save the current state to the 'digital' feed on adafruit io

Serial.print("sending button -> ");

Serial.println(current);

command->save(current);

// store last button state

last = current;

}

// this function is called whenever a 'command' message

// is received from Adafruit IO. it was attached to

// the command feed in the setup() function above.

void handleMessage(AdafruitIO_Data *data) {

int command = data->toInt();

if (command == 1){

Serial.print("received <- ");

Serial.println(command);

digitalWrite(LED1_PIN, HIGH);

delay(3000);

digitalWrite(LED1_PIN, LOW);

} else if (command == 2) {

Serial.print("received <- ");

Serial.println(command);

digitalWrite(LED2_PIN, HIGH);

delay(3000);

digitalWrite(LED2_PIN, LOW);

} else if (command == 3) {

Serial.print("received <- ");

Serial.println(command);

digitalWrite(LED3_PIN, HIGH);

delay(3000);

digitalWrite(LED3_PIN, LOW);

} else {

Serial.print("received <- ");

Serial.println(command);

}

}