Introduction: Automated Fiber-Optic Christmas Tree + (bluetooth, Timer, Brighter)

In this instructable I'll show you how to upgrade a simple Christmas tree stand to include an on/off timer, bluetooth and make it brighter.

Step 1: Bill of Materials

Step 2: Rewire the Tree Stand

Take the positive wire coming from the switch and splice the relay in between it and the power input. This allows the relay to control power to the bulb.

Step 3: Wire the Components

The script for the funduino has the breakdown for connecting each component together.

Step 4: Upgraded Bulb

Depending on the tree you have you may be able to upgrade the bulb with an LED bulb. I did and tripled the brightness which made a huge difference.

Step 5: The Program

First thing to do is set the RTC clock. Use the instruction in the link https://www.virtuabotix.com/virtuabotix-ds1302-rea...

Next add the main code. I currently have it set to turn on at 5 pm and turn off at 10pm but you can easily change that. Also one thing to note, I used a bluetooth serial keyboard app that you can get for any android phone and set the letter 'a' for on and 'b' for off.

#include //|
// Creation of the Real Time Clock Object // Pin Layout: SCLK -> 6, I/O -> 7, CE -> 8, gnd -> gnd, Vcc -> 3.3V virtuabotixRTC myRTC(6, 7, 8); // Set the current date, and time in the following format: // seconds, minutes, hours, day of the week, day of the month, month, year //myRTC.setDS1302Time(00, 45, 20, 2, 23, 11, 2015);

// Setup for Bluetooth // Pin Layout:gnd -> gnd, Vcc -> 5V, TXD-> RXD char Bluetooth_Input; // Bluetooth Variable

//Setup for Relay // Pin Layout: gnd -> gnd, Vcc -> 3.3V, IN -> 13 const int relaypin= 13;

void setup() { Serial.begin(9600);// }

void loop() {

// This allows for the update of variables for time or accessing the individual elements. myRTC.updateTime(); // Optional time increments // Start printing elements as individuals //Serial.print("Current Date / Time: "); //Serial.print(myRTC.dayofmonth); //Serial.print("/"); //Serial.print(myRTC.month); //Serial.print("/"); //Serial.print(myRTC.year); //Serial.print(" "); //Serial.print(myRTC.hours); //Serial.print(":"); //Serial.print(myRTC.minutes); //Serial.print(":"); //Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop delay( 100);

Bluetooth_Input = Serial.read(); // Bluetooth Code if (Bluetooth_Input=='a'){ //Bluetooth ON with variable 'a' digitalWrite(13,HIGH);} if (Bluetooth_Input=='b'){ //Bluetooth OFF with variable 'b' digitalWrite(13,LOW);}

if (myRTC.hours==17) { // Automatically turn ON at 5pm digitalWrite(13,HIGH);}

if (myRTC.hours==22) { // Automatically turn OFF at 10pm digitalWrite(13,LOW);}

}

Step 6: The End

Like always, be careful when working with electricity. It is your responsibility to make sure the components are compatible are wired correctly. Hope you've enjoyed this how to, feel free to leave useful comments and ask good questions.

Step 7: Using Bluetooth App to Control Lights