Maker.io main logo

Trinket NeoPixel LED Longboard

2017-07-31 | By Adafruit Industries

License: See Original Project 3D Printing

Courtesy of Adafruit

Guide by Ruiz Brothers

Overview

 

 

Upgrade your ride with NeoPixel LEDs. In this project we're upgrading a longboard with more neopixels, making a very bright and safe summer night ride!

Upgrade your ride with NeoPixel LEDs

In this project, we're going to use the Trinket micro-controller to power 100 NeoPixel LEDs with a Powerboost 500C and a 2500mAh lithium polymer battery.

Project Components

Parts

Tools & Supplies

Prerequisite Guides

3D Printing

Download the parts for this project on Thingiverse or Autodesk 123D Design. The original solids are available for customization so you can tweak the parts to fit your ride. The parts will print on any FDM 3D printer with a build area of 100mm x 100mm x 100mm.

Download STLs

PLA Material

We recommend printing the parts in PLA filament using your preferred slicing software with the recommended settings below.

PLA Material

3D Printing

Support Material

The trinket-box.stl part has geometry that requires support material in order to print properly. We recommend using a pair of flat pliers for removing the support material.

Use a pair of flat pliers to remove support material

Removal Technique

Use the pliers to get a good hold on the support material. Pinch it tightly, twist, and pull it out to easily remove the support material as one whole chunk as oppose to bit by bit.

Circuit Diagram

Circuit Diagram

Follow the illustration above and to reference how all the components are connected. The diagram isn't to scale and doesn't display how the circuit show actually looks like. The actual circuit is much more condensed and has rather lengthy wiring!

Below is a list of the components pin outs.

  • Powerboost 500C to Trinket
  • Male JST to Female JST
  • Powerboost 500C to Switch
  • ENGND 
  • Trinket 5V to NeoPixel Strip
  • GND to GND, BAT to 5V, #0 to DIN
  • NeoPixel Strip to NeoPixel Ring
  • GND to GND, 5V to 5V, DO to IN
  • Battery to Powerboost 500C
  • Male JST to Female JST

Software

Configure Trinket for Arduino

Install the proper modifications and libraries to your installation of Arduino to configure the Trinket.

Configure Trinket 

Uploading Code to Trinket with Arduino

Copy and paste the code below into a new sketch in Arduino. Select Trinket 5V 8Mhz board from the Tools menu. Plug in a USB cable from the trinket to your computer. Make sure your programmer is set to USBtinyISP before you upload the code to the Trinket. Hit the upload code while the red LEDs are blinking on the Trinket.

Copy Code
#include <Adafruit_NeoPixel.h>

#define PIN 0

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(54, PIN);

uint8_t mode = 1, // Current animation effect
offset = 0; // Position of spinny eyes
uint32_t color = 0x00ff96; // Start red
uint32_t prevTime;

void setup() {
pixels.begin();
pixels.setBrightness(50); // 1/3 brightness
prevTime = millis();
}

void loop() {
uint8_t i;
uint32_t t;

switch(mode) {

case 0: // Random sparks - just one LED on at a time!
i = random(20);
pixels.setPixelColor(i, color);
pixels.show();
delay(10);
pixels.setPixelColor(i, 0);
break;

case 1: // Spinny wheels (8 LEDs on at a time)
for(i=0; i<54; i++) {
uint32_t c = 0;
if(((offset + i) & 7) < 4) c = color; // 4 pixels on...
pixels.setPixelColor( i, c); // First eye
pixels.setPixelColor(31-i, c); // Second eye (flipped)
}
pixels.show();
offset++;
delay(90);
break;
}

t = millis();
if((t - prevTime) > 8000) { // Every 8 seconds...
mode++; // Next mode
if(mode > 1) { // End of modes?
mode = 1; // Start modes over
color >>= 0 ; // Next color R->G->B
if(!color) color = 0x00ff96; // Reset to red
}
for(i=0; i<54; i++) pixels.setPixelColor(i, 0);
prevTime = t;
}
}

 

Customization

Some values to look for when adapting the sketch to your project are the number of pixels. Searching for "54" and replacing that value with whatever number of pixels are used your project is a good start. The color is conveniently formatted in HEX, "00ff96" makes a teal color. The duration of the animation can be changed by adjusting the delay "90" which is in measured in milliseconds.

