LED Noodle Holiday Tree
2023-12-12 | By Adafruit Industries
License: See Original Project 3D Printing Programmers
Courtesy of Adafruit
Guide by Ruiz Brothers
Overview
Build a light-up tree with LED noodles, QT Py RP2040 and an AW9523 LED driver. This 3D printed project features eight helical spokes that spiral and taper to form a tree. Each LED noodle fades sequentially creating a subtle effect that brings the lights to life.
The AW9523 LED driver connects to the QT Py RP2040 over STEMMA QT to easily control the LED noodles using PWM with CircuitPython.
Choose from a range of LED noodle colors to create your own color combination. Each easily press fits into the spokes of the tree making a glue-free assembly.
An elegant tree topper sits atop the tree, concealing the various wires. A piece of heat shrink tubing keeps the wires held together and passes down to the bottom connecting to the LED driver board.
Prerequisite Guides
Take a moment to review the following guides to learn more about the products.
Parts
1 x CR2032 Coincell
1 x 30AWG Silicone Wire
1 x 30AWG Silicone Wire
1 x Heat Shrink Pack
1 x Resistor Pack
1 x Little Rubber Bumper Feet
Hardware
Required screws and nuts for assembly.
2x M3 x 6mm long pan head machine screws
4x M3 x 10mm long pan head machine screws
6x M3 hex nuts
4x M2.5 x 6mm long pan head machine screw
Circuit Diagram
The diagram below provides a general visual reference for wiring of the components once you get to the Assembly page. This diagram was created using the software package Fritzing.
Adafruit Library for Fritzing
Adafruit uses the Adafruit's Fritzing parts library to create circuit diagrams for projects. You can download the library or just grab individual parts. Get the library and parts from GitHub - Adafruit Fritzing Parts.
Wired Connections
The QT Py RP2040 is powered by a 5V 1A USB power supply.
The AW9523 connects to the QT Py using Stemma QT cable
The 4x red LED noodles connect to pins 15-12 on the AW9523
The 4x green LED noodles connect to pins 7-5 on the AW9523
220ohm resistors are in line with the ground (cathode) of the green LED noodles
CAD Files
CAD Assembly
The QT Py RP2040 snap fits onto the PCB mount. The AW9523 is secured to the PCB mount using M2.5 machine screws. The PCB mount is secured to the bottom holder using M3 screws.
The bottom cover is fitted under the tree. The tree is secured to the bottom holder using M3 screws and hex nuts. The tree topper fits over the tip of the tree. The star press fits into the tree topper.
3D Printed Parts List
2x Adafruit Star.stl
1x Bottom Cover.stl
1x PCB Mount.stl
1x Topper.stl
1x Tree Holder.stl
1x Tree.stl
Bottom Cover Wire Slit.stl (optional)
Build Volume
The parts require a 3D printer with a minimum build volume.
112mm (X) x 112mm (Y) x 230mm (Z)
Translucent Filament
Choose your desired color of filament. A white opaque colored filament will offer a soft-even diffusion while a "clear" transparent filament will give sharp and direct diffusion.
Design Source Files
The project assembly was designed in Fusion 360. This can be downloaded in different formats like STEP, STL and more. Electronic components like Adafruit's boards, displays, connectors and more can be downloaded from the Adafruit CAD parts GitHub Repo.
CircuitPython
CircuitPython is a derivative of MicroPython designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the CIRCUITPY drive to iterate.
CircuitPython Quickstart
Follow this step-by-step to quickly get CircuitPython running on your board.
Download the latest version of CircuitPython for this board via circuitpython.org
Click the link above to download the latest CircuitPython UF2 file.
Save it wherever is convenient for you.
To enter the bootloader, hold down the BOOT/BOOTSEL button (highlighted in red above), and while continuing to hold it (don't let go!), press and release the reset button (highlighted in blue above). Continue to hold the BOOT/BOOTSEL button until the RPI-RP2 drive appears!
If the drive does not appear, release all the buttons, and then repeat the process above.
You can also start with your board unplugged from USB, press, and hold the BOOTSEL button (highlighted in red above), continue to hold it while plugging it into USB, and wait for the drive to appear before releasing the button.
A lot of people end up using charge-only USB cables and it is very frustrating! Make sure you have a USB cable you know is good for data sync.
You will see a new disk drive appear called RPI-RP2.
Drag the adafruit_circuitpython_etc.uf2 file to RPI-RP2.
The RPI-RP2 drive will disappear, and a new disk drive called CIRCUITPY will appear.
That's it, you're done! :)
Safe Mode
You want to edit your code.py or modify the files on your CIRCUITPY drive but find that you can't. Perhaps your board has gotten into a state where CIRCUITPY is read-only. You may have turned off the CIRCUITPY drive altogether. Whatever the reason, safe mode can help.
Safe mode in CircuitPython does not run any user code on startup and disables auto-reload. This means a few things. First, safe mode bypasses any code in boot.py (where you can set CIRCUITPY read-only or turn it off completely). Second, it does not run the code in code.py. And finally, it does not automatically soft-reload when data is written to the CIRCUITPY drive.
Therefore, whatever you may have done to put your board in a non-interactive state, safe mode gives you the opportunity to correct it without losing all of the data on the CIRCUITPY drive.
Entering Safe Mode
To enter safe mode when using CircuitPython, plug in your board or hit reset (highlighted in red above). Immediately after the board starts up or resets, it waits 1000ms. On some boards, the onboard status LED (highlighted in green above) will blink yellow during that time. If you press reset during that 1000ms, the board will start up in safe mode. It can be difficult to react to the yellow LED, so you may want to think of it simply as a slow double click of the reset button. (Remember, a fast double click of reset enters the bootloader.)
In Safe Mode
If you successfully enter safe mode on CircuitPython, the LED will intermittently blink yellow three times.
If you connect to the serial console, you'll find the following message.
Auto-reload is off. Running in safe mode! Not running saved code. CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode. Press any key to enter the REPL. Use CTRL-D to reload.
You can now edit the contents of the CIRCUITPY drive. Remember, your code will not run until you press the reset button, or unplug and plug in your board, to get out of safe mode.
Flash Resetting UF2
If your board ever gets into a really weird state and doesn't even show up as a disk drive when installing CircuitPython, try loading this 'nuke' UF2 which will do a 'deep clean' on your Flash Memory. You will lose all the files on the board, but at least you'll be able to revive it! After loading this UF2, follow the steps above to re-install CircuitPython.
Download flash erasing "nuke" UF2
Coding The LED Noodle Tree
Once you've finished setting up your QT Py RP2040 with CircuitPython, you can access the code and necessary libraries by downloading the Project Bundle.
To do this, click on the Download Project Bundle button in the window below. It will download to your computer as a zipped folder.
# SPDX-FileCopyrightText: 2023 Phil Burgess for Adafruit Industries # # SPDX-License-Identifier: MIT import math import time import board import adafruit_aw9523 GAMMA = 2.6 # For perceptually-linear brightness PINS = (15, 14, 13, 12, 7, 6, 5, 4) # List of pins, one per nOOd # Instantiate AW9523 on STEMMA I2C bus. This was tested on QT Py RP2040. # Other boards might require board.I2C() instead of board.STEMMA_I2C(). aw = adafruit_aw9523.AW9523(board.STEMMA_I2C()) for pin in PINS: aw.get_pin(pin).switch_to_output(value=True) # Activate pin, initialize OFF aw.LED_modes |= 1 << pin # Enable constant-current on pin while True: # Repeat forever... for i, pin in enumerate(PINS): # For each pin... # Calc sine wave, phase offset for each pin, with gamma correction. # If using red, green, blue nOOds, you'll get a cycle of hues. phase = (time.monotonic() - 2 * i / len(PINS)) * math.pi brightness = int((math.sin(phase) + 1.0) * 0.5 ** GAMMA * 255 + 0.5) aw.set_constant_current(pin, brightness)
Upload the Code and Libraries to the RP2040 Prop-Maker Feather
After downloading the Project Bundle, plug your QT Py RP2040 into the computer's USB port with a known good USB data+power cable. You should see a new flash drive appear in the computer's File Explorer or Finder (depending on your operating system) called CIRCUITPY. Unzip the folder and copy the following items to the QT Py RP2040's CIRCUITPY drive.
lib folder
code.py
Your QT Py RP2040 CIRCUITPY drive should look like this after copying the lib folder and the code.py file.
Wiring and Assembly
Ground Wires
Create four wires for the green and red LED noodle ground connections. These should have a length of 5 inches (12.7cm) each.
Solder Ground Wires
Attach the ground wires to the cathode pins of the LED noodles with solder.
To know which end of the n00d is cathode and which is anode, see the guide page at https://learn.adafruit.com/noods-uberguide/electrical-properties
Voltage Wires
Create four wires for the green and red LED noodles voltage connection. These should have a length of 13.5 inches (34cm) each.
Solder Voltage Wires
Attach the voltage wires to the anode pins of the LED noodles with solder. The anode pins can be identified by a teeny-tiny hole in the metal end tab.
Wired LED Noodles
Check the wires have been properly soldered to the cathode pins on each LED noodle.
Install Noodles
Add the green LED noodles to the outer spirals of the tree by pressing them into the channels.
The red LED noodles can then be added to the inner spirals of the tree. Precision tweezers or a fine tipped tool can be used to help assist in pressing the noodles into the inner channels.
Tree Tip
Ensure the LED noodles are fully seated in the channels, so the voltage wires are pointing out towards the tip of the tree.
Heat Shrink
Grab a piece of heat shrink tubbing, preferably a white color from the multi-colored pack. The diameter of the tube should accommodate the eight voltage wires.
Carefully insert the eight voltage wires through the heat shrink tubbing.
Install Heat Shrink
Insert the end of the heat shrink with the eight wires through the hole in the top of the tree. Push the tubing through the opening until the wires are fully fed through.
Installed Heat Shrink
Ensure the voltage wires have been fully inserted through the opening in the tip of the tree.
Optionally add another piece of heat shrink tubing to cover the full length of the voltage wires.
Install Wires to Bottom Cover
Get the bottom cover ready. Insert the eight voltage wires through the center hole of the cover so there's enough slack to solder them to the AW9523 board.
Install Bottom Cover
Carefully fit the bottom cover into the tree by pressing the mount tabs through the tree's ring.
The tree's ring may need a bit of flexing to push the bottom cover tabs through.
Line up the mounting tabs with the tree's mounting holes.
Coincell Test
Use the CR2032 coin cell battery to test each LED noodle.
This helps determine the LED noodles matching ground and voltage wires.
To achieve a sequential fading effect, the wires from the LED noodles will need to be ordered sequentially with the pins on the AW9523 board.
Solder Wires to AW9523
Attach the ground wires to pins 15 – 4.
Attach the voltage wires to the corresponding voltage pins.Solder the 220ohm resistors inline with the ground wires of the green LED noodles.
Remember to use to the coin cell battery to test the order of the LED noodles to your desired sequence.
Connect QT Py RP2040
Use the short STEMMA QT cable to connect the AW9523 to the QT Py RP2040.
USB Power Test
Use a USB-C type cable and a 5V 1A USB power supply to power up the circuit.
Mount QT Py RP2040
Install the QT Py into the 3D printed PCB mount by fitting it into the holder.
Fit the front edges of the PCB underneath the clips.
Slightly flex the mount to get the back edges of the PCB to snap over.
Ensure the USB-C port is facing the correct orientation.
Mount the AW9523 Board
Place the AW9523 PCB over the built-in standoffs on the 3D printed PCB mount with the mounting holes lined up.
Use four M2.5 x 6mm long machine screws to secure the board to the mount.
Secure the PCBs
Ensure the QT Py RP2040 and AW9523 are secured to the 3D printed PCB mount.
Connect the boards together using the short STEMMA QT cable.
Hardware for PCB Mount
Use two M3 x 6mm long screws to secure the PCB mount to the bottom base.
Secure PCB Mount
Place the PCB mount over the two mounting holes in the bottom base with the holes lined up.
Insert the M3 x 6mm long screws to attach the PCB mount to the bottom case. Use two M3 hex nuts to secure the mount.
Installed PCB Mount
Take a moment to inspect the PCB mount has been properly secured to the bottom base.
Install Tree
Carefully fit the tree onto the bottom base with the mounting holes lined up.
Ensure all of the wires are fitted inside the bottom case.
Secure Tree
Use four M3 x 10mm long machine screws and hex nuts to secure the bottom base to the tree and bottom cover.
Rubber Feet
Get the four rubber feet ready to stick onto the bottom of the tree assembly.
Peel off the rubber feet from the pack and stick them onto desired spots on the bottom of the base.
Install Tree Topper
Glue the two halves of the star together using super glue or your preferred adhesive.
Press fit the stem of the star into the top hole of the tree topper.
Place the tree topper over the tip of the tree. Optionally use mounting tack or tape to secure the tree topper in place.
Final Build
Power the QT Py using a USB-C type cable and a 5V 1A power supply to turn on the LED noodle tree.
Congratulations on your build!
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum