Diy Interactive New Year Tree Light Show ๐ŸŽ„

About the project

Build your own mini interactive led Tree!

Project info

Difficulty: Easy

Platforms: LabVIEWRaspberry PiSTMicroelectronicsMicroPython

Estimated time: 1 hour

License: MIT license (MIT)

Items used in this project

Hardware components

Resistor 330 ohm Resistor 330 ohm x 1
SB Components Pico GPIO Expansion Board SB Components Pico GPIO Expansion Board x 1
Jumper wires (generic) Jumper wires (generic) x 1
Raspberry Pi Pico Raspberry Pi Pico x 1
Hexabitz 3.3V/1A DC-DC Power Supply Module (H03R00) Hexabitz 3.3V/1A DC-DC Power Supply Module (H03R00) x 1
Hexabitz STLINK-V3MODS Programmer (H40Rx) Hexabitz STLINK-V3MODS Programmer (H40Rx) x 1
Hexabitz Time-of-flight IR Sensor Module (H08R60) Hexabitz Time-of-flight IR Sensor Module (H08R60) x 1
Hexabitz BitzClamp Hexabitz BitzClamp x 2
Hexabitz 4-Pin USB-Serial Prototype Cable Hexabitz 4-Pin USB-Serial Prototype Cable x 1
Elecrow $1 PCB Prototype Elecrow $1 PCB Prototype x 1
LED, Orange LED, Orange x 1
High Brightness LED, White High Brightness LED, White x 1
LED, Blue LED, Blue x 1
5 mm LED: Green 5 mm LED: Green x 1
5 mm LED: Yellow 5 mm LED: Yellow x 1
5 mm LED: Red 5 mm LED: Red x 1

View all

Software apps and online services

Hexabitz 5V / 8W Portable USB Soldering Iron Hexabitz 5V / 8W Portable USB Soldering Iron
Hexabitz E-Z-Hook Programming Kit Hexabitz E-Z-Hook Programming Kit
MicroPython MicroPython
STMicroelectronics STM32CUBEPROG STMicroelectronics STM32CUBEPROG

Story

⭐️ The purpose of this project is to design a simple prototype of an interactive lit tree that was controlled using a Raspberry Pi Pico and Hexabiz IR sensor module.

⭐️ We can use this to decorate walls and rooms. So in this tutorial, I am showing how I designed and made this Christmas tree.

⭐️ The LEDs are switched on sequentially if the distance between the person and the tree is greater than one and a half meters. The LEDs at the top of the tree are turned on intermittently, and the rest are turned off when approaching them. This sequence can be changed as required.

⭐️ A relay module can also be used if we want to decorate a real tree with strip lights.

How I build it 🛠️

⭐️ Bring green paper and a perforated board to make a prototype of the tree before designing a printed circuit or for ease if your country doesn't have a place to manufacture PCB.

⭐️ Connecting and soldering components.

1 / 3

⭐️ I tested the LEDs by connecting them to Hexabitz power module and 9 volt battery.

1 / 4

⭐️ The next stage is to connect UART GPIOs of the Raspberry Pi Pico to Hexabitz module then connect the tree circuit wires with pico GPIOs as well.

1 / 3

⭐️ I hid the IR sensor module behind the snowman ⛄️, with the need to cut a small hole in the sensor's place.

1 / 2

Code Explanation 🖥️ 🧐

All you need to do is perform the following steps :

  • Import the machine module.
  • Import the time module.
from machine import UART, Pin
import time

UART objects can be created and initialised using:

uart = UART(0, baudrate= 921600, tx=Pin(0), rx=Pin(1))     # init with given baudrate
uart.init(921600, bits=8, parity=None, stop=1) # init with given parameters

A UART object acts like a stream object and reading and writing to Hexabitz module is done using the standard stream methods.

We obtain the filtered and calibrated value of the IR in units of cm or inch using the following command from the IR module factsheet:

For more information see the following project:

https://www.hackster.io/aula-jazmati/how-to-use-hexabitz-modules-with-raspberry-pi-pico-69516c

Test the System 😃⛄️🎄⭐

Schematics, diagrams and documents

The Schematics

Code

The code

Credits

Photo of Aula_Jazmati

Aula_Jazmati

https://www.hackster.io/aula-jazmati

   

Leave your feedback...