Components

Trinket 5V micro-controller

Trinket 5V

The Trinket 5V micro-controller runs code that will animate the NeoPixel Strips and NeoPixel Rings. The Trinket has enough memory to power about 100 NeoPixels. To power the Trinket, we'll use a lithium polymer battery. Most of our lithium polymer batters have JST connectors. The Trinket doesn't have a JST connector on board, so we'll have to solder one on!

Add solder to the +Postive and -Negative pads

Tin Trinket

Secure the trinket upside down to a Panavise Jr. or third helping hand. This helps you tremendously while soldering! Add solder to the +Postive and -Negative pads on the back of the Trinket, right below the USB port.

JST extension cable

Trinket JST Connector

Measure a JST extension cable to about double the length of the Trinket and cut the cable. Use wire strippers to strip the ends of wires with the female JST connector. Solder the positive and negative wires to the bottom of the trinket where the positive and negative pads are tinned with solder.

Grab three female jumper cables

Prep Trinket + Jumper Cables

Add a bit of solder to the GND, BAT, and #0 Pins on the Trinket. Grab three female jumper cables and snip off one of the ends. Use wire strippers to expose the tip of the wires.

Solder the jumper cables to #0, GND, +BAT pins

Solder Jumpers to Trinket

Solder the three jumper cables to the #0, GND, +BAT pins on the Trinket.

The power boost 500C

PowerBoost 500C

The power boost 500C will provide enough current to power the NeoPixel strips and rings. We can get about 100 NeoPixel LEDs to animate properly at full brightness. The Powerboost 500C also has an on-board lipoly charger so you can recharge a lithium polymer battery over USB.

Grab the other half of the JST extension cable

PowerBoost 500C JST

Grab the other half of the JST extension cable with the male connector and strip the negative and positive wires. Solder the wires to the +positive and -negative pins on the Powerboost 500C.

Measure/cut 3 strips of wire to about 30mm in length

Slide Switch Wires

Measure and cut 3 strips of stranded wires to about 30mm in length. Expose the ends of the wires using wire strippers.

Solder Wires to Slide Switch

Solder Wires to Slide Switch

Secure the slide switch to the Panavise Jr. Use a third helping hand to hold one of the wires up against one of the terminals. Once the wire and the terminal are secured and touching, add the soldering iron to the terminal, and solder it while they're both in place.

Seal the soldered connections with heat shrink tubing

Shrink Tube Slide Switch

Seal off the soldered connections by slipping on some pieces of heat shrink tubing. Just add heat to shrink!

Bundle the wires/thread into slide switch opening

Install Slide Switch

Bundle the 3 wires and thread them through the slide switch opening in the enclosure (trinket-box.stl). Carefully fit the slide switch through the opening and snap it into place.

Fit slide switch through opening and snap into place

Secure Slide Switch

Add some E600 to the top and sides of the slide switch to permanently secure it to the enclosure.

Strip other end of the wires/solder to the PowerBoost

Solder Slide Switch Wiring to PowerBoost

With the slide switch installed to the enclosure, strip the other end of the 3 wires, and solder them into the PowerBoost 500C following pins.

EN, GND, VBAT

secure the end of the NeoPixel strip

NeoPixel Strips

Use a Panavise Jr. to secure the end of the NeoPixel strip with the arrow pointing out towards the right. Snip off the end if wires are soldered on. Tin the three pads with solder.

Grab 3 male jumper cables

Solder Jumpers to NeoPixel Strip

Grab 3 male jumper cables and snip off one of the ends of each. Strip the wires and solder them onto the GND, DIN, and 5V pins of the strip.

Tin the 4 pins, GND, DIN, D0UT, and PWR

Tin NeoPixel Rings

Secure the 16x NeoPixel ring in place with a Panavise. Tin the 4 pins, GND, DIN, DOUT, and PWR.

Solder one wires to each of the 4 pins

First NeoPixel Ring

Cut six strands of wire wrap and strip the ends. Solder one wire to each of the 4 pins on the NeoPixel Ring. GND and PWR pins will need two wires soldered to them.

Group the GND, DOUT, and PWR wires

Thread First NeoPixel Wiring

