# Larson Scanner Shades (Trinket-Powered NeoPixel LED Strip Glasses)

## Overview

_We must repeat!_ Our “[Kaleidoscope Eyes](http://learn.adafruit.com/kaleidoscope-eyes-neopixel-led-goggles-trinket-gemma/overview "Link: http://learn.adafruit.com/kaleidoscope-eyes-neopixel-led-goggles-trinket-gemma/overview")” goggles project was so popular that we wanted an easier option for newcomers to electronics. These “Larson Scanner” shades offer a lot of bling with fewer parts and less tricky connections. _Freedom of choice is what you got!_  
![](https://cdn-learn.adafruit.com/assets/assets/000/011/053/medium800thumb/led_strips_shades-anim.jpg?1448311194)

The _Larson scanner_ is named after Glen Larson, producer of _Knight Rider_ and the original _Battlestar Galactica_ television series, both of which prominently featured the effect as the “eyes” of KITT, his nemesis KARR, and the Cylon Centurions.  
  
Larson scanners were traditionally red (or yellow in KARR's case), but thanks to the magic of NeoPixels you can change the software to use any colors you like.

Info: 

# Tools Needed
**This is a soldering project,** albeit a small one. You will need the common soldering paraphernalia of a soldering iron, solder, wire (20 to 26 gauge, either stranded or solid) and tools for cutting and stripping wire.   
  
You’ll need some method of securing the electronics inside the glasses. Hot-melt glue (with a glue gun) works well for this. Watch your fingers! Packing tape could also be used. # Parts needed

- **Visor-style sunglasses** — the 1980’s style with a single “unibrow” rather than separate lenses. A well-stocked costume store may have something suitable, or you can search eBay for “robot sunglasses,” “Devo sunglasses” or “alien sunglasses.”
- **NeoPixel RGB LED flex strip:** [**144**](http://www.adafruit.com/products/1507), [**60**](http://www.adafruit.com/products/1138) or [**30**](http://www.adafruit.com/products/1376) LEDs/meter depending on your budget and desired look. This project only requires a short section — you can either make several pairs of glasses from the strip, or use the leftovers for other projects (it’s fun stuff to play with!). The photo above is using 144 LEDs/meter NeoPixel strip.
- Adafruit's [Trinket M0](https://www.adafruit.com/product/3500) or [Gemma M0](https://www.adafruit.com/product/3501) **&nbsp;** are&nbsp;recommended.&nbsp; The legacy versions&nbsp;[Trinket 3.3v](https://www.adafruit.com/product/1500), [Trinket 5v](https://www.adafruit.com/product/1501) and [Gemma v2](https://www.adafruit.com/product/1222)will also work.&nbsp;
- **[3.7V 150mAh Lithium-Ion Polymer Battery](http://www.adafruit.com/products/1317)**
- **[LiPo battery charger](http://www.adafruit.com/products/1304)**
- **[JST Battery Extension Cable](http://www.adafruit.com/products/1131)** (not required if using Gemma)

![](https://cdn-learn.adafruit.com/assets/assets/000/011/054/medium800/led_strips_2shades.jpg?1379707511)

There are lots of eyeglass options on eBay for $20 or less. We settled on the pair on the right because they pass more light (the LEDs will appear brighter). Ski or motocross goggles could also work!

### 

Absolutely! You won’t need the extra JST cable for the LiPo battery — Gemma has that plug built-in. The board is a bit wider and might be more challenging to fit, but one option is to _show it off_ rather than conceal it, mounting the board on the _outside_ of the glasses near one temple. Geek pride!

# Larson Scanner Shades (Trinket-Powered NeoPixel LED Strip Glasses)

## Wiring & Soldering

Begin by measuring how many LEDs your sunglasses will need. It’s easiest just to hold the strip behind the glasses and slide it around to settle on a position, then count the LEDs. Try to place the LEDs _above_ center, toward your forehead…this way they’ll block less of your field of view.  
  
Using the high-density NeoPixel strip (144 LEDs/meter), one of our pairs of glasses required 20 LEDs, another required 22. The 60 and 30 LEDs/meter strip would have proportionally fewer LEDs.

NeoPixel strip has a definite “in” and “out” end. Look for the arrows — these indicate the direction of data from the microcontroller, moving from _in_ to _out._  
  
The Trinket/Gemma board will connect to the “in” end…that would be to the _left_ in this view.

![led_strips_direction.jpg](https://cdn-learn.adafruit.com/assets/assets/000/011/057/medium640/led_strips_direction.jpg?1379720618)

If using the high-density strip (144 LEDs/meter), you might choose to cut just to the left of the marked cut lines. When using the remainder of the strip in another project, this makes it easier to connect wires to the input.  
  
This doesn’t apply to 60 or 30 LEDs/m strip — these have connection points on both sides of the cut line.

![led_strips_clip.jpg](https://cdn-learn.adafruit.com/assets/assets/000/011/058/medium640/led_strips_clip.jpg?1379721090)

Flush cutters work well for cutting the strip. You might need to make two cuts to cover the full width; one from below, one from above.

![led_strips_cutting.jpg](https://cdn-learn.adafruit.com/assets/assets/000/011/059/medium640/led_strips_cutting.jpg?1379721106)

 **Optional:** I’m not comfortable with little sharp points right next to my eyes. The strip will certainly hold in place when installed, but as an extra precaution the corners were rounded slightly at both ends of the strip. Just in case.  
![led_strips_rounded.jpg](https://cdn-learn.adafruit.com/assets/assets/000/011/060/medium640/led_strips_rounded.jpg?1379721128)

The vias (wire holes) on the strip are very tiny! When connecting wires, you might find it necessary to widen these holes slightly by inserting the point of a pair of tweezers and turning.  
  
The circuit is incredibly simple, with just a few connections needed…  
  
**If using Trinket:** Though data moves only one way through a NeoPixel strip, power transfers <u>both</u> ways. We use this to our advantage here, making the _strip itself_ function as a power bus for the whole circuit. Cut the JST battery extension cable about 4" (10 cm) from the plug end (the end that connects with the battery). Strip the ends of the wires, give them a twist and then insert them anywhere along the strip; black wire to –, red wire to +, and solder in place.  
  
The wires should be inserted back to front (soldered on the LED side); the diagram below has the wires on the front just to show how they’re routed.  
  
At the **input** end of the strip, three wires are then connected between the strip and Trinket board: **–** (minus) on the strip to **Gnd** on Trinket, **+** on the strip to **3V** (or **5V** ) on Trinket, and the remaining connection to Pin **#4** on Trinket.  
  
**If using 60 or 30 LEDs/meter NeoPixel strip** , the connections are in a different order than shown here, and are labeled **GND** , **+5V** and **DIN** (rather than –, + and unmarked, respectively).

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/011/055/medium800/led_strips_larson-diagram-trinket.png?1379720352)

Gemma is even easier. There’s already a JST connector on this board, so clipping a plug off a battery extension isn’t needed. Just connect **–** (minus) on the strip to **GND** on Gemma, **+** to **Vout** , and the remaining pin to **D1**.  
  
If using 60 or 30 LEDs/meter strip, the note above about pin order applies to Gemma as well.

![](https://cdn-learn.adafruit.com/assets/assets/000/011/056/medium800/led_strips_larson-diagram-gemma.jpg?1379720368)

With the glasses we built upon, Trinket fit perfectly turned 90 degrees with respect to the strip (like the wiring diagram above) — the USB connector is then accessible along the top edge, for loading new code. But every pair of shades will be different. You’ll probably want to use longer wires between the Trinket and strip, so you have more options when folding the pieces together; I just got carried away here with the ultra-short wires.

![](https://cdn-learn.adafruit.com/assets/assets/000/011/061/medium800/led_strips_front.jpg?1379721655)

Reiterating a prior point: wires are run along the <u>back</u> side of the strip, and soldered on the front.  
  
After soldering, all of the protruding wire points were trimmed.

![](https://cdn-learn.adafruit.com/assets/assets/000/011/062/medium800/led_strips_back.jpg?1379721670)

# Larson Scanner Shades (Trinket-Powered NeoPixel LED Strip Glasses)

## Arduino Code

Info: 

If this is your first time using Trinket or Gemma, work through the guides first:

- [Adafruit Trinket M0 Guide](../../../../adafruit-trinket-m0-circuitpython-arduino/guided-tour)
- [Adafruit Trinket Guide](../../../../introducing-trinket/guided-tour?view=all)
- [Adafruit Gemma M0 Guide](../../../../adafruit-gemma-m0/guided-tour?view=all)
- [Adafruit Gemma Guide](../../../../introducing-gemma/introduction)

You need to customize some settings in the Arduino IDE. Once you have it up and running (test the 'blink' sketch), then download and install the NeoPixel library:

[Click to download the NeoPixel library](https://github.com/adafruit/Adafruit_NeoPixel/archive/master.zip)
Installing Arduino libraries is a frequent stumbling block. If this is your first time, or simply needing a refresher, please read the [All About Arduino Libraries](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use) tutorial.

If the library is correctly installed (and the Arduino IDE is restarted), you should be able to navigate through the “File” rollover menus as follows:  
  
**File→Sketchbook→Libraries→Adafruit\_NeoPixel→strandtest**  
  
You’ll need to change one line in this code. If using Trinket, change line #4 to:

```
#define PIN 4
```

And for Gemma, use:

```
#define PIN 1
```

From the **Tools→Board** menu, select **Adafruit Trinket 8 MHz** or **Adafruit Gemma** as appropriate. Connect the USB cable between the computer and Trinket, press the reset button on the board, then click the upload button (right arrow icon) in the Arduino IDE. When the battery is connected, you should get a light show from the LEDs.  
  
If that’s working, you can then copy and paste this Larson scanner code into a new sketch. Change N\_LEDS to match the number of LEDs in your strip, and if using Gemma change PIN to 1. Upload and get ready to be a Cylon!

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Larson_Scanner_Shades/Larson_Scanner_Shades.ino

This code works equally well on an Adafruit **Hallowing** board with a NeoPixel strip plugged into the NEOPIX port. Just change the number on the “N\_LEDS” line to match your strip length. No need to change PIN, the default (4) already matches the NeoPixel connector on this board.

# Larson Scanner Shades (Trinket-Powered NeoPixel LED Strip Glasses)

## CircuitPython Code

![](https://cdn-learn.adafruit.com/assets/assets/000/048/315/medium800/led_strips_gemma-cp.jpg?1511059275)

 **GEMMA&nbsp;M0** &nbsp;and **Trinket M0&nbsp;** boards can&nbsp;run&nbsp; **CircuitPython** &nbsp;— a different approach to programming compared to Arduino sketches. In fact,&nbsp; **CircuitPython comes&nbsp;factory pre-loaded on GEMMA&nbsp;M0 and Trinket M0**. If you’ve overwritten it with an Arduino sketch, or just want to learn the basics of setting up and using CircuitPython, this is explained in the&nbsp;**[Adafruit GEMMA&nbsp;M0](../../../../adafruit-gemma-m0/circuitpython-setup-1)**[guide](../../../../adafruit-gemma-m0/circuitpython-setup-1)&nbsp;and&nbsp;the [**Adafruit** &nbsp;](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiK-__azsnXAhWFsVQKHeLhDgcQFgg8MAA&url=https%3A%2F%2Flearn.adafruit.com%2Fadafruit-trinket-m0-circuitpython-arduino%2Foverview&usg=AOvVaw1KR3kAPHYx-DXtGZjUQX60)**[Trinket M0 guide](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiK-__azsnXAhWFsVQKHeLhDgcQFgg8MAA&url=https%3A%2F%2Flearn.adafruit.com%2Fadafruit-trinket-m0-circuitpython-arduino%2Foverview&usg=AOvVaw1KR3kAPHYx-DXtGZjUQX60).**

Info: 

Below is CircuitPython code that works&nbsp;similarly (though not exactly the same) as the Arduino sketch shown on a prior page. To use this, plug the GEMMA M0 or Trinket M0 into USB…it should show up on your computer as a small&nbsp; **flash drive** …then edit the file “ **main.py** ” with your text editor of choice. Select and copy the code below and paste it into that file,&nbsp; **entirely replacing its contents** &nbsp;(don’t mix it in with lingering bits of old code). When you save the file, the code should&nbsp; **start running almost immediately** &nbsp;(if not, see notes at the bottom of this page).

**If GEMMA M0 or Trinket M0 doesn’t show up as a&nbsp;drive, follow the GEMMA M0 or Trinket M0 guide link above to prepare the board for CircuitPython.**

You’ll need to change one line #6 which represents the output pin that controls the NeoPixels.

If using **Trinket M0** :

```
pixpin = board.D4
```

If using **GEMMA M0** :

```
pixpin = board.D1
```

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Larson_Scanner_Shades/code.py

This code can also work on an Adafruit Hallowing board with just a small change to lines 6 and 7:

```
numpix = 30
pixpin = board.EXTERNAL_NEOPIXEL
```

# Larson Scanner Shades (Trinket-Powered NeoPixel LED Strip Glasses)

## Final Assembly and Use

Arts & crafts time!

The electronics can be held in place temporarily with masking tape while a more permanent bond is arranged…

![led_strips_masking.jpg](https://cdn-learn.adafruit.com/assets/assets/000/011/063/medium640/led_strips_masking.jpg?1379726176)

 A few strategic dabs of hot-melt glue then hold the strip, Trinket, wires and JST plug in place. The latter gets a sizable glop, since the battery will be plugged and unplugged repeatedly here. Once the glue is fully set, the masking tape can be removed.  
  
Hot melt glue works fine to hold the wires and Trinket in place, but can be disappointingly nondurable. E6000 craft adhesive (one of our favorites) dries clear and flexible with a very strong bond, but the fumes are a bit noxious and it takes 24 hours to set completely. Choose wisely.![](https://cdn-learn.adafruit.com/assets/assets/000/011/064/medium800/led_strips_hotglue.jpg?1379726191)

To prevent accidental contact with skin (which is slightly conductive, especially if damp with perspiration), the back side of everything is covered with tape.

![](https://cdn-learn.adafruit.com/assets/assets/000/011/065/medium800/led_strips_kapton.jpg?1379726384)

Hot glue and tape are rather kludgey, but it’s all hidden on the inside. From the front everything looks pretty slick (and the blinking LEDs will provide further distraction from any imperfections).

![led_strips_dots.jpg](https://cdn-learn.adafruit.com/assets/assets/000/011/066/medium640/led_strips_dots.jpg?1379726396)

The tiny LiPo battery can be held with tape at the bridge of the nose (between the eyes it won’t block vision), or could be affixed to one of the temples.

![](https://cdn-learn.adafruit.com/assets/assets/000/011/067/medium800/led_strips_lipo.jpg?1379726746)

Bingo! You’re done!  
  
Using the code as provided, the battery should run for about two hours. Different colors and patterns will have a different current draw and run time; this is nearly impossible to predict, sometimes the best way is just to plug it in with a freshly topped-off battery and see how long it runs.

![led_strips_finished.jpg](https://cdn-learn.adafruit.com/assets/assets/000/011/068/medium640/led_strips_finished.jpg?1379726758)

To recharge the battery, unplug it from the socket on the glasses and use the LiPo charger. **The battery does <u>not</u> charge from the USB connection.**

# SAFETY AND COMMON SENSE
Unlike the LED goggles, you _can_ wear these shades on your eyes in an appropriate setting. Just remember that your sight is limited as the electronic parts may block peripheral vision. Also, LEDs look best in the dark, but navigating in an already-dark setting is made even more difficult by sunglasses. Use common sense; they’re fun and nifty looking for indoor parties, but don’t go driving at night with them. ![](https://cdn-learn.adafruit.com/assets/assets/000/011/069/medium800/led_strips_energydome.jpg?1379728190)


## Featured Products

### Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE

[Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE](https://www.adafruit.com/product/3500)
The&nbsp;Adafruit Trinket M0 may be small, but do not be fooled by its size! It's a tiny microcontroller board, built around the Atmel ATSAMD21, a little chip with _a lot_ of power. We wanted to design a microcontroller board that was small enough to fit into any project, and low...

In Stock
[Buy Now](https://www.adafruit.com/product/3500)
[Related Guides to the Product](https://learn.adafruit.com/products/3500/guides)
### Adafruit GEMMA M0 - Miniature wearable electronic platform

[Adafruit GEMMA M0 - Miniature wearable electronic platform](https://www.adafruit.com/product/3501)
The **Adafruit Gemma M0** is a super small microcontroller board, with just enough built-in to create many simple projects. It may look small and cute: round, about the size of a quarter, with friendly alligator-clip sew pads. But do not be fooled! The Gemma M0 is incredibly...

In Stock
[Buy Now](https://www.adafruit.com/product/3501)
[Related Guides to the Product](https://learn.adafruit.com/products/3501/guides)
### Adafruit GEMMA v2 - Miniature wearable electronic platform

[Adafruit GEMMA v2 - Miniature wearable electronic platform](https://www.adafruit.com/product/1222)
 **Deprecation Warning: The Gemma bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Gemma so that people can maintain some older projects, we no longer recommend it.** <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1222)
[Related Guides to the Product](https://learn.adafruit.com/products/1222/guides)
### Adafruit Trinket - Mini Microcontroller - 3.3V Logic

[Adafruit Trinket - Mini Microcontroller - 3.3V Logic](https://www.adafruit.com/product/1500)
 **Deprecation Warning: The Trinket bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Trinket so that people can maintain some older projects, we no longer recommend it.** <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1500)
[Related Guides to the Product](https://learn.adafruit.com/products/1500/guides)
### Adafruit Trinket - Mini Microcontroller - 5V Logic

[Adafruit Trinket - Mini Microcontroller - 5V Logic](https://www.adafruit.com/product/1501)
 **Deprecation Warning: The Trinket bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Trinket so that people can maintain some older projects, we no longer recommend it.** <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1501)
[Related Guides to the Product](https://learn.adafruit.com/products/1501/guides)
### Adafruit Metro M4 feat. Microchip ATSAMD51

[Adafruit Metro M4 feat. Microchip ATSAMD51](https://www.adafruit.com/product/3382)
Are you ready? Really ready? Cause here comes the fastest, most powerful Metro ever. The **Adafruit Metro M4** featuring the **Microchip ATSAMD51**. This Metro is like a bullet train, with its 120MHz Cortex M4 with floating point support. Your code will zig and zag...

In Stock
[Buy Now](https://www.adafruit.com/product/3382)
[Related Guides to the Product](https://learn.adafruit.com/products/3382/guides)
### Adafruit NeoPixel Digital RGB LED Strip 144 LED - 1m Black

[Adafruit NeoPixel Digital RGB LED Strip 144 LED - 1m Black](https://www.adafruit.com/product/1506)
We crammed **ALL THE NEOPIXELS** into this strip! An unbelievable 144 individually-controllable LED pixels on a flexible PCB. It's completely out of control and ready for you to blink. This strip has a black mask, and an extra heavy flex PCB.  
  
These LED strips are even more...

In Stock
[Buy Now](https://www.adafruit.com/product/1506)
[Related Guides to the Product](https://learn.adafruit.com/products/1506/guides)
### Adafruit NeoPixel Digital RGB LED Strip 144 LED - 1m White

[Adafruit NeoPixel Digital RGB LED Strip 144 LED - 1m White](https://www.adafruit.com/product/1507)
We crammed **ALL THE NEOPIXELS** into this strip! An unbelievable 144 individually-controllable LED pixels on a flexible PCB. It's completely out of control and ready for you to blink. This strip has a white mask, and an extra heavy flex PCB.  
  
These LED strips are even more...

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

## Related Guides

- [Adafruit Trinket M0](https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino.md)
- [Adafruit Metro M4 Express featuring ATSAMD51](https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51.md)
- [Serial Debugging with GEMMA](https://learn.adafruit.com/serial-debugging-with-gemma.md)
- [NeoPixel Manicure](https://learn.adafruit.com/neopixel-manicure.md)
- [Adafruit MicroLipo and MiniLipo Battery Chargers](https://learn.adafruit.com/adafruit-microlipo-and-minilipo-battery-chargers.md)
- [NeoPixel Basketball Hoop](https://learn.adafruit.com/neopixel-mini-basketball-hoop.md)
- [Glowing Fascinator Hat with Gemma M0 and MakeCode](https://learn.adafruit.com/glowing-fascinator-hat-gemma-m0-makecode.md)
- [NeoPixel Fairy Crown](https://learn.adafruit.com/neopixel-fairy-crown.md)
- [Light-Activated Pixel Heart](https://learn.adafruit.com/light-activated-pixel-heart.md)
- [Glowing Scale Armor](https://learn.adafruit.com/glowing-scale-armor.md)
- [CircuitPython 101: Working with Lists, Iterators and Generators](https://learn.adafruit.com/circuitpython-101-list-and-things-iterators-generators.md)
- [Adafruit LED Sequins](https://learn.adafruit.com/adafruit-led-sequins.md)
- [Building CircuitPython](https://learn.adafruit.com/building-circuitpython.md)
- [Using Piezo Buzzers with CircuitPython & Arduino](https://learn.adafruit.com/using-piezo-buzzers-with-circuitpython-arduino.md)
- [Trinket / Gemma Mini-Theremin](https://learn.adafruit.com/trinket-gemma-mini-theramin-music-maker.md)
- [Let’s Put LEDs in Things!](https://learn.adafruit.com/lets-put-leds-in-things.md)
