# NeoPixel Bike Light

## Overview

https://www.youtube.com/watch?v=l0AmRR9w0nw

Build a sci-fi inspired bike light using Adafruit Feather and NeoPixels.&nbsp;Use an RGB LED Button to cycle through different colors and animations. The button will actually match the colors of the NeoPixels!

## 3D Printed Headlight

This is a 3D printed a headlight for my bike. I designed a mounting plate to house a 24x NeoPixel ring and 7x NeoPixel Jewel. The headlight fixture was inspired by rocket boosters and jet engines. I had the idea of an illuminated edge band that wraps around a cylinder with an illuminated inner core. By combining black PLA and translucent PLA, you can mask out certain geometry while illuminating other elements. I've been meaning to design specifically for dual extrusion such as the Ultimaker 3 and this is what I came up with.&nbsp;

## Adafruit's Feather Platform

I wanted to use the Adafruit Feather platform because it's fully featured and expandable via the FeatherWing add-ons. With on-board USB charging, it makes it easy recharge the battery.&nbsp; &nbsp;&nbsp;

## Circuit Python Powered

An RGB LED Button is used to cycle through different colors and animations on the NeoPixels. The code is written in Adafruit's Circuit Python. When you connect the Adafruit Feather to your computer via USB cable, it shows up like a flash drive. The code and libraries are accessible anytime, on any computer (even some mobile devices!). The code live on the drive, so you don't need an IDE to change or upload code. This allows for quick code changes and great for accessibility.

![leds_python-laptop.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/256/medium640/leds_python-laptop.jpg?1541516263)

