element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Merry Boxes & LEDs
  • Challenges & Projects
  • Project14
  • Merry Boxes & LEDs
  • More
  • Cancel
Merry Boxes & LEDs
Blog Connected Christmas Trees
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Merry Boxes & LEDs to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ntewinkel
  • Date Created: 9 Dec 2018 7:41 AM Date Created
  • Views 2027 views
  • Likes 17 likes
  • Comments 12 comments
  • wifi
  • mqtt
  • merryboxesledsch
  • holidayspecial19ch
  • xmas
  • esp8266
  • arduino
Related
Recommended

Connected Christmas Trees

ntewinkel
ntewinkel
9 Dec 2018
image

Merry Boxes & LEDs

Enter Your Project for a chance to win a Maker Tool Kit, an Oscilloscope Grand Prize for the project that brings the Most Joy to the Heart, and Gift to Gives!

Back to The Project14 homepage image

Project14 Home
Monthly Themes
Monthly Theme Poll

 

It looks like I'll finally have some time to do a project!

Guess there is a benefit to longer nights and colder weather - more time spent indoors to be nerdy like this image

 

Earlier this year I ordered a couple of Christmas tree kits from the land of the Internets. That place on-the-line that's so far away it takes months to get the packages into my mailbox. But the prices are nice, the products are cool, and... free shipping!

image

 

Once assembled, these should be cute little trees with blinky lights.

 

Then I thought, wouldn't it be cool if we had a little tree here, and a friend somewhere else at a different node on the Interconnected Webs had the other little tree, and they could somehow magically interact?

 

In my drawers of hoarded items I also have an ever expanding assortment of ESP8266 boards, from the same far away lands that got me the little trees, and these boards are really nice in that they are very tiny and yet very powerful... plus they have built-in Wi-Fi!

 

The specific boards I have in mind are the Wemos D1 Mini type, because they are easy to program using the Arduino IDE and upload is also easy by plugging it in similar to the way the UNO works.

Plus, it's simple to power them with a USB charger, which then should also be able to power the tree.

 

Tonight I implemented the first phase of the overall plan - that is, how can we best send messages between the two boards?

 

I chose to use MQTT for the quick response time, rather than writing my own server scripts and polling for status updates. MQTT is a nice standard for other uses too, so it's also worthwhile to do a bit of learning there.

 

Turns out it was actually very easy to get an example working tonight, using a free online MQTT broker, the accompanying online client interface they provide, the PubSub Arduino library, and the WiFi Witty I used for testing.

 

The WiFi Witty is another ESP8266 board that's very handy to have in the drawer of hoarded goods. It's very similar to the Wemos D1 Mini in that it's easy to program, upload, and power, but the Witty also includes a user button, RGB LED, a little blue LED, and a light sensor. This makes it a perfect platform for testing new things - all the basics are provided to stand in for the final project details, with no soldering or wiring required. I've used it for similar starting/testing steps in the past too - very handy. The Wemos will require some soldering and external hardware, so I'll leave that for later.

 

So earlier tonight I set up the Witty to connect to the MQTT broker, and had it send a message with each button push. It also receives messages via the same topic, and I set it up to turn on the green LED when the message starts with 1, and turn it off when the message starts with 0. The PubSub library includes examples that provide plenty of code examples to make for a quick and easy start.

 

This actually covers all the steps I will need in my final project, so I'm very pleased with how well that came together!

 

Right, I didn't describe the final project yet...

 

I will have two little blinking-LED Christmas trees, using the kits in the picture above.

Both will get a Wemos D1 Mini to control them

Each Wemos will:

a) have a small motion sensor attached to them (also in that drawer-of-many-hoarded-items)

b) be connected to their tree via an output pin, via a transistor, to light up the tree

c) run the single top LED of the tree from a separate output pin

 

When one senses motion, it will send a message to the other tree, and that far tree will light up. The very tip of the tree of the local tree is turned on when motion is sensed, to show that it did something (otherwise the local user won't know anything is happening).

 

Next step - solder those kits into pretty little trees!

 

I will post updates and source code as things progress image

 

Cheers,

-Nico

 

Next blog posts:

Assembling the Trees

Finally! Two Trees Assembled

Two Trees by a Tree

Connecting the Tree to the Internet

Motion Sensor on Wemos

Trees! one with motion sickness...

Motion Sensor Issues, continued

The Connected Trees are Working!

Merry Boxes - A Project Within a Project

Connected Christmas Trees - Finished!

  • Sign in to reply

Top Comments

  • fmilburn
    fmilburn over 6 years ago +9
    Hi Nico, That is a great idea! I will have to look into doing something similar for next year to interact with the grandkids. Frank
  • jw0752
    jw0752 over 6 years ago +8
    This is a neat idea. When ever the tree lights up the kids will know that Santa is thinking of them. John
  • mcb1
    mcb1 over 6 years ago +6
    Great idea ... can I get one in time for xmas (I think not) We did a 'world wide MQTT' in the Xmas Holiday lights Jan Cumps sorted it out and it got extended by Robert Peter Oakes ??? Sounds like a great…
  • phlebas
    phlebas over 6 years ago in reply to mcb1

    That's a nice looking tree. Are they available to buy online?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ntewinkel
    ntewinkel over 6 years ago in reply to mcb1

    Haha yes.

     

    I really should schedule my xmas holidays a few weeks *before* xmas!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 6 years ago in reply to ntewinkel

    Hurry up xmas will be over ... imageimage

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ntewinkel
    ntewinkel over 6 years ago in reply to ntewinkel

    >It seems to have separate circuits of lights to make each colour flash at different times

     

    Confirmed - I assembled one side and it does indeed contain a separate circuit for each colour, each separated (from the blinky circuitry) with a resistor, so it should be easy to tap into.

    So yes, 6 separate strings of lights, plus the peak light.

     

    -Nico

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • neilk
    neilk over 6 years ago

    Nice one, Nico. Very imaginative image

     

    Neil

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube