Crystal House

Introduction: Crystal House

Couples and families who are separated due to long distance often feel the longing for connection. Crystal House is built for couples and families to connect with each other through lights. Crystal Houses are connected with wifi signals. When you press the button on one Crystal House, the other Crystal House’s lights receives the signal and will be turned on. It is easy and fun to make! I will be going through step by step from materials/tools used, building/testing circuit using Arduino and building the structure of the Crystal House

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Parts, Tools, Supplies

  • Assembled Feather Huzzah ESP8266 (two)
  • Perma-Proto Half-sized breadboard (two)
  • Lithium Battery -3.7 1200mAh (two)
  • Mini On/Off Push-Button Switch (four)
  • NeoPixel Mini Button (four)
  • Breadboard Wire
  • Soldering Iron & Solder
  • Wire stripper
  • Third Hand tool
  • Square wood stick
  • Acrylic sheet
  • Clear crystal stone
  • Transparent paper
  • Super glue

Step 2: Circuit Diagram and Code

// Instructables Internet of Things Class sample code
// Combining Inputs and Outputs // Two pushbuttons send commands to AIO feed // LED and vibrating motor (or any digital output) flah/buzz according to feed data // // 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. #include

  1. #define NeoPIN1 15

    // Parameter 1 = number of pixels in strip // Parameter 2 = Arduino pin number (most are valid) // Parameter 3 = pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) // NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) Adafruit_NeoPixel strip = Adafruit_NeoPixel(2, NeoPIN1, NEO_GRB + NEO_KHZ800);

    /************************ 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 "Your username" #define IO_KEY "Your IO_KEY"

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

    #define WIFI_SSID "Your wifi" #define WIFI_PASS "Your password"

    #include "AdafruitIO_WiFi.h" AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);

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

    #include #include #include #include

    //#define LED_PIN 15 #define BUTTON1_PIN 4 #define BUTTON2_PIN 14 //#define MOTOR_PIN 5 // this pin needs PWM capability

    // button state int button1current = 0; int button1last = 0; int button2current = 0; int button2last = 0;

    // set up the 'digital' feed AdafruitIO_Feed *command = io.feed("command"); AdafruitIO_Feed *command2 = io.feed("command2");

    void setup() { strip.setBrightness(60); strip.begin(); strip.show(); // Initialize all pixels to 'off' // set button pins as inputs with internal pull-up resistor pinMode(BUTTON1_PIN, INPUT_PULLUP); pinMode(BUTTON2_PIN, INPUT_PULLUP); // set led pin and motor pin as a digital outputs // pinMode(MOTOR_PIN, OUTPUT); // pinMode(LED_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(handleButton1); command2->onMessage(handleButton2);

    // wait for a connection while(io.status() < AIO_CONNECTED) { Serial.print("."); delay(500); }

    // we are connected Serial.println(); Serial.println(io.statusText());

    // make sure all feeds get their current values right away command->get(); command2->get(); }

    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){ button1current = 1; } if (digitalRead(BUTTON2_PIN) == LOW){ button2current = 1; } if (digitalRead(BUTTON2_PIN) == HIGH && digitalRead(BUTTON1_PIN) == HIGH){ button1current = 0; button2current = 0; }

    // return if the value hasn't changed if(button1current == button1last && button2current == button2last) return;

    // save the current state to the 'digital' feed on adafruit io Serial.print("sending button 1 status -> "); Serial.println(button1current); command->save(button1current);

    // save the current state to the 'digital' feed on adafruit io Serial.print("sending button 2 status -> "); Serial.println(button2current); command2->save(button2current);

    // store last button state button1last = button1current; button2last = button2current; }

    // 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 handleButton1(AdafruitIO_Data *data) {

    int command = data->toInt();

    if (command == 1){ //light up first pixel Serial.print("received from command (button 1) <- "); Serial.println(command); // analogWrite(MOTOR_PIN, 200); // delay(500); // analogWrite(MOTOR_PIN, 0); strip.setPixelColor(0, strip.Color(200, 100, 0 )); // Yellow strip.show(); } else { Serial.print("received from command (button 1) <- "); Serial.println(command); strip.setPixelColor(0, strip.Color(0, 0, 0)); // off strip.show(); } } // 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 handleButton2(AdafruitIO_Data *data) {

    int command2 = data->toInt();

    if (command2 == 1){ //light up first pixel Serial.print("received from command2 (button 2) <- "); Serial.println(command2); // analogWrite(MOTOR_PIN, 200); // delay(500); // analogWrite(MOTOR_PIN, 0); strip.setPixelColor(1, strip.Color(255, 128, 128)); // Yellow strip.show(); } else { Serial.print("received from command2 (button 2) <- "); Serial.println(command2); strip.setPixelColor(1, strip.Color(0, 0, 0)); // off strip.show(); } }

Step 3: Circuit Construction From Prototype to Soldered

I would encourage you to try on a breadboard to test the circuit. Since we are building two devices, we could test on two breadboard. I soldered the Neopixel and the on.off button to a prototyping wire since it is easier to use. Later on, you can easily solder the prototyping wires off.

After we succeed with the prototyping circuit, it is time to build our real circuit. I am using the Perma-proto breadboard since it is smaller and the connection of the circuit will be much better than the prototyping circuit. When it comes to solder, it requires a lot of patient. Don't give up yet! You are getting there!

Once you finish your circuit and uploaded the code into your ESP8266, the two devices should work as we mentioned in the beginning.

Step 4: Form & Material

Now let's make our Crystal House!

Cut the wood stick into 6 inches. We need 18 pieces in total. Since I want some variation from these two crystal house, I used 7 pieces in one and 9 pieces in the other one. Glue the pieces in to a box structure. I cut two acrylic sheet to 6 by 6 inches and glued them into the bottom of the Crystal Houses.

Once you finish the structure of the houses. Let's decorate the houses! I cut a piece of transparent colored paper and glued them onto the acrylic sheet. After that, I used some clear plastic crystals and glued them onto the base. Since I have a transparent colored paper at the bottom of the crystals, the crystals are reflected to different colors.

Step 5: Now Let's Use the Crystal Houses

Give your beloved one the crystal house you made. Tell them that they are important! You can always modify the outside structure using different materials and colors. Let me know how it goes!

Be the First to Share

    Recommendations

    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    Discussions

    0
    seamster
    seamster

    6 weeks ago

    Clever idea!