Christmas Tree

Light up your Christmas from your phone.

Things used in this project

Ā 

Hardware components

HARDWARE LIST
1 Particle Spark Core
1 Particle Photon
1 wemos D1 mini relay
1 SparkFun IoT Power Relay

Story

Ā 

Here is what our family created for Christmas:

Ā 

Elfie is anxious to do his tricks

How to build it

Ā 

You need to get the some driftwood, a tree trunk and a metal round bar from your hardware store. Carefully choose the driftwood branches so they form a triangle when piled up.

Ā 

Drill a hole in the trunk and in the center of each branch. We are going to use the trunk as a base, so stick in the metal bar and start piling up your branches from longest to shortest. Remember that this could be a family activity so invite everyone in the house to place some branches!

Ā 

Raw materials

Ā 

Raw materials

Ā 

Once assembled, get some christmas LED lights and add the decorations to your Christmas tree.

Ā 

Here be dragons

Ā 

For this part there is HIGH VOLTAGE involved so kindly ask everyone to get back to their activities for the time being.

Ā 

Let me re-state that: do not do this if you do not feel comfortable working with high voltages.

Ā 

If you don't feel comfortable with high voltages that's OK, just buy a WemoĀ® Mini Smart Plug or similar and proceed to next step. Oh wait, even better, use an IoT Power Relay from SparkFun. More info about it here.

Ā 

I used an "ancient" Particle Core I had around (you can use a Photon too or most probably any other Arduino compatible MCU) and wired it together with a Wemos mini relay [https://wiki.wemos.cc/products:d1_mini_shields:relay_shield] (or any Arduino compatible will do) and a 5v 1Amp power source that I recycled from an old phone charger. You are going to need a plastic box and electrical tape.

Ā 

Ā 

Ā 

Ā 

Time to be creative, wire and solder the pieces together:

Ā 

Ā 

If you get lost, follow this schematic (remember that you want the relay to open the hot wire, so connect it to the COMMON and Normally Open pins):

Ā 

Ā 

The end result should look like this:

Ā 

Ā 

Sorry, the end result should rather look like this:

Ā 

Ā 

Once fully assembled, it's time for flashing the firmware.

Ā 

Schedule

Ā 

You can control the schedule with the following lines:

CODE
const String timeOn = "07:00AM"; 
const String timeOff = "08:00PM"; 

Feel free to change them to whatever fits you.

Ā 

Remote control

Ā 

I declared a couple of cloud functions in Particle, so I could control it from my phone or a browser:

CODE
Particle.function("turnOff", turnOff); 
 Particle.function("turnOn", turnOn); 

Control it with the Particle app:

Ā 

Ā 

Control it with Porter:

Ā 

Ā 

Control it from the Particle devices interface:

Ā 

Ā 

Ā 

Ā 

Conclusion

Ā 

I've initially planned on working on this for an hour or so in a snowy sunday, but few challenges with size of the initial 5V charger not fitting the project box made it a bit longer. But hey! The tree lights up every morning and shuts down at bed time these days.

Ā 

Merry christmas to the Hackster community!

Ā 

Ā 

Ā 

Help

Ā 

If you require professional help with your projects, don't hesitate to write me a line about your needs at [email protected]. Thank you!


Ā 

Schematics

Ā 

Schematic

Ā 

follow the white rabbit

Ā 


Ā 

Code

Ā 

Firmware

Load in Particle Build and flash it

icon oneRelay-master.zip 4KB Download(0)

The article was first published in hackster, December 18, 2017

cr: https://www.hackster.io/gusgonnet/christmas-tree-928462

author: Gustavo

License
All Rights
Reserved
licensBg
0