![](https://cdn-learn.adafruit.com/assets/assets/000/065/139/medium800/leds_parts.jpg?1541252281)

## Parts List

- [Adafruit Feather M4 Express](https://www.adafruit.com/product/3857)
- [24x NeoPixel Ring](https://www.adafruit.com/product/1586)
- [7x NeoPixel Jewel](https://www.adafruit.com/product/2226)
- [2200mAh battery](https://www.adafruit.com/product/1781)
- [On/Off Toggle Switch](https://www.adafruit.com/product/3221)
- [RGB LED Button 16mm](https://www.adafruit.com/product/3350)

## Hardware Supplies

- 7x [M3 x 6mm (pan head)](https://www.albanycountyfasteners.com/Phillips-Pan-Head-Machine-Screw-M3-x-5-p/1066-1008.htm)
- 4x [M3 x 8mm (pan head)](https://www.albanycountyfasteners.com/Phillips-Pan-Head-Machine-Screw-M3-x-5-p/1066-1008.htm)
- 4x [M3 Nylon locknuts](https://www.albanycountyfasteners.com/Metric-Nylon-Insert-Lock-Nuts-A2-Stainless-Steel-p/5570000.htm)
- 4x [M2.5 x 5mm (flat head)](https://www.albanycountyfasteners.com/2-5-MM-x-45-Phillips-Flat-Head-Machine-Screw-p/1011-1002.htm)
- [JST-PH 3-pin&nbsp;– Female](https://www.adafruit.com/product/3893)
- JST-PH 3-pin – Male
- [JST-PH 4-pin –&nbsp;Female](https://www.adafruit.com/product/3955)
- JST-PH 4-pin – Male
- [JST-PH 2-pin – Male](https://www.adafruit.com/product/3814)
- [JST-PH 2-pin – Female](https://www.adafruit.com/product/261)
- [JST-PH Connector Kit](https://www.amazon.com/gp/product/B0731MZCGF/)
- [M2.5 & M3 Screw Taps](https://www.albanycountyfasteners.com/metric-coarse-thread-taps/8000-006.htm)
- [28AWG Silicone Cover Stranded Ribbon Cable](https://www.adafruit.com/product/3891)

## Tools

List of handy things to assist in any project.

- [Wire Strippers](https://www.adafruit.com/product/527)
- [Wire Cutters](https://www.adafruit.com/product/152)
- [Soldering Iron](https://www.adafruit.com/product/180)
- [Solder Wire](https://www.adafruit.com/product/734)
- [Panavise Jr.](https://www.adafruit.com/product/151)
- [Third Helping Hands](https://www.adafruit.com/product/291)
- [Monoprice Inventor II](https://www.adafruit.com/product/3897)

![](https://cdn-learn.adafruit.com/assets/assets/000/065/244/medium800/leds_bike-hero.jpg?1541441142)

## Prerequisite Guides

If you're new to Adafruit Feather M4 Express, CircuitPython or soldering, take a moment to walk through the following guides to get you started.

- [Adafruit Feather M4 Express Intro](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51)
- [Welcome to Circuit Python](https://learn.adafruit.com/welcome-to-circuitpython)
- [NeoPixel Uber Guide](https://learn.adafruit.com/adafruit-neopixel-uberguide/the-magic-of-neopixels)
- [Adafruit's Guide to Excellent Soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering?view=all)

# NeoPixel Bike Light

## Circuit Diagram

## Circuit&nbsp;Diagram

This provides a visual reference for wiring of the components. They aren't true to scale, just meant to be used as reference. This diagrams was created using [Fritzing software](http://fritzing.org/download/).

## Adafruit Library for Fritzing

Use our Fritzing parts library to create circuit diagrams for your projects. Download the library or just grab the individual parts. Files are hosted on our github repo linked below.

[Adafruit Fritzing Parts](https://github.com/adafruit/Fritzing-Library/tree/master/parts)
![](https://cdn-learn.adafruit.com/assets/assets/000/064/108/medium800/leds_circuit-diagram.jpg?1540300758)

[circuit_diagram.fzz](https://cdn-learn.adafruit.com/assets/assets/000/064/109/original/circuit_diagram.fzz?1540300767)
## Wired Connections

24 NeoPixel Ring

- **Pin 6** from Feather to **Data In** on 24x NeoPixel Ring
- **GND** from Feather to **GND** on 24x NeoPixel Ring
- **3V** from Feather to **PWR** on 24x NeoPixel Ring

7 NeoPixel Jewel

- **PWR** from NeoPixel Ring to **PWR** on NeoPixel Jewel
- **GND** from NeoPixel Ring to **GND** on NeoPixel Jewel
- **Data Out** from NeoPixel Ring to **Data In** on NeoPixel Jewel

RGB LED Button

- **Pin 9** from Feather to **Red&nbsp;Cathode** on&nbsp;RGB LED
- **Pin 10** from Feather to **Green** &nbsp; **Cathode** on&nbsp;RGB LED
- **Pin 11** from Feather to **Blue Cathode** on RGB LED
- **3V** from Feather to **Common Anode** on RGB LED
- **GND** from Feather to **Button**
- **Pin 12** from Feather to **Button**

Toggle Switch

- GND from Feather to **Toggle Switch**
- EN from Feather to **Toggle Switch**

## Powering

The Adafruit Feather M4 Express can be powered via USB or JST using a 3.7v lipo battery. In this project, a 4400mAh lipo battery is used. The lipo battery is rechargeable via the USB port on the Adafruit Feather.

# NeoPixel Bike Light

## Software

![](https://cdn-learn.adafruit.com/assets/assets/000/065/255/medium800/leds_circuitPython-banner.jpg?1541515996)

## Setup Adafruit Feather M4 for CircuitPython

Your Feather M4 should already come with CircuitPython but maybe there's a new version, or you overwrote your board with Arduino code! In that case, see the below for how to reinstall or update CircuitPython. Otherwise you can skip this and proceed with the build.

[Adafruit Circuit Python Guide for Feather M4 Express](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/circuitpython)
## CircuitPython Libraries

Install the Adafruit NeoPixel library for Circuit Python by downloading the latest bundle. Unzip the file and locate the needed libraries. Drop the libraries into a folder named " **lib**" on the **CIRCUITPY** drive.

For non-express boards like the Trinket M0 or Gemma M0, you'll need to manually install the necessary libraries from the bundle.

Required CircuitPython Libraries:

- **neopixel**
- **adafruit\_fancyled**
- **simpleio**

Before continuing make sure your board's lib folder or root filesystem has the&nbsp; **neopixel.mpy**** &nbsp; **file was** &nbsp;**copied over.

[Download Latest Adafruit Circuit Python Library Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases)
## Upload The Code

Copy and paste the code below into a new text document (we recommend using [Mu](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor) as your editor, which is designed for CircuitPython.). Save the file and name it as main.py

Once the files has been uploaded to the drive, the board will automatically reboot and run the code.

[Download Code from GitHub](https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/NeoPixel_Headlight/code.py)
# NeoPixel Bike Light

## 3D Printing

## 3D Printed Parts

Parts are designed to be 3D printed with FDM based machines. STL files are oriented to print "as is". Machines with dual extrusion or single extrusion setups are listed below with parts name and description. Parts require tight tolerances that might need adjusting slice setting. Reference the suggested settings below.

![leds_3d-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/258/medium640/leds_3d-parts.jpg?1541516438)

## Clips for Bike Frame

The headlight and box enclosure are designed to clamp onto the bike framing. There's a lot of different types of bikes, each with different sizes of framing. Take a moment to measure your bikes framing to ensure the clips will fit.

- Box clips: 38mm (1.5 inches) diameter
- Headlight clips: 23mm (0.9inches) diameter.

## Dry Fit Parts

I suggest testing out the parts before installing the electronics. Print out the clips and try fitting them onto your bike frame. Fit the&nbsp; **bhl-box-clip.stl** parts onto the railing of the box enclosure – If the tolerances are too tight, use a filing tool to loosen up the edges. Fit the&nbsp; **bhl-cover-jst.stl** and&nbsp; **bhl-cover-usb.stl** parts onto the box enclosure.

## Tap Mounting Holes

I used a set of screw taps to create threads in the various mounting holes. This greatly improves fastening screws. of the A mix of metric sizes are used here. M2.5 tap for the Feather mounting plate. M3 tap for the majority of the mounting holes.

## Slice Settings

Use these settings as reference. Values listed were used in [Ultimaker's CURA 3.X](https://ultimaker.com/en/products/ultimaker-cura-software) slicing software.

- 0.2mm Layer Height / 0.4mm nozzle
- 0.38mm Line Width (inner & outer widths)
- 60mm/s printing speed
- 20% infill

## Dual Extruded Headlight

The headlight was designed to be dual extruded using black and translucent PLA filament. When backlit, any geometry printed in translucent filament will illuminate and diffuse the lighting from the NeoPixels. If your 3D printer is not equipped with a dual extruder, you can 3D print the part in translucent PLA and mask certain areas with black acrylic paint.

![leds_slice-headlight.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/239/medium640/leds_slice-headlight.jpg?1541439523)

## Dual Extruded Box Enclosure

One side of the box features "grill" details that are printed in a silver colored filament. This is purely for aesthetics and does serve any functionality (other than testing your dual extrusion setup!). You have the option to print a "single" extrusion version.

![leds_slice-box.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/240/medium640/leds_slice-box.jpg?1541439589)

[Download CAD Files](https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/master/NeoPixel_Headlight)
## Glitter Infused Filament from Fillamentum

The material used to print the some of the parts in this project are from [Fillamentum](https://fillamentum.com/). From the [PLA Extrafill](https://fillamentum.com/collections/pla-extrafill) line of filaments, Vertigo Galaxy PLA and&nbsp; Rapunzel Silver PLA was used. [Translucent PLA](https://www.adafruit.com/product/2451) material was used to print the&nbsp; **bhl-headlight-b.stl** part.

# NeoPixel Bike Light

## Button Wiring

## Button Wiring

The RGB LED button needs six wired connections. To make the assembly more efficient, I used&nbsp; **JST-PH** &nbsp;cables with male and female connectors. This allows for quick connections. A 4-pin and 2-pin JST cable set can be used to connect the button the Adafruit Feather.

![leds_button-jst-wire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/140/medium640/leds_button-jst-wire.jpg?1541252462)

Info: 

## Solder Button Wires

The connections are labeled on the bottom of the button housing. Reference the labels and sort out which wire will be soldered to the pins. The polarity from the two JST-PH cables needs to match exactly. To make soldering easier, I tinned each of the pins with a bit of solder. A Panavise can secure the button in place while soldering.

![leds_button-wiring.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/141/medium640/leds_button-wiring.jpg?1541252601)

# NeoPixel Bike Light

## Switch Wiring

## Switch Wires

The on/off toggle switch needs two wired connections. Male and Female 2-pin JST-PH cables are used here to make good use of quick connects. These cables are 70mm (2.8in) in length.

![leds_switch-jst-wire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/142/medium640/leds_switch-jst-wire.jpg?1541252815)

## Solder Switch Wires

A set of third helping hands can assist in holding the switch in place while soldering the wires to the pins. The switch has three pins but we only need to use two of them. Solder wires to the middle pin and either the far left or right, as shown the photo.&nbsp;

![leds_switch-wiring.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/143/medium640/leds_switch-wiring.jpg?1541252909)

# NeoPixel Bike Light

## Feather Wiring

## Feather Wired Connections

With the button and switch wired with JST-PH cables, solder the corresponding wires to the Adafruit Feather. Take a moment to reference the wired connections and sort out the polarity and ensure they're matching.

![leds_feather-jst.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/144/medium640/leds_feather-jst.jpg?1541253037)

## Feather RGB LED Wiring

Solder the 4-pin JST-PH cable to the pins on the Feather. Make sure each connection matches the corresponding polarity.

- D9 – Red LED
- D10 – Green LED
- D11 – Blue LED&nbsp;
- 3V – Common Anode

![leds_feather-wiring-rgb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/145/medium640/leds_feather-wiring-rgb.jpg?1541253111)

## Feather Button

Solder the 2-pin JST-PH cable from the button to the Feather. Polarity from the push button doesn't matter here so the connections do not have to match the corresponding cable.

- D12 – Button
- GND – Button&nbsp;

![leds_feather-wiring-button.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/146/medium640/leds_feather-wiring-button.jpg?1541253898)

## Feather Switch

Solder the 2-pin JST-PH cable from the toggle switch to the Feather. Polarity doesn't necessarily matter here as long as the correct pins are wired.&nbsp;

- EN – Switch
- GND – Switch

![leds_feather-wiring-en.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/147/medium640/leds_feather-wiring-en.jpg?1541253948)

# NeoPixel Bike Light

## NeoPixel Wiring

## NeoPixel Connections

The 24 NeoPixel ring and 7 NeoPixel jewel will need a total of six connections. The NeoPixel ring and jewel will share 5V and GND connections. The Data-Out from the NeoPixel ring will need to connect to the Data-In of the NeoPixel Jewel. To connect the NeoPixel ring to the NeoPixel jewel, use three separate wires (70mm/2.8inches in length). A 3-pin JST-PH cable will be used to connect the NeoPixel ring to the Adafruit Feather.

![leds_neopixel-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/148/medium640/leds_neopixel-wires.jpg?1541254109)

Info: 

## Soldering NeoPixel Ring

The 3D printed mounting plate ( **bhl-plate.stl** ) for the 24 NeoPixel ring has a series of holes that exactly match the pinouts on the PCB.&nbsp; Take a moment to line up the pins with those holes. The voltage, ground and data pins are labeled on the PCB. Insert wires from the 3-pin JST cable through the holes of the mounting plate. Use the holes that correspond with the **5V** , **GND** and **Data-In** pins on the 24 NeoPixel ring. Pull the wires through the plate to gain enough length for soldering. The wires will need to be soldered to the bottom side of the PCB. A set of third helping hands can secure the ring in place while soldering. It's a bit tricky to solder the wires with the mounting plate attached so take precautions not to touch the plastic with the soldering iron.

Danger: 

## NeoPixel Jewel Wires

The three separate wires will need to be soldered to the voltage, ground and data pins on the NeoPixel jewel. Colored wires help tell the connections apart. Use the labels on the PCB to reference pinouts. Solder the wires to the&nbsp; 5V, GND and Data Input pins.&nbsp;Note, the wires are soldered through the bottom side of the PCB.

![leds_jewel-wiring.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/152/medium640/leds_jewel-wiring.jpg?1541254311)

## Install NeoPixel Jewel

Insert the wires from the jewel through the center of the mounting plate. The center features holes that match exactly with the pinouts on the neopixel jewel. Line them up so they match. Press the PCB into the center so it's flush. Pull the wires all the way through the back of the mounting plate.

## Solder NeoPixel Jewel

Grab the three wires from the jewel and thread them through the holes with corresponding pins. The 24 NeoPixel ring has spare voltage and ground pins that can be used. The Data In wire from the neopixel jewel needs to go to the Data Out pin on the neopixel ring.

## Connecting NeoPixel Ring to NeoPixel Jewel

Ensure the connections from the neopixel jewel are going to the correct pins on neopixel ring. There should be enough wire length to reach the pins on the PCB. A set of third helping is essential in assisting with soldering. Otherwise, it's a bit tricky to keep the PCB in place. Be careful not to touch the mounting plate with the soldering iron.

## Wired NeoPixels

The wiring on the neopixels were soldered through the back in order to keep the wires away from the light source.&nbsp;The front facing side of the neopixels should be free from any wires. This is a bit tricky to wire, but with patience and handy tools, it can be done. If you can't get your fingers in the right place, I found a set of tweezers to be really useful.&nbsp;

![leds_jewel-ring-installing.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/159/medium640/leds_jewel-ring-installing.jpg?1541256182)

## Wire Check

Take a moment to reference the wired connections. The corresponding 3-pin JST cable needs to have matching polarity with the Adafruit Feather.&nbsp;

![leds_jewel-ring-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/160/medium640/leds_jewel-ring-installed.jpg?1541254793)

## Wire Feather

Solder the corresponding 3-pin JST-PH cable to the Adafruit Feather. The polarity really matters here, so take a moment to reference the wiring and ensure the connections match.

- D6 from Feather to Data-In on NeoPixels
- GND from Feather to GND on NeoPixels
- 3V from Feather to PWR on NeoPixels

![leds_jewel-ring-test.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/161/medium640/leds_jewel-ring-test.jpg?1541254900)

## Test NeoPixels

Before proceeding with the assembly, check the NeoPixels are wired correctly. I used a [neopixel example code](https://learn.adafruit.com/adafruit-neopixel-uberguide/python-circuitpython)&nbsp;in circuit python to test out the NeoPixels. Be sure to update the code with the correct number of pixels and pin. Upload the code to the board if you haven't done so already. Plug in the battery to the Adafruit Feather to it test out.

# NeoPixel Bike Light

## Headlight Assembly

## Install Headlight Diffuser

Grab the headlight diffuser and mounting plate. Line up the three mounting holes and orient the parts so they match. The diffuser is symmetrical so it should line up with the mounting holes nicely.

![leds_plate-fins.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/162/medium640/leds_plate-fins.jpg?1541256734)

## Join Parts

The mounting plate should be flush with the headlight diffuser. Bring them close and press them together. If any warping occurs during the 3D printing process, the parts may has a gap which will introduce light leaking.

![leds_plate-fins-join.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/163/medium640/leds_plate-fins-join.jpg?1541256829)

## Secure Mount to Headlight

Insert M3 x 8mm pan head metric machine screws through the holes on the mounting plate. Fasten the screws until it barely protrudes through the other side. Grab the headlight diffuser and line up the mounting holes. Press the parts together. While holding parts, fasten the screws to fully tighten.

## Hardware for Headlight Clips

Grab the metric screws and hex nuts for attaching the headlight clips to the mounting plate. You'll need 2x M3 x 10mm pan head metric machine screws and 2x M3 nylon lock nuts.

![leds_bracket-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/167/medium640/leds_bracket-screws.jpg?1541257194)

## Install Headlight Mounting Clips

Grab one of the clips and press it into one of the square shaped tabs on the mounting plate. Reference the photo to gauge the correct orientation. Insert an M3 lock nut into the recess on the mounting clip – The hexagon shape would allow the lock nut to be press fitted. Fasten a screw through the tab on the mounting plate. Repeat this process for the second tab.

## Assembled Headlight

Take a moment to check your work. The clips should be flush with the tabs on the mounting plate.

![leds_headlight-bracket-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/171/medium640/leds_headlight-bracket-installed.jpg?1541257364)

# NeoPixel Bike Light

## Feather Mount

## Feather Mounting Hardware

The mounting plate for the Feather has four standoffs with M2.5 mounting holes. These line up with the mounting holes on the Feather. Place the PCB over the mounting plate and line up the mounting holes. Use four M2.5 x 5mm flat head metric machine screws to secure the PCB to the mounting plate.

![leds_feather-mount-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/172/medium640/leds_feather-mount-screws.jpg?1541257722)

## Secure Feather to Mounting Plate

Flat head screws feature a chamfered edge. Pan head screws (sometimes called _button heads_) have flat surfaces that require adequate space. The mounting holes on the Feather PCB have very little spacing so a flat head screw is ideal. If a pan head screw is used, it will cover up components like the chip LEDs. We suggest using a M2.5 tapping tool to create threads in the mounting plate.&nbsp;

# NeoPixel Bike Light

## Case Assembly

## Install Box Inputs

The button and toggle switch will be panel mounted to the 3d printed box. Remove the included hardware from them.

![leds_box-inputs.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/176/medium640/leds_box-inputs.jpg?1541259041)

## Install Button

Insert the cables from the button into the large hole on the side of the box. Press the button into the hole until it becomes flush with the surface of the box. Grab the button's hex nut and insert it through the cables. Twist the hex nut onto the threading of the button. Fasten the hex nut until it's fully tightened. A set of needle nose plier can assist in grasping the hex nut.

## Install Switch

Place the toggle switch inside the box and fit the stem of the switch through the smaller hole. Press the stem through so the body of the switch is flush. Insert the washer and hex nut onto the threading of the toggle switch. Hold the toggle switch in place while fastening the hex nut. Fasten until fully tightened. A pair of needle nose pliers can assist in grasping the hex nut.

## Feather Mount Hardware&nbsp;

Two machine screws will be used to secure the Feather mounting plate to the box enclosure. These are M3 x 6mm pan head metric machine screws. Begin to fasten the two screws into the two small holes on the side of the box enclosure until the threading just barely protrudes through the other side.

![leds_box-feather-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/182/medium640/leds_box-feather-screws.jpg?1541259303)

## Install Battery&nbsp;

Inside the box enclosure is a circular clip that is sized for a 2200mAh battery. Grab the battery and begin to work it into the clip. Press the battery through the clip until it's fully enclosed in the box. Allow the JST-PH cable to sit outside the box.

## Secure Feather Mount to Box

Grab the Feather mounting plate and orient it so the two mount holes line up with the ones on the box. The bottom of the mounting plate should face the side of the box with the mounting holes. Insert the mount and begin to push it inside the box with the USB port facing the outside. Reference the photo to get an idea of correct orientation. About halfway through, plug in the battery into the Feather.&nbsp;

## Secure Feather

With the battery now connected, push the rest of the Feather mount into the box enclosure. Take a moment to adjust the wiring from the Feather. Insert and guide the cables so they are fitted nicely inside the box. Line up the mounting holes and fasten the two screws until fully tightened.

![leds_box-feather-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/188/medium640/leds_box-feather-fasten.jpg?1541259319)

## Feather Connections

Grab the JST connections from the Feather, button and switch and pulled them out so they're outside the box. Connect the JST cables with their corresponding cables. Be cautious not to mix up the 2-pin JST-PH connectors as the button and switch have similar connections. Take a moment to follow the wired connections to ensure the cables are going to the right ones. Leave the 3-pin JST-PH connector outside the box as it will be connected to the NeoPixels.

![leds_box-jst-connect.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/189/medium640/leds_box-jst-connect.jpg?1541259467)

## Attach Clips to Box

Grab the two clips for the box ( **bhl-box-clip.stl** ) and begin to attach them to the box enclosure. The box features a railing that allows the clips to slide into them. Orient the clips with the railing and firmly press it into place. Repeat this process for second clip on the opposite end of the box. If the tolerances are too tight, use a filing tool to loosen them up.

## NeoPixel Test

Just as a precaution, go ahead and connect the 3-pin JST-PH cables together and toggle the switch on to test the circuit. The circuit should power on – Make sure the code is uploaded and set to the correct pin on the Feather.

![leds_box-clamps-test.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/193/medium640/leds_box-clamps-test.jpg?1541259729)

# NeoPixel Bike Light

## Bike Assembly

## Bike Frame

Take a moment to consider where you'd like to attach the box. On my bike, I clamped it to the bike frame near the head tube. This way it's away from my knees and easily accessible.

## Attach Box Clips

Grab hold of the tabs and carefully pull them apart to widen the opening. Press the clip onto the framing of the bike (38mm / 1.5in diameter tubing). The clips should clamp onto framing. Insert a M3 x 10mm pan head machine screw through the hole in the tab. Use an M3 nylon lock nut to secure the clips. A socket wrench or pliers can assist in grasping onto the locknut while fastening. Repeat this process for the second clip.&nbsp;

## Bike Handle Bar

Take a moment to consider where you'd like to attach the headlight. On my bike, I attached them to the lower part of the handlebars.

## Attach Headlight Clips

Following a similar process, pull the tabs apart from the headlight clips and clamp it onto the tubing. You might find it easier to do one clip at a time. Use another set of M3 x 10mm screws and M3 lock nuts to secure the clips onto the tubing.&nbsp;

## Final Form

And here's the final assembly! Take a moment to test out the placement of the clips by turning the handle bars, breaking, etc. Make sure the clips, headlight and box enclosure do not obstruct control of the bike – You're safety depends on this, so please consider it. I personally hit my knees a few times on the box enclosure because I placed it in the center of the frame.&nbsp;

![leds_bike-finalForm.jpg](https://cdn-learn.adafruit.com/assets/assets/000/065/238/medium640/leds_bike-finalForm.jpg?1541436984)


## Featured Products

### Adafruit Feather M4 Express - Featuring ATSAMD51

[Adafruit Feather M4 Express - Featuring ATSAMD51](https://www.adafruit.com/product/3857)
It's what you've been waiting for, the Feather M4 Express featuring ATSAMD51. This Feather is fast like a swift, smart like an owl, strong like a ox-bird (it's half ox, half bird, OK?) This feather is powered by our new favorite chip, the **ATSAMD51J19** -&nbsp; with...

In Stock
[Buy Now](https://www.adafruit.com/product/3857)
[Related Guides to the Product](https://learn.adafruit.com/products/3857/guides)
### NeoPixel Ring - 24 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 24 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1586)
Round and round and round they go! 24 ultra bright smart LED NeoPixels are arranged in a circle with 2.6" (66mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

In Stock
[Buy Now](https://www.adafruit.com/product/1586)
[Related Guides to the Product](https://learn.adafruit.com/products/1586/guides)
### NeoPixel Jewel - 7 x 5050 RGB LED with Integrated Drivers

[NeoPixel Jewel - 7 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/2226)
Be the belle of the ball with the NeoPixel Jewel! &nbsp;We fit seven of our tiny&nbsp;5050 (5mm x 5mm) smart RGB LEDs onto a beautiful, round&nbsp;PCB with mounting holes and a chainable design to create what we think is our most elegant (and evening-wear appropriate) NeoPixel board...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2226)
[Related Guides to the Product](https://learn.adafruit.com/products/2226/guides)
### Lithium Ion Cylindrical Battery - 3.7v 2200mAh

[Lithium Ion Cylindrical Battery - 3.7v 2200mAh](https://www.adafruit.com/product/1781)
Need a big battery for your project? This lithium-ion battery contains a 2200mAh and a protection circuit that provides over-voltage, under-voltage, and over-current protection. Yet, it is slim and easy to fit into many project cases.  
  
This cell can provide 2 **C** of...

In Stock
[Buy Now](https://www.adafruit.com/product/1781)
[Related Guides to the Product](https://learn.adafruit.com/products/1781/guides)
### Mini Panel Mount SPDT Toggle Switch

[Mini Panel Mount SPDT Toggle Switch](https://www.adafruit.com/product/3221)
This or that, one or the other, perhaps or perhaps not! So hard to make decisions these days without feeling like you're just going back and forth constantly. Deciding whether or not to use this mini toggle switch? That's the easiest decision you'll make all day!

This...

In Stock
[Buy Now](https://www.adafruit.com/product/3221)
[Related Guides to the Product](https://learn.adafruit.com/products/3221/guides)
### Rugged Metal Pushbutton - 16mm 6V RGB Momentary

[Rugged Metal Pushbutton - 16mm 6V RGB Momentary](https://www.adafruit.com/product/3350)
By popular demand, we now have these buttons with a full color RGB LED ring light! These chrome-plated metal buttons are rugged, but certainly&nbsp;not lacking in flair. Simply drill a 16mm hole into any material up to 1/4" thick and you can fit these in place – there's even a...

In Stock
[Buy Now](https://www.adafruit.com/product/3350)
[Related Guides to the Product](https://learn.adafruit.com/products/3350/guides)
### Silicone Cover Stranded-Core Ribbon Cable - 4 Wires 1 Meter Long

[Silicone Cover Stranded-Core Ribbon Cable - 4 Wires 1 Meter Long](https://www.adafruit.com/product/3891)
For those who are fans of our silicone-covered wires, but are always looking to _up their wiring game_. We now have **Silicone Cover Ribbon cables!** These may look _a lot_ like <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/3891)
[Related Guides to the Product](https://learn.adafruit.com/products/3891/guides)
### JST PH 2-Pin Cable - Female Connector 100mm

[JST PH 2-Pin Cable - Female Connector 100mm](https://www.adafruit.com/product/261)
Red and black tinned wires with a 2-pin JST PH connector on the end. 4" / 100mm long. Matches up nicely with our Lipoly chargers!

[We have the socket 'mating' version of this cable](https://www.adafruit.com/product/3814) over here, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/261)
[Related Guides to the Product](https://learn.adafruit.com/products/261/guides)

## Related Guides

- [Adafruit Feather M4 Express](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51.md)
- [A CLI in CircuitPython](https://learn.adafruit.com/a-cli-in-circuitpython.md)
- [Ethernet for CircuitPython with Wiznet5K](https://learn.adafruit.com/ethernet-for-circuitpython.md)
- [NeoPixel LED Necklace Insert with USB Charging](https://learn.adafruit.com/neopixel-led-necklace-insert-with-usb-charging.md)
- [IoT Air Quality Sensor with Adafruit IO](https://learn.adafruit.com/diy-air-quality-monitor.md)
- [CircuitPython 101: Functions](https://learn.adafruit.com/circuitpython-101-functions.md)
- [Daily Cheer Automaton](https://learn.adafruit.com/daily-cheer-automaton.md)
- [Make It Glow With Crickit](https://learn.adafruit.com/make-it-glow-with-crickit.md)
- [BLE Feather Lamp](https://learn.adafruit.com/ble-feather-lamp.md)
- [CircusPython: Jump through Hoops with CircuitPython Bluetooth LE](https://learn.adafruit.com/circuspython-jump-through-hoops-with-bluetooth-le.md)
- [STEMMA Lego base plates](https://learn.adafruit.com/stemma-lego-base-plates.md)
- [Use circup to easily keep your CircuitPython libraries up to date](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup.md)
- [Guardian Shield+ Zelda Breath of the Wild](https://learn.adafruit.com/guardian-shield-zelda-breath-of-the-wild.md)
- [I Vote(d) Pin](https://learn.adafruit.com/i-vote-d-pin.md)
- [LED Protest Sign](https://learn.adafruit.com/led-protest-sign.md)
- [Mario Magic Wand](https://learn.adafruit.com/mario-magic-wand.md)
