# Color Spinner Camera Ring Light 

## Overview

Photography lighting is a tricky business. This project aims to create an easy add-on that can work with any camera, film or digital, to illuminate subjects and scenes with custom colors.&nbsp;

To add an extra fun element to this ring light, we can select the color by turning a color wheel, the color that is above the light sensor on the CircuitPlayground will be the color displayed!

This project is a fun introduction to soldering and coding, and is easy to adapt for different lighting purposes.

![](https://cdn-learn.adafruit.com/assets/assets/000/074/845/medium800/makecode_A69E533D-6498-4BA6-BD85-B86D859B2E03.jpg?1556055092)

## The Electronics
### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
![A Black woman's manicured hand holds a round microcontroller with lit up LEDs.](https://cdn-shop.adafruit.com/640x480/3333-05.jpg)

### NeoPixel Ring - 24 x 5050 RGBW LEDs w/ Integrated Drivers

[NeoPixel Ring - 24 x 5050 RGBW LEDs w/ Integrated Drivers](https://www.adafruit.com/product/2862)
What is better than smart RGB LEDs? Smart RGB+White LEDs! These NeoPixel rings now have 4 LEDs in them (red, green, blue _and_ white) for excellent lighting effects. Round and round and round they go! &nbsp;

**This is the 24 LED RGBW NeoPixel Ring in Natural White**....

In Stock
[Buy Now](https://www.adafruit.com/product/2862)
[Related Guides to the Product](https://learn.adafruit.com/products/2862/guides)
![NeoPixel Ring with 24 x 5050 RGBW LEDs lighting up rainbow and white](https://cdn-shop.adafruit.com/product-videos/640x480/2862-01.jpg)

### JST 2-pin Extension Cable with On/Off Switch - JST PH2

[JST 2-pin Extension Cable with On/Off Switch - JST PH2](https://www.adafruit.com/product/3064)
By popular request - we now have a way you can turn on-and-off Lithium Polymer batteries without unplugging them.

This **PH2 Female/Male&nbsp;JST 2-pin Extension Cable&nbsp;** comes with an in-line **Switch** - click once to turn on, click again to turn off....

Out of Stock
[Buy Now](https://www.adafruit.com/product/3064)
[Related Guides to the Product](https://learn.adafruit.com/products/3064/guides)
![Top view shot of JST 2-pin Extension Cable with On/Off Switch.](https://cdn-shop.adafruit.com/640x480/3064-02.jpg)

### Part: Small Alligator Clip to Male Jumper
quantity: 1
Bundle of 6 Pieces
[Small Alligator Clip to Male Jumper](https://www.adafruit.com/product/3448)

### Part: USB cable - USB A to Micro-B
quantity: 1
3 feet
[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)

### Part: Female/Male 'Extension' Jumper Wires
quantity: 1
Premium 20 x 6"
[Female/Male 'Extension' Jumper Wires](https://www.adafruit.com/product/1954)

### Part: Female/Female Jumper Wires
quantity: 1
Premium 20 x 3" (75mm)
[Female/Female Jumper Wires](https://www.adafruit.com/product/1951)

### Part: 10K potentiometer
quantity: 1
Panel Mount (Breadboard Friendly)
[10K potentiometer](https://www.adafruit.com/product/562)

### Part: Potentiometer Knob
quantity: 1
Soft Touch T18 - White
[Potentiometer Knob](https://www.adafruit.com/product/2047)

## Materials

In addition to the electronics, for this project you will also need:

- Scrap cardboard
- Paper and color printer
- [Double-sided foam tape](https://www.amazon.com/dp/B003W0R4PE/ref=cm_sw_r_tw_dp_U_x_Y2SGBb4DV10TX)
- Scissors or hobby knife

![](https://cdn-learn.adafruit.com/assets/assets/000/074/881/medium800thumb/leds_brightness_changer.2019-04-19_16_48_18.jpg?1556128514)

# Color Spinner Camera Ring Light 

## The Circuit

![](https://cdn-learn.adafruit.com/assets/assets/000/074/871/medium800/makecode_CPX_neopixel-ring_potentiometer2_bb.png?1556120708)

## Solder Time

This step involves a bit of soldering. You'll need to connect three jumper wires to the [NeoPixel ring](https://www.adafruit.com/product/2862), one to **PWR** , one to **GND** , and one to **IN**.&nbsp;

## NeoPixel Ring

&nbsp;

Solder jumper wires to the NeoPixel ring.

&nbsp;

Using pliers to give the end of the wire a slight bend makes it easier to solder it into place.

![makecode_IMG_1364.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/849/medium640/makecode_IMG_1364.jpg?1556057314)

![makecode_IMG_1365.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/850/medium640/makecode_IMG_1365.jpg?1556057368)

![makecode_IMG_1367.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/851/medium640/makecode_IMG_1367.jpg?1556057407)

## Potentiometer

Connect jumper wires to the legs of the potentiometer.&nbsp;

On these types of potentiometers the leg on the left is ground, the middle leg is the signal output, and the rightmost leg connects to power.

![makecode_IMG_1368.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/855/medium640/makecode_IMG_1368.jpg?1556059399)

## Complete Circuit

Use [jumper wires](https://www.adafruit.com/category/306) to connect the potentiometer and NeoPixel ring to the alligator clips connected to Circuit Playground Express.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/074/749/medium800/makecode_QYPH1747.jpg?1555964857)

# Color Spinner Camera Ring Light 

## MakeCode

## Getting Familiar

**Microsoft MakeCode for Adafruit is&nbsp;** a web-based code editor that provides a block editor, similar to Scratch or Code.org, and also a JavaScript editor for more advanced users.

If you'd like to learn more about MakeCode,&nbsp;[this guide is a good place to start](https://learn.adafruit.com/makecode/downloading-and-flashing?embeds=allow).

![](https://cdn-learn.adafruit.com/assets/assets/000/074/418/medium800/makecode.jpg?1555108672)

MakeCode is fun to work with and easy to customize, allowing you to get some great results with just a little trial-and-error.&nbsp;

[Open the code for this project in MakeCode](https://makecode.adafruit.com/67532-51991-44754-84333)
https://makecode.adafruit.com/67532-51991-44754-84333

## How to Upload Code

To upload code, follow these instructions:

1) Connect your Circuit Playground Express to your computer using a micro USB cable and press the small reset button in the center of the board. All the LEDs will flash&nbsp; **red&nbsp;** briefly **, then turn green.&nbsp;** Your computer should now show a removable drive called&nbsp; **CPLAYBOOT.&nbsp;**

2) Click the&nbsp; **Download** &nbsp;button in the code window below to download the **&nbsp;.UF2 file** &nbsp;to your computer.

3) Now **&nbsp;drag and drop the .UF2 file onto the CPLAYBOOT** &nbsp; **drive** &nbsp;in your computer's file explorer or finder.

The drive will automatically eject itself (your computer may give you a "failed to eject drive correctly" error, you can ignore this). The code is now on your Circuit Playground Express and ready to run!

## How it Works

The code for this project uses a bit of logic to create two modes for the NeoPixel ring based on the position of the slide switch. In the first section of the blue `if` statement we can see that `if switch right then` the brightness should be turned all the way up and the NeoPixel strip set to match the color detected by the light sensor onboard Circuit Playground Express.

In the second part of the blue if statement, the `else if not switch right`&nbsp;command tells Circuit Playground Express to follow the contained instructions only if the slide switch is moved to the **left** (i.e. _not_ right) position. A new variable, "value", is created to measure the analog value of the potentiometer connected to pin **A2** , which can then be used&nbsp; to control the brightness of&nbsp;the NeoPixel ring, using the `strip set brightness value` block.&nbsp;

For more information on using potentiometers take a look at&nbsp;[this guide](https://learn.adafruit.com/make-it-change-potentiometers/makecode).

![](https://cdn-learn.adafruit.com/assets/assets/000/074/649/medium800/makecode_Screen_Shot_2019-04-17_at_7.48.14_PM.png?1555706410)

## Test It!

With the switch in the **right** position, you should be able to hold up different colors to the light sensor and watch how the NeoPixels react as CPX attempts to detect and match the color as best it can.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/074/659/medium800thumb/makecode_IMG_3472.2019-04-19_17_51_24.jpg?1555710789)

## Editing the Code

If you'd like to play with this code, click " **Edit**" in MakeCode and a new window will open in which you can create your own version.

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/074/573/medium800/makecode_led_pixels_Screen_Shot_2018-12-19_at_3.49.02_PM.png?1555528359)

## Check Your Format

For this project we are using **RGB+W** pixels. Depending on what kind of NeoPixels you're using you may need to edit the format in the `on start` block to get the colors to display correctly.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/074/650/medium800/makecode_Screen_Shot_2019-04-12_at_6.49.38_PM.png?1555706461)

# Color Spinner Camera Ring Light 

## Put It All Together

Download and print out the PDF of this [color wheel](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRFi-aHkPhXLODLk52GpBY37VGqy_hfto7X9O_1NCtvTBfRm0EB) below.&nbsp;

[color_wheels.pdf](https://cdn-learn.adafruit.com/assets/assets/000/074/653/original/color_wheels.pdf?1555707510)
Cut out both color wheels.&nbsp;

This mirrored image of a color wheel will match when glued together, making it easy to see which color you're selecting.&nbsp;

Glue to either side of a disk. Be sure to match them up!

Trim any excess around the edge.

![makecode_IMG_3495.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/655/medium640/makecode_IMG_3495.jpg?1555708273)

![makecode_IMG_3491.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/656/medium640/makecode_IMG_3491.jpg?1555708757)

Mark spots where holes will be needed. Widen the holes with a small screw driver or pen.

&nbsp;

Attach Circuit Playground Express to the cardboard base using screws and/or standoffs.

&nbsp;

Attach color wheel so that it sits over the color sensor on CPX.

![makecode_IMG_3693.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/831/medium640/makecode_IMG_3693.jpg?1556052658)

![makecode_IMG_3699.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/834/medium640/makecode_IMG_3699.jpg?1556053195)

![makecode_IMG_3700.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/835/medium640/makecode_IMG_3700.jpg?1556053234)

![makecode_IMG_3701.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/836/medium640/makecode_IMG_3701.jpg?1556053268)

## Color Test

Try it out! Connect the Circuit Playground Express to a power source and ensure its slide switch is switched **right**. Slowly spin the color wheel and watch the colors change!

![](https://cdn-learn.adafruit.com/assets/assets/000/074/654/medium800thumb/makecode_IMG_3525.2019-04-18_14_49_03.jpg?1555707792)

## Potentiometer

&nbsp;

Connect potentiometer to jumper wires.

Press fit potentiometer through hole in cardboard. Use knob to hold potentiometer securely in place.&nbsp;

![makecode_IMG_3532.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/661/medium640/makecode_IMG_3532.jpg?1555711482)

![makecode_IMG_3705.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/837/medium640/makecode_IMG_3705.jpg?1556053419)

![makecode_IMG_3706.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/838/medium640/makecode_IMG_3706.jpg?1556053499)

## Completed Control Unit
![](https://cdn-learn.adafruit.com/assets/assets/000/074/839/medium800/makecode_IMG_3707.jpg?1556053708)

## Shoe Mount Adapter

&nbsp;

Screw your shoe mount adapter to the bottom of the cardboard platform.

This will allow you to connect it to your camera and position it for ease of use and comfort.&nbsp;

![makecode_IMG_3708.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/859/medium640/makecode_IMG_3708.jpg?1556060246)

## Power Switch

&nbsp;

Use twist ties to hold the switch, battery, and excess cable all together in a tidy package. This will make it easy to attach to the side of the camera.&nbsp;

![makecode_IMG_3535.jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/662/medium640/makecode_IMG_3535.jpg?1555711580)

## Use It!

Use double sided tape to connect the ring and power switch where you want them on your camera.

With the slide switch flipped to the left, you will find yourself in luminous mode, with the brightness of the NeoPixel ring controlled by the potentiometer.

When the switch is flipped to the right you're in color mode, able to switch between colors by rotating the color wheel.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/074/856/medium800thumb/makecode_IMG_3722.2019-04-22_21_57_57.jpg?1556059813)

![](https://cdn-learn.adafruit.com/assets/assets/000/074/857/medium800thumb/makecode_IMG_3721.2019-04-22_21_54_07.jpg?1556059822)


## Featured Products

### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/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)
### Lithium Ion Polymer Battery Ideal For Feathers - 3.7V 400mAh

[Lithium Ion Polymer Battery Ideal For Feathers - 3.7V 400mAh](https://www.adafruit.com/product/3898)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of **400mAh** for a total of about 1.9 Wh. If you need a larger (or smaller!)...

In Stock
[Buy Now](https://www.adafruit.com/product/3898)
[Related Guides to the Product](https://learn.adafruit.com/products/3898/guides)
### Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces

[Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces](https://www.adafruit.com/product/3448)
When working&nbsp;with unusual non-header-friendly surfaces, these handy cables will be your best friends! No longer will you have long, cumbersome strands of alligator clips. These compact jumper cables have a premium male header on one end and a grippy mini alligator clip on the...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3448)
[Related Guides to the Product](https://learn.adafruit.com/products/3448/guides)
### Swivel-Head Pan Tilt (PTZ) Shoe Mount Adapter

[Swivel-Head Pan Tilt (PTZ) Shoe Mount Adapter](https://www.adafruit.com/product/2464)
This&nbsp;**Swivel-Head Pan-Tilt (PTZ) Shoe Mount Adapter&nbsp;**allows you to attach something with standard 1/4" machine screw mount to a camera's shoe mount,&nbsp; with free range of motion! Loosen the side screw and the ball-joint is free to move all around, then...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2464)
[Related Guides to the Product](https://learn.adafruit.com/products/2464/guides)
### Panel Mount 10K potentiometer (Breadboard Friendly)

[Panel Mount 10K potentiometer (Breadboard Friendly)](https://www.adafruit.com/product/562)
This potentiometer is a two-in-one, good in a breadboard or with a panel. It's a fairly standard linear taper 10K ohm potentiometer, with a grippy shaft. It's smooth and easy to turn, but not so loose that it will shift on its own. We like this one because the legs are 0.2" apart...

In Stock
[Buy Now](https://www.adafruit.com/product/562)
[Related Guides to the Product](https://learn.adafruit.com/products/562/guides)
### Potentiometer Knob - Soft Touch T18 - White

[Potentiometer Knob - Soft Touch T18 - White](https://www.adafruit.com/product/2047)
_Oh say can you see_  
_By the knob's early light..._

Sorry - we thought that was clever. &nbsp;And while it wasn't really, this potentiometer knob definitely is. &nbsp;It's a...

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

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Easter Egg Light Stand](https://learn.adafruit.com/easter-egg-light-stand.md)
- [The Scream: Interactive Screaming Painting](https://learn.adafruit.com/the-scream-munch-screaming-interactive-scream-painting.md)
- [Edit CircuitPython Code on iOS with Runestone](https://learn.adafruit.com/editing-circuitpython-on-ios-with-runestone.md)
- [New Year Countdown Clock with Circuit Playground Express](https://learn.adafruit.com/new-year-countdown-clock-with-circuit-playground-express.md)
- [CircuitPython with Jupyter Notebooks](https://learn.adafruit.com/circuitpython-with-jupyter-notebooks.md)
- [CRICKIT Exhibit Demo Board](https://learn.adafruit.com/crickit-exhibit-demo-board.md)
- [CircuitPython Hardware: LED Backpacks & FeatherWings](https://learn.adafruit.com/micropython-hardware-led-backpacks-and-featherwings.md)
- [Professor Bubbleton’s Breathing Head in a Jar](https://learn.adafruit.com/professor-bubbleton-s-breathing-head-in-a-jar.md)
- [Circuit Playground Express TV Zapper](https://learn.adafruit.com/circuitpython-tv-zapper-with-circuit-playground-express.md)
- [Using EduBlocks with Circuit Playground Express](https://learn.adafruit.com/using-edublocks-with-circuit-playground-express.md)
- [Buttermilk Boat with Circuit Playground Express](https://learn.adafruit.com/boat-with-circuit-playground-express.md)
- [CircuitPython BLE Crickit Rover](https://learn.adafruit.com/circuitpython-ble-crickit-rover.md)
- [Crickit Harmonic Drawing Machine](https://learn.adafruit.com/crickit-harmonic-drawing-machine.md)
- [Make It Hot or Cold](https://learn.adafruit.com/make-it-hot-or-cold.md)
- [A NeoPixel Blinkendisc](https://learn.adafruit.com/a-neopixel-blinkendisc.md)
