Overview
Adafruit nOOds are little noodles of light. They're as simple to use as a regular LED - connect one end to power and one end to ground, and they light up and glow. They're incredibly bendy and flexible, making them just perfect for small subtle costume details. A nOOds will last for hours on a single coin cell battery, with no big noisy EL-wire inverter to manage.
We'll also get a little crazy and hook 3 nOOds up to a QT Py microcontroller, so they can be dimmed or sequenced using CircuitPython code.
Single nOOds Projects
All you need to light up a single nOOds is a coin cell battery. Here are a couple in the store with built-in on-off switches, and one that includes two blink modes.
Multiple nOOds Projects
You can power multiple nOOds from a microcontroller and have a lot more control over your lighting effects. Use CircuitPython code to dim or sequence or blink the nOOds so they really sell your cosplay character. This is a more complicated project but the results can be spectacular.
Page last edited March 08, 2024
Text editor powered by tinymce.
Wiring Diagram
If you're using just one nOOd, the wiring is very simple. The + side goes to SW (switch) and the - end goes to Gnd.
Multiple nOOds with Software Control
This wiring diagram shows how to connect 3 nOOds to a QT Py Stemma, and includes some bells and whistles: a JST connector with on/off switch, and current-limiting 220 ohm resistors.
This is a more complicated project, but it gives you a lot of control, as well as access to a much juicier battery source than a single coin cell can provide.
nOOds Hookup
- QT Py Stemma GND --> nOOds G (all 3 connected to the same pin)
- QT Py Stemma SCL --> nOOds +
- QT Py Stemma SDA --> nOOds -
- QT Py A3 --> nOOds +
You can keep adding nOOds to the remaining GPIO pins on the QT Py for larger projects, or if you want even more nOOds, you can add on an Adafruit AW9523 GPIO Expander and LED Driver Breakout. Check out the nOOds Uberguide for more info.
JST Power Switch
- QT Py G --> JST Breakout G
- QT Py 5v --> JST Breakout Sw
Page last edited March 08, 2024
Text editor powered by tinymce.
One nOOd
One nOOd can be powered from a single coin cell battery. This is the easiest way to get your lights up and running. Watch the video at the head of this tutorial for a step-by-step build.
1. Identify the + and - ends of the nOOd. Use alligator clips to connect the nOOd temporarily to the wires coming from the battery holder. When the nOOd lights up, you've got it the right way round. If it doesn't work, try reversing the connections.
2. Slip some heat shrink on and solder the nOOd to the wire. You'll get the best connection if you make a bend in the nOOd connector and in the wire, and hook them together before soldering. Take a little time and get it really well connected. This will make it far less likely for your costume to break while you're out wearing it.
3. Solder the other end as well.
4. Use tape, hot glue, or E6000 to fix the nOOd into your costume. It's silicone-coated so a lot of glues won't stick to it. I used a combination of masking tape and hot glue for the goggles project, which doesn't get a lot of jostling since the goggles live permanently on the hat.
I also added a nOOd to a halloween mask using a switched coin cell breakout (+ to Sw, - to G). I used hot glue to attach the nOOd to the mask and it lasted for one night before starting to come off. I later fixed it with E6000 adhesive and it's still going strong.
Page last edited March 08, 2024
Text editor powered by tinymce.
Multiple nOOds
Adding one nOOd is fun, but adding a handful of sequence-able and code-able nOOd is way more fun.
If this looks intimidating, or if you don't care about software control, you can get a similar effect by using multiple single nOOds each hooked up to its own coin cell battery holder. If you're ready for a Project, and not afraid of a little soldering, read on.
Identify the + and - ends of your nOOds by sight, and confirm by touching the bare metal ends to each side of a coin cell battery. Mark the nOOds with some tape so you remember which end is which.
We'll solder a red wire to the + end and black wire to the - end. To get a really good solder connection, make a bend in the nOOds connector and a bend in the wire, and hook them together before soldering. This will make it far less likely for your solder joint to break, leaving you in the dark.
Solder a red wire to the + end and a black wire to the - end of all your nOOds. The wire lengths will depend on your project. Remember that both wires need to reach back to the microcontroller.
Now let's add the resistors. I'm using 220ohm resistors. Use something in that neighborhood to keep your nOOds from burning out - the QT Py puts out 5v of current, and the nOOds prefer closer to 3v. They'll break if you feed them too much.
Bend the resistor leg into a loop and wind it around itself to give yourself a place to hook your wire. Solder a wire to each end -- it doesn't matter which end is which -- and cover the whole resistor with heat shrink.
Each red nOOd wire needs to go to its own GPIO pin, so we can light them individually from the software.
Solder one of the red wires from your nOOds to the yellow wire and one to the green wire on the Stemma connector. We'll use these two wires as GPIO pins.
Twist all the black wires from your nOOds together and solder them to the black wire on your Stemma connector. All the black wires go to G (ground).
I have a third nOOd in my project, so I'll use one of the other GPIO pins on the Stemma for the remaining red wire. Additional nOOd could be added to the rest of the available pins, and all can connect to the same G pin.
This is a great moment to stop and test your wiring. Skip ahead to the CircuitPython page and install the software, then upload your code.
Plug your QT Py in via the USB port and see if your nOOds come on.
If most but not all of them come on, check the faulty one to be sure you didn't mix up the + and - ends. If none of them come on, the trouble is probably with your software. Head back to the software page and try uploading again.
Once the nOOds are all coming on, let's add our power switch.
The JST breakout is a handy little thing with an on-off switch built in. You can plug any of our LiPoly batteries in and run your project for hours.
Solder 5V on the QT Py to the Sw pin (the one connected to the switch) and connect G to G.
Page last edited March 08, 2024
Text editor powered by tinymce.
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.
Set up CircuitPython Quick Start!
Follow this quick step-by-step for super-fast Python power :)
If you want to get started with your QT Py, and you have NOT soldered a chip to the back of it, download CircuitPython from the following link:
Click the link above and download the latest UF2 file.
Download and save it to your desktop (or wherever is handy).
Plug your QT Py into your computer using a known-good USB cable.
A lot of people end up using charge-only USB cables and it is very frustrating! So make sure you have a USB cable you know is good for data sync.
Double-click the small RST (reset) button, and you will see the NeoPixel RGB LED turn green. If it turns red, check the USB cable, try another USB port, etc.
If double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!
You will see a new disk drive appear called QTPY_BOOT.
Drag the adafruit_circuitpython_etc.uf2 file to QTPY_BOOT
Page last edited March 08, 2024
Text editor powered by tinymce.
Creating and Editing Code
One of the best things about CircuitPython is how simple it is to get code up and running. This section covers how to create and edit your first CircuitPython program.
To create and edit code, all you'll need is an editor. There are many options. Adafruit strongly recommends using Mu! It's designed for CircuitPython, and it's really simple and easy to use, with a built in serial console!
If you don't or can't use Mu, there are a number of other editors that work quite well. The Recommended Editors page has more details. Otherwise, make sure you do "Eject" or "Safe Remove" on Windows or "sync" on Linux after writing a file if you aren't using Mu. (This was formerly not a problem on macOS, but see the warning below.)
Installing CircuitPython generates a code.py file on your CIRCUITPY drive. To begin your own program, open your editor, and load the code.py file from the CIRCUITPY drive.
If you are using Mu, click the Load button in the button bar, navigate to the CIRCUITPY drive, and choose code.py.
Copy and paste the following code into your editor:
import board
import digitalio
import time
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.5)
If you're using a KB2040, QT Py, Quaila, or a Trinkey, or any other board without a single-color LED that can blink, please download the NeoPixel blink example.
It will look like this. Note that under the while True: line, the next four lines begin with four spaces to indent them, and they're indented exactly the same amount. All the lines before that have no spaces before the text.
The little LED should now be blinking. Once per half-second.
Congratulations, you've just run your first CircuitPython program!
To edit code, open the code.py file on your CIRCUITPY drive into your editor.
Make the desired changes to your code. Save the file. That's it!
Your code changes are run as soon as the file is done saving.
There's one warning before you continue...
The CircuitPython code on your board detects when the files are changed or written and will automatically re-start your code. This makes coding very fast because you save, and it re-runs. If you unplug or reset the board before your computer finishes writing the file to your board, you can corrupt the drive. If this happens, you may lose the code you've written, so it's important to backup your code to your computer regularly.
There are a couple of ways to avoid filesystem corruption.
1. Use an editor that writes out the file completely when you save it.
Check out the Recommended Editors page for details on different editing options.
2. Eject or Sync the Drive After Writing
If you are using one of our not-recommended-editors, not all is lost! You can still make it work.
On Windows, you can Eject or Safe Remove the CIRCUITPY drive. It won't actually eject, but it will force the operating system to save your file to disk. On Linux, use the sync command in a terminal to force the write to disk.
You also need to do this if you use Windows Explorer or a Linux graphical file manager to drag a file onto CIRCUITPY.
Don't worry! Corrupting the drive isn't the end of the world (or your board!). If this happens, follow the steps found on the Troubleshooting page of every board guide to get your board up and running again.
import supervisor supervisor.runtime.autoreload = False
Back to Editing Code...
Now! Let's try editing the program you added to your board. Open your code.py file into your editor. You'll make a simple change. Change the first 0.5 to 0.1. The code should look like this:
import board
import digitalio
import time
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(0.1)
led.value = False
time.sleep(0.5)
Leave the rest of the code as-is. Save your file. See what happens to the LED on your board? Something changed! Do you know why?
You don't have to stop there! Let's keep going. Change the second 0.5 to 0.1 so it looks like this:
while True:
led.value = True
time.sleep(0.1)
led.value = False
time.sleep(0.1)
Now it blinks really fast! You decreased the both time that the code leaves the LED on and off!
Now try increasing both of the 0.1 to 1. Your LED will blink much more slowly because you've increased the amount of time that the LED is turned on and off.
Well done! You're doing great! You're ready to start into new examples and edit them to see what happens! These were simple changes, but major changes are done using the same process. Make your desired change, save it, and get the results. That's really all there is to it!
CircuitPython looks for a code file on the board to run. There are four options: code.txt, code.py, main.txt and main.py. CircuitPython looks for those files, in that order, and then runs the first one it finds. While code.py is the recommended name for your code file, it is important to know that the other options exist. If your program doesn't seem to be updating as you work, make sure you haven't created another code file that's being read instead of the one you're working on.
Page last edited March 08, 2024
Text editor powered by tinymce.
Example Code
Here are a few code samples to get you started.
Plug your computer into the QY Py via a known, good power+data USB cable. A new thumb drive named CIRCUITPY should appear.
Download the file and save it as code.py at the root of your CIRCUITPY drive to install.
# Adafruit nOOds digital control using GPIO pins.
# Uses 3 nOOds, anode (+) to GPIO pin, cathode (-) to ground.
# A current-limiting resistor (e.g. 220 Ohm) can go at either end.
import time
import board
import digitalio
# This uses 3 pins on QtPy RP2040, but any pins will do.
PINS = (board.A3, board.SDA, board.SCL) # List of pins, one per nOOd
# Convert pin number list to pin object list, initialize to OFF
pin_list = [digitalio.DigitalInOut(pin) for pin in PINS]
for pin in pin_list:
pin.direction = digitalio.Direction.OUTPUT
pin.value = 0
while True: # Repeat forever...
for pin in pin_list: # For each pin...
pin.value = True # nOOd on
# Adafruit nOOds digital control using GPIO pins.
# Uses 3 nOOds, anode (+) to GPIO pin, cathode (-) to ground.
# A current-limiting resistor (e.g. 220 Ohm) can go at either end.
import time
import board
import digitalio
# This uses 3 pins on QtPy RP2040, but any pins will do.
PINS = (board.A3, board.SDA, board.SCL) # List of pins, one per nOOd
# Convert pin number list to pin object list, initialize to OFF
pin_list = [digitalio.DigitalInOut(pin) for pin in PINS]
for pin in pin_list:
pin.direction = digitalio.Direction.OUTPUT
pin.value = False
while True: # Repeat forever...
for pin in pin_list: # For each pin...
pin.value = True # nOOd on
time.sleep(0.5) # Pause 1/2 sec
pin.value = False # nOOd off
# Adafruit nOOds "analog" (PWM) brightness control using GPIO.
# Uses 3 nOOds, anode (+) to GPIO pin, cathode (-) to ground.
# A current-limiting resistor (e.g. 220 Ohm) can go at either end.
import math
import time
import board
import pwmio
# This uses 3 pins on QtPy RP2040, but any pins will do.
PINS = (board.A3, board.SDA, board.SCL) # List of pins, one per nOOd
GAMMA = 2.6 # For perceptually-linear brightness
# Convert pin number list to PWMOut object list
pin_list = [pwmio.PWMOut(pin, frequency=1000, duty_cycle=0) for pin in PINS]
while True: # Repeat forever...
for i, pin in enumerate(pin_list): # 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 * 65535 + 0.5)
pin.duty_cycle = brightness
Page last edited March 08, 2024
Text editor powered by tinymce.
Costume Assembly
Zoot Suit Glowing Pocket Square
This Zoot Suit has a breast pocket which is perfect for hiding electronics and batteries. I've added a nOOds to the pocket square and two nOOds to the underside of the coat's lapels.
I'm using a piece of iridescent organza as a pocket square. This kind of fabric is translucent and picks up the light from the nOOds very well. A white silk square would work well too.
Fold over one edge of your pocket square with the nOOds inside. Carefully stitch along the edge, being very careful not to hit the nOOds with your needle.
First I threaded the nOOds through a small hole in the pocket lining and into the suit lining, then pulled them through a small hole in the back of the lapel. This keeps all the wires on the interior of the suit lining and out of my way.
I attached my nOOds to the underside of the suit's lapels, about 1/8" from the edge so they cast an indirect, subtle glow. I sewed them in place by hand, using a clear monofilament sewing thread which disappears against the light.
I did need to lenghten some of the wires and shorten others once I had all the elements in place. This isn't too hard to do as you build your project. Just be sure you've got plenty of extra wire and heat shrink on hand.
Once all the wires were managed and stitched into place, I slipped the electronics into the breast pocket with the pocket square. I sewed the QT Py and battery holder to the inside top of the breast pocket so they're easy to access without fiddling.
Page last edited March 08, 2024
Text editor powered by tinymce.