Group the GND, DOUT, and PWR wires together and carefully thread them through the hole in the left eye of the neoring-holder.stl part.

remaining wires should be GND, PWR and DIN

NeoPixel Input Wiring

The remaining wires should be GND, PWR, and DIN. These three need to be threaded through the slit on the back of the neoring-holder.stl part.

Carefully tuck the wiring to the inside of the cavity

Fit NeoPixel Ring Wiring

Carefully tuck the wiring to the inside of the cavity on the neoring-holder.stl part.

Gently place NeoPixel Ring in cavity w/o kinking wires

Install First NeoPixel Ring

Gently insert the NeoPixel Ring into the cavity without kinking the wiring. Press it down into place once the wires are tucked inside the neoring-holder.stl part.

Position the second NeoPixel ring

Second NeoPixel Ring

Position the second NeoPixel ring over the neoring-holder.stl upside down and thread the three wires into the Ground, 5V, and Data Input pins.

Leave a bit of slack for each wire

Solder Second NeoPixel Ring

Leave a bit of slack for each wire and cut to shorten them. Use a third helping hand to secure the NeoPixel ring in place while you solder the wires to the GND, 5V, and DI pins.

NeoPixel Rings should have a really tight fit

Chained NeoPixel Rings

The NeoPixel Rings should have a really tight fit in the neoring-holder.stl part. If you ever need to remove the rings from the housing, you totally can! Use a flat head screwdriver, knife, or blade to lift up the PCB from out the housing.

gently tuck the wiring inside the holder

Install Second NeoPixel Ring

Just like the first ring, gently tuck the wiring inside the holder, and carefully snap the ring into place.

Make sure you don

No Kinks!

Make sure you don't kink any of the wires, it's very thin wiring that's easy to damage. Use a paperclip or similar to tuck any excess wires inside the cavity.

The NeoPixel rings are now installed into the housing

Installed NeoPixel Rings

The NeoPixel rings are now installed into the housing. Looks like a pair of glasses, doesn't it?

thread the wires from neopixel ring through center

NeoPixel Ring Adapter

Grab the neoring-adapter.stl part and thread the three wires from the neopixel ring through the center of the hole.

Line up the neoring  adapter with neoring holder

Thread Wires through Adapter

Line up the two holes on the neoring-adapter.stl part with the neoring-holder.stl part and make sure they're touching on the flat sides.

Join together parts/line up the two mounting holes

Install Adapter to Ring Holder

Join together the parts and line up the two mounting holes.

While holding them together, insert screws and fasten

Secure Adapter to Ring Holder

While holding the two parts together, insert screws, and fasten them to join them together. Use 2 #4 3/8' flat Phillips screws.

remove one end of the clip holder

Prep Jumper Cables for NeoPixel Rings

Grab three female jumper cables and remove one end of the clip holder with a thin tool like an xacto knife or flat screw driver. Repeat for the 3 wires.

Add solder to inside of exposed female jumper cable

Tin Jumper Cables

Add a bit of solder to the inside of the exposed female jumper cable. Slip on the covers that were removed from the female jumper cables onto the three wires of the NeoPixel Ring.

wires from NeoPixel get soldered to jumper cables

Solder Wire Wrap to Jumper Cables

The three wires from the NeoPixel ring will be soldered to these jumper cables. Heat up the jumper cable that has a bit of solder and insert the wire wrap into the exposed female jumper cable while it's heated up.

Slide plastic covers back onto the jumper cables

Seal Wire Connections

Slide each of the plastic covers back onto the jumper cables and make sure they clip back into place.

NeoPixel rings are now ready to be wired

NeoPixel Rings w/ Jumpers

The pair of NeoPixel rings are now ready to be wired. The next page walks through the wiring.

Test Circuits

test the components to ensure the circuit is working

Before finalizing the assembly, it's a good idea to test the components to ensure the circuit is working before we close it up.

Test Trinket

Plug in a JST male connection from a charged Lithium Polymer battery to the female JST connector that was soldered on the Trinket. If the LED power on, that means it works and is ready for NeoPixel power!

Test PowerBoost + Switch

Connect the battery to the JST connector on the Powerboost 500C. Flip the slide switch and see if it the blue LED powers on.

Test NeoPixel Strip

