Maker.io main logo

LED Cylon Scooter

2022-04-15 | By bekathwia

License: Attribution Non-commercial

prototyping

 

It was easy to add a chasing LED animation to the grille of my 80s Honda Elite scooter. Now it looks like something out of Knight Rider or Battlestar Galactica.

Supplies for this project:

 

To keep up with what I’m working on, follow me on YouTubeInstagramTwitterPinterest, and subscribe to my newsletter.

circuit diagram

The strip is adhered to the inside of the grille using silicone adhesive, and the Trinket's power and ground connections are routed to the scooters power. There's a toggle switch on the power wire, mounted under the dashboard to easily turn the system on and off.

inside the finished grille

 I used Phil B.'s rock-solid larson scanner code for Arduino, adjusting the number of pixels to match my strip:

 

Copy Code
// Larson Scanner by Phil Burgess: 
// https://learn.adafruit.com/larson-scanner-shades?view=all

#include <Adafruit_NeoPixel.h>

#define N_LEDS 31
#define PIN 4

Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, PIN, NEO_GRBW + NEO_KHZ800);

void setup() {
strip.begin();
}

int pos = 0, dir = 1; // Position, direction of "eye"

void loop() {
int j;

// Draw 5 pixels centered on pos. setPixelColor() will clip any
// pixels off the ends of the strip, we don't need to watch for that.
strip.setPixelColor(pos - 2, 0x100000); // Dark red
strip.setPixelColor(pos - 1, 0x800000); // Medium red
strip.setPixelColor(pos , 0xFF3000); // Center pixel is brightest
strip.setPixelColor(pos + 1, 0x800000); // Medium red
strip.setPixelColor(pos + 2, 0x100000); // Dark red

strip.show();
delay(30);

// Rather than being sneaky and erasing just the tail pixel,
// it's easier to erase it all and draw a new one next time.
for(j=-2; j<= 2; j++) strip.setPixelColor(pos+j, 0);

// Bounce off ends of strip
pos += dir;
if(pos < 0) {
pos = 1;
dir = -dir;
} else if(pos >= strip.numPixels()) {
pos = strip.numPixels() - 2;
dir = -dir;
}
}

 

To read more about this project, head over to my website. To build your own, check out the following Digi-Key supplies:

制造商零件编号 3500
TRINKET M0 ATSAMD21E18 EVAL BRD
Adafruit Industries LLC
制造商零件编号 1506
ADDRESS LED STRIP SERIAL RGB 1M
Adafruit Industries LLC
制造商零件编号 PN08019
MARINE GRADE SILICONE SEALANT CL
3M
制造商零件编号 MN35
DIGITAL MINI MULTIMETER
FLIR Extech
制造商零件编号 11228-00000-100
3M VIRTUA PROTECTIVE EYE 1=1PC
3M
制造商零件编号 WBNCC633731-2OZ
NO-CLEAN FLUX CORE SOLDER, 63/37
SRA Soldering Products
制造商零件编号 3019
THIRD HAND PANA HAND WORKSTATION
Adafruit Industries LLC
制造商零件编号 3132-22-1-0500-004-1-TS
HOOK-UP STRND 22AWG 300V RED 25'
CNC Tech
制造商零件编号 3132-22-1-0500-001-1-TS
HOOK-UP STRND 22AWG 300V BLK 25'
CNC Tech
制造商零件编号 3132-22-1-0500-003-1-TS
HOOK-UP STRND 22AWG 300V YEL 25'
CNC Tech
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