Grab the NeoPixel Strip and Trinket. Ensure you have code loaded onto the Trinket. Connect the 3 male jumpers from the NeoPixel strip to the female jumpers on the Trinket. GND to GND, PWR to +Bat and DIN to #0. Power the Trinket on with USB or battery and check to see if the LED's power on.

Test NeoPixel Rings

Connect the 3 female jumper cables of the neopixel ring to the 3 male jumper cables on the Trinket. GND to GND and PWR to +Bat and DIN to #0. Power the Trinket on with USB or battery and check to see if the LED's power on.

Assembly

Mount Powerboost 500C to Enclosure

Mount Powerboost 500C to Enclosure

Position the Powerboost over the trinket-cover.stl part and line up the end of the USB port with the mounting holes that line up with the ones on the power boost. Insert 2 #4 3/8' flat Phillips screws and fasten them into place.

Mount Trinket to Enclosure

Mount Trinket to Enclosure

Position the Trinket over the trinket-cover.stl part and align up the end of the USB with the mounting holes that align up with ones on the trinket. Insert 2 #4 3/8' Phillips screws and fasten them into place.

Mounted Trinket + PowerBoost 500C

Mounted Trinket + PowerBoost 500C

The Trinket and Powerboost 500C are securely mounted to the trinket-cover.stl part. Now they won't move around while skating!

Install Battery into Enclosure

Install Battery into Enclosure

Grab the 2500mAh lithium polymer battery and position inside the trinket-box.stl part at an angle with one end going into the opposite end of the slide switch. It should have some wiggle room.

Connect Battery to PowerBoost 500C

Connect Battery to PowerBoost 500C

Plug in the male JST connector from the 2500mAh lithium polymer battery to the female JST connector on the PowerBoost 500C.

Connect PowerBoost 500C to Trinket

Connect PowerBoost 500C to Trinket

Plug in the male JST connector from the PowerBoost 500C to the female JST connector on the Trinket.

Expose Trinket Output Jumpers

Expose Trinket Output Jumpers

Move the three female jumper cables from the trinket to the slit and hole of the enclosure.

Closing Enclosure

Closing Enclosure

With the Battery placed inside the enclosure and the components mount to the cover, join the cover and enclosure. Carefully tuck the wiring inside the enclosure.

Check to ensure the micro USB port is aligned

PowerBoost 500C USB

Check to ensure the micro USB port is aligned up to the port opening in the enclosure.

Check that the mini USB port is lined up

Trinket USB

Check that the mini USB port is lined up with the port opening in the enclosure.

Place cover over enclosure/line up mounting holes

Mount Cover to Enclosure

Place the cover over the enclosure and line up the mounting holes that are located on the four corners. Use 4 #6 1/2' Phillips screws to secure the trinket-cover.stl part to the trinket-box.stl part.

Attach the slide-lock-mount.stl part

Install Sliding Lock Mount to Board

Attach the slide-lock-mount.stl part to the bottom of your board with either E6000 adhesives or double-sided foam tape.

Install Sliding Lock Clip to Enclosure

Install Sliding Lock Clip to Enclosure

Insert 2 #6 1/2' flat Phillips screws into the slide-lock-clip.stl part. Fasten the screws until the thread is flush with the bottom. Position the part over to the top of the enclosure and line up the screws with the holes on the enclosure. Fasten the screws until the two part are secured.

Position clip into mount

Sliding Lock

To mount the enclosure to the sliding lock, position the clip into the mount and pinch the two legs together and push the part through. To remove the enclosure, pinch the two legs together and pull the part out. A lot like a belt clip or GoPro mount, right?

Mount NeoPixel Strips to Board

Mount NeoPixel Strips to Board

Two options for mounting the NeoPixel strips to the bottom of the board. Vertically or horizontally. The vertical(tall) position allows the light to spread further across while the horizontal(flat) position illuminates the bottom of the board.

Secure NeoPixel Strip Wiring

Secure NeoPixel Strip Wiring

Neatly bundle up the access wiring from the strip.

Install Ring Mount to Trucks

Install Ring Mount to Trucks

Position the neoring-holder.stl to the neoring-mount.stl and line up the mount holes. Mount the neoring-mount.stl part to the front of the trucks by inserting the part with the opening facing the side of the trucks. The two fixtures with the holes should face the front of the trucks.

Secure Ring Mount to Trucks

Secure Ring Mount to Trucks

Use a #6-32 3/4' Phillips screw to secure the neoring-mount.stl to the trucks.

Install Ring Holder to Truck Mount

Install Ring Holder to Truck Mount

Position the neoring-adapter.stl part and to the neoring-mount.stl part. Join the two parts with the mounting holes together.

Secure Ring Holder to Truck Mount

Secure Ring Holder to Truck Mount

Insert a #6-32 3/4' flat Phillips machine screw and fasten it together to secure the neoring-holder.stl to neoring-mount.stl parts.

Install the NeoPixel Ring diffusers

Add Diffusers

Install the NeoPixel Ring diffusers, neoring-cap-a.stl and neoring-cap-a.stl onto the neoring-holder.stl part.

Secure NeoPixel Ring Wiring

Secure NeoPixel Ring Wiring

Group up the excess jumper cables and secure them down to the edge of the truck risers. For a more permeant method, apply E6000 adhesive or hot glue. Black electrical tape is only temporally.

Connect Jumpers To Trinket

Connect Jumpers To Trinket

With the enclosure locked to the mount, connect the male jumper cables from the strip input to the female jumper cables on the trinket.

  • Trinket 5V to NeoPixel Strip
  • GND to GND
  • BAT to 5V
  • #0 to DI

Connect Strip + Ring Jumpers

Connect Strip + Ring Jumpers

With the ring holder mounted to the trucks, connect the female jumpers from the NeoPixel Ring to the male jumper cables coming from the output of the NeoPixel Strip.

  • NeoPixel Strip to NeoPixel Ring
  • GND to GND
  • 5V to 5V
  • DOUT to DIN

NeoPixel Rings are installed to the trucks

NeoPixel Ring Headlights

The NeoPixel Rings are installed to the trucks and ready for a nightly skate session!

Slide the switch on and light up your skate session

NeoPixel Power!

Slide the switch on and light up your nightly skate session!

制造商零件编号 1463
ADDRESS LED RING SERIAL RGB
Adafruit Industries LLC
¥83.84
Details
制造商零件编号 1460
ADDRESS LED STRIP SERIAL RGB 5M
Adafruit Industries LLC
¥714.08
Details
制造商零件编号 1944
RECHARGEABLE 5V LIPO USB BOOST
Adafruit Industries LLC
¥121.69
Details
制造商零件编号 1501
TRINKET 5V ATTINY85 EVAL BRD
Adafruit Industries LLC
¥56.57
Details
制造商零件编号 EG1218
SWITCH SLIDE SPDT 200MA 30V
E-Switch
¥7.24
Details
制造商零件编号 2163
SOLDERING IRON 50W 120V
Adafruit Industries LLC
¥309.46
Details
制造商零件编号 24-6040-0010
SOLDER RA 60/40 24AWG 1LB
Kester Solder
¥934.74
Details
制造商零件编号 1446
WIRE WRAP THIN PROTOTYPING & REP
Adafruit Industries LLC
¥62.93
Details
制造商零件编号 759
JUMPER WIRE M/M 2.950" 1PC
Adafruit Industries LLC
¥32.15
Details
制造商零件编号 794
JUMPER WIRE F/F 2.950" 1PC
Adafruit Industries LLC
¥32.15
Details
制造商零件编号 1131
JST-PH BATTERY EXT CABLE
Adafruit Industries LLC
¥15.87
Details
制造商零件编号 45812
PUNCHES ELEC FLAT NOSE 6.3"
Wiha
More Info
Details
制造商零件编号 JIC-2030
WIRE STRIPPER 20-30 AWG
Jonard Tools
¥111.25
Details
制造商零件编号 201
VISE 2.88" GROOVED JAWS
Panavise
¥287.04
Details
制造商零件编号 291
MAGNIFIER STAND 2.5" 4X
Adafruit Industries LLC
¥62.53
Details
制造商零件编号 Q2-F-1/16-01-QB48IN-25
HEATSHRINK 1/16" X 4' BLK 1=1PC
Qualtek
¥4.13
Details
制造商零件编号 75999
BIT SET ASSORTED W/CASE 26PC
Wiha
More Info
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum