# Living Starry Night Painting

## Overview

This project will guide you through the process of animating and illuminating your own version of Van Gogh's famous [Starry Night](https://en.wikipedia.org/wiki/The_Starry_Night) painting.

This project uses readily available household materials, and also serves as a fun introduction to CircuitPython.

# Materials
![](https://cdn-learn.adafruit.com/assets/assets/000/054/050/medium800/circuitpython_IMG_2550.jpg?1526655930)

### Part: Adafruit CRICKIT for Circuit Playground Express
quantity: 1
Creative Robotics and Interactive Construction Kit is an add-on to our popular Circuit Playground Express that lets you #MakeRobotFriend using CircuitPython
[Adafruit CRICKIT for Circuit Playground Express](https://www.adafruit.com/product/3093)

### Part: Circuit Playground Express
quantity: 1
Circuit Playground Express is the perfect introduction to electronics and programming
[Circuit Playground Express](https://www.adafruit.com/product/3333)

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

### Part: DC Gearbox Motor - "TT Motor" - 200RPM - 3 to 6VDC
quantity: 1
TT DC Gearbox Motor with a gear ratio of 1:48 and 2 x 200mm wires with breadboard-friendly 0.1" male connectors
[DC Gearbox Motor - "TT Motor" - 200RPM - 3 to 6VDC](https://www.adafruit.com/product/3777)

### Part: Wire Light LED Strand - 12 Cool White LEDs + Coin Cell Holder
quantity: 1
Silver wire strand of 12 epoxy coated 1000mcd LEDs
[Wire Light LED Strand - 12 Cool White LEDs + Coin Cell Holder](https://www.adafruit.com/product/894)

### Part: Hakko Professsional Quality 20-30 AWG Wire Strippers
quantity: 1
Professional quality wire strippers with precision ground notches to strip wires cleanly and quickly every time
[Hakko Professsional Quality 20-30 AWG Wire Strippers](https://www.adafruit.com/product/527)

### Part: 5V 2A (2000mA) switching power supply
quantity: 1
Power supply that gives a clean regulated 5V output at up to 2000mA, 110 or 240 input
[5V 2A (2000mA) switching power supply](https://www.adafruit.com/product/276)

In addition, this project uses:

- Scrap cardboard (~10"x10" square)
- Double sided tape
- Scissors
- Hot glue (optional)

# Getting to know CircuitPython

CircuitPython is a programming language based on Python, one of the fastest growing programming languages in the world. It is specifically designed to simplify experimenting and learning to code on low-cost microcontroller boards.

To run CircuitPython we recommend using Mu. If this is your first time using Mu, [this guide is a good introduction to get you up and running](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor).

Mu is a simple code editor that works with all Adafruit CircuitPython boards. It's written in Python and works on Windows, MacOS, Linux and Raspberry Pi. The serial console is built right in so you get immediate feedback from your board's serial output!

![](https://cdn-learn.adafruit.com/assets/assets/000/054/051/medium800/circuitpython_Screen_Shot_2017-12-24_at_2.55.02_PM.png?1526656629)

Once you have Mu installed you're ready to rock with CircuitPython.

Let's get started!

# Living Starry Night Painting

## Prepare the Painting

First things first: print out **two copies** of [Starry Night](https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg/1280px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg)

![](https://cdn-learn.adafruit.com/assets/assets/000/053/920/medium800/circuitpython_1280px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg?1526406748)

# Cut out the Moon

From one copy of Starry Night, cut out the moon. Set the moon aside for use later.

![](https://cdn-learn.adafruit.com/assets/assets/000/053/921/medium800/circuitpython_IMG_2453.jpg?1526406860)

Take your second copy of Starry Night and glue it to a piece of cardboard. It's ok if they aren't exactly the same size, as long as the paper fits on the cardboard.

Apply glue to both sides.

Make sure you glue all the way to the edges of the paper!

&nbsp;

After glue has been applied, lay your painting on the cardboard. Use a piece of scrap cardboard to press and smooth out the painting.

&nbsp;

Cut away any excess cardboard.

![circuitpython_LFMV0242.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/729/medium640/circuitpython_LFMV0242.jpg?1526169817)

![circuitpython_JCDS3969.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/730/medium640/circuitpython_JCDS3969.jpg?1526169829)

![circuitpython_GFUR2004.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/731/medium640/circuitpython_GFUR2004.jpg?1526169855)

![circuitpython_IUCZ2591.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/732/medium640/circuitpython_IUCZ2591.jpg?1526169866)

![circuitpython_UKVM2321.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/733/medium640/circuitpython_UKVM2321.jpg?1526169908)

Once the cardboard has been trimmed, do a second pass with a small piece of cardboard, smoothing and pressing the two pieces together.

![](https://cdn-learn.adafruit.com/assets/assets/000/053/724/medium800/circuitpython_VBBT1461.jpg?1526169558)

# Prepare your moon
Glue both sides

![circuitpython_LWZA0930.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/716/medium640/circuitpython_LWZA0930.jpg?1526169284)

![circuitpython_SNEM7289.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/717/medium640/circuitpython_SNEM7289.jpg?1526169301)

![circuitpython_VOKM5310.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/718/medium640/circuitpython_VOKM5310.jpg?1526169324)

# Give it legs (optional)
Danger: 

If you'd like your painting to stand on its own, now is a good time to add some legs.

&nbsp;

To make the legs: cut out two rectangles of cardboard and trim one corner off each end.

&nbsp;

Hold each leg in place against the back of the painting and add a line of hot glue along its edge. Wait for about 20-30 seconds after adding the glue to let it cool down.

![circuitpython_JTMW7846_copy.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/923/medium640/circuitpython_JTMW7846_copy.jpg?1526407047)

![circuitpython_EUES8396.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/925/medium640/circuitpython_EUES8396.jpg?1526407074)

![circuitpython_TPSZ4101.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/926/medium640/circuitpython_TPSZ4101.jpg?1526407096)

# Living Starry Night Painting

## Uploading Code with Mu

# But first...

To use Circuit Playground Express and CRICKIT together, you'll first need to install the special 'seesaw' version of the CPX firmware. [This guide](https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-construction-kit/circuitpython-code) will take you through how to install CRICKIT support onto your circuit playground express.

Adafruit recommends the Mu editor to easily craft and load your code to your [CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/overview) projects. [You can learn more about Mu by reading this guide](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor).

Once you have completed these steps, you're ready to move on.

# Get Ready!

1. Connect the MicroUSB for coding from the **Circuit Playground Express** to your computer
2. Put 3 AA batteries in a battery pack and connect to the Crickit, or use a wall adapter
3. Turn on the Crickit, check that the switch next to the DC power plug is ON

# Connect Motor

Now it's time to test the code and make sure the DC motor runs.&nbsp;

First, connect your motor to the CRICKIT as pictured, using a small screwdriver to tighten down the screws.

![](https://cdn-learn.adafruit.com/assets/assets/000/054/077/medium800/circuitpython_Connect_DC_motor.jpg?1526670600)

Copy and paste the code below into your Mu editor.

Save this code to your CIRCUITPY drive as **code.py**

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

Primary: 

![](https://cdn-learn.adafruit.com/assets/assets/000/054/130/medium800/circuitpython_name_your_code_code.png?1526701267)

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/054/052/medium800/circuitpython_08812796-9D30-46C9-AF21-F4FE565971F6.jpg?1526657903)

![](https://cdn-learn.adafruit.com/assets/assets/000/054/053/medium800thumb/circuitpython_IMG_2579.jpg?1526658282)

# Troubleshooting

**Problem** : My motor still won't spin!

**Solution** : Check that you have a 5V power supply attached to the DC jack on your CRICKIT board.

&nbsp;

**Problem** : My Circuit Playground Express isn't recognized by Mu!

**Solution** : Make sure your board is set up as a CIRCUITPY device. If it is showing up at "CPLAYBOOT" on your computer, you can [follow the steps in this guide](../../../../adafruit-circuit-playground-express/circuitpython-quickstart) to get it back into CIRCUITPY mode.

&nbsp;

# Living Starry Night Painting

## Motorize the Moon!

# Attach Motor

If your motor spins, it's time to mount it to the painting!

Use something pointy to make a large hole in the center of the moon. This is where the motor will go.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/053/988/medium800/circuitpython_YIRD1134.jpg?1526498553)

Add a piece of double sided tape to your motor.

&nbsp;

Stick it to the back of the painting with the white axle poking through.

&nbsp;

Stick a small circle of double sided tape to the back of your moon. Carefully stick this to the axle of the motor poking through the painting.

![circuitpython_MHHL1141.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/998/medium640/circuitpython_MHHL1141.jpg?1526499233)

![circuitpython_VKCK0448.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/992/medium640/circuitpython_VKCK0448.jpg?1526498980)

![circuitpython_IMG_2412.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/999/medium640/circuitpython_IMG_2412.jpg?1526500736)

![circuitpython_BEMR0042.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/994/medium640/circuitpython_BEMR0042.jpg?1526499140)

![circuitpython_IMG_2421.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/996/medium640/circuitpython_IMG_2421.jpg?1526499184)

![circuitpython_BHXF9342.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/997/medium640/circuitpython_BHXF9342.jpg?1526499217)

![](https://cdn-learn.adafruit.com/assets/assets/000/054/027/medium800thumb/circuitpython_IMG_2531.jpg?1526587980)

# Living Starry Night Painting

## Putting Stars in the Sky

## Let's add some lights to the painting!&nbsp;

First, you'll need to prepare your strand of LEDs.

Use a wire cutter to snip the LED strand from its battery pack. Where we're going, we won't need batteries.

&nbsp;

Pull the two wires apart, separating about about an inch of length.

&nbsp;

Use the 0.5mm gauge on your wire stripper to strip off some insulation from the tips of these wires.

&nbsp;

**Pro Tip:** &nbsp;gently twist the insulation as you pull it off the wire. This will help keep all the wire strands together.

![circuitpython_IMG_2534.jpg](https://cdn-learn.adafruit.com/assets/assets/000/054/038/medium640/circuitpython_IMG_2534.jpg?1526617057)

![circuitpython_IMG_2536.jpg](https://cdn-learn.adafruit.com/assets/assets/000/054/039/medium640/circuitpython_IMG_2536.jpg?1526617081)

![circuitpython_IMG_2538.jpg](https://cdn-learn.adafruit.com/assets/assets/000/054/040/medium640/circuitpython_IMG_2538.jpg?1526617248)

![circuitpython_IMG_2539.jpg](https://cdn-learn.adafruit.com/assets/assets/000/054/041/medium640/circuitpython_IMG_2539.jpg?1526617265)

![circuitpython_IMG_2540.jpg](https://cdn-learn.adafruit.com/assets/assets/000/054/042/medium640/circuitpython_IMG_2540.jpg?1526617281)

![circuitpython_IMG_2541.jpg](https://cdn-learn.adafruit.com/assets/assets/000/054/043/medium640/circuitpython_IMG_2541.jpg?1526617599)

Screw these wires firmly into the terminal blocks on the CRICKIT.&nbsp;

Use the **5V** and **D1** terminal blocks.

![](https://cdn-learn.adafruit.com/assets/assets/000/054/044/medium800/circuitpython_IMG_2542.jpg?1526617768)

Use something pointy to poke small holes through the front of the painting in the center of each star

&nbsp;

Flip it over and widen the holes from the back. This will create an impression deep enough to push out LEDs into.

&nbsp;

Now let's add lights! Use tape to hold each LED in place. Gently bend the wire to route each consecutive LED to the next closest hole.

![circuitpython_EVTQ2242.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/979/medium640/circuitpython_EVTQ2242.jpg?1526496693)

![circuitpython_WQYJ2351.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/980/medium640/circuitpython_WQYJ2351.jpg?1526496728)

![circuitpython_IMG_2459.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/982/medium640/circuitpython_IMG_2459.jpg?1526498220)

![circuitpython_SPCL3897.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/983/medium640/circuitpython_SPCL3897.jpg?1526498249)

![circuitpython_6AE95113-BF0A-4A90-9DCA-F66BE9FF3C52.jpg](https://cdn-learn.adafruit.com/assets/assets/000/053/984/medium640/circuitpython_6AE95113-BF0A-4A90-9DCA-F66BE9FF3C52.jpg?1526498279)

Turn on power to your device, and voila! Behold your starry night.

![](https://cdn-learn.adafruit.com/assets/assets/000/053/987/medium800/circuitpython_ERZO1667.jpg?1526498419)

# Troubleshooting

**Problem** : My LEDs don't light up!

**Solution** : Swap the position of the wires in their terminal blocks (LEDs are polarized, so they won't work if they're backwards).

# Living Starry Night Painting

## Exploring Further

If you'd like to change the brightness of your stars, look no further than Mu. Changes are reflected as soon as you save your new code!

The LEDs are by default set to half-brightness. You can change this setting in the `while True:`&nbsp;loop.

For example, changing the value of `my_drive.duty_cycle` from `32768` to `16384` will dim the lights by half. What's great about programming in this way is you can see the change occur as soon as you hit save!

![](https://cdn-learn.adafruit.com/assets/assets/000/054/122/medium800thumb/circuitpython_IMG_2617.jpg?1526694962)

# Alternative Versions

Rather than lighting up the stars with LEDs, it can be fun to make multiple stars spin together.

Let your imagination run wild!

In this version, the LEDs are removed and the holes are widened.

&nbsp;

Some bamboo skewers poke through the painting and attach to the star cutouts in front. Cardboard discs are attached in back to act as pulleys.

&nbsp;

A rubber band serves as a drive belt to transfer the spinning motion from one motor to multiple stars at once.

![circuitpython_IMG_2296.jpg](https://cdn-learn.adafruit.com/assets/assets/000/054/078/medium640/circuitpython_IMG_2296.jpg?1526670792)

![circuitpython_3C94190B-ACA5-4DE8-A720-3A392A58E06C.jpg](https://cdn-learn.adafruit.com/assets/assets/000/054/079/medium640/circuitpython_3C94190B-ACA5-4DE8-A720-3A392A58E06C.jpg?1526670826)

![circuitpython_D26AC101-364A-4B6F-81F3-C602C0BC7BFB.jpg](https://cdn-learn.adafruit.com/assets/assets/000/054/080/medium640/circuitpython_D26AC101-364A-4B6F-81F3-C602C0BC7BFB.jpg?1526670854)

![circuitpython_F1786CE4-B456-4EB4-BC66-D036A0A0DF22.jpg](https://cdn-learn.adafruit.com/assets/assets/000/054/081/medium640/circuitpython_F1786CE4-B456-4EB4-BC66-D036A0A0DF22.jpg?1526670892)

![](https://cdn-learn.adafruit.com/assets/assets/000/054/048/medium800thumb/circuitpython_IMG_2533.jpg?1526621341)

# More projects!

If you enjoy CircuitPython and want to continue learning you can find&nbsp;[lots more CircuitPython projects on the Adafruit Learn System](https://learn.adafruit.com/category/micropython-slash-circuitpython).


## Featured Products

### DC Gearbox Motor - "TT Motor" - 200RPM - 3 to 6VDC

[DC Gearbox Motor - "TT Motor" - 200RPM - 3 to 6VDC](https://www.adafruit.com/product/3777)
Perhaps you've been assembling a new robot friend, adding&nbsp;a computer for a brain and other fun personality touches. Now the time has come to let it leave the nest and fly on its own wings– err, _wheels!_&nbsp;

These durable (but affordable!) plastic gearbox motors...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3777)
[Related Guides to the Product](https://learn.adafruit.com/products/3777/guides)
### 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)
### Adafruit CRICKIT for Circuit Playground Express

[Adafruit CRICKIT for Circuit Playground Express](https://www.adafruit.com/product/3093)
Sometimes we wonder if robotics engineers ever watch movies. If they did, they'd know that making robots into servants always ends up in a robot rebellion. Why even go down that path? Here at Adafruit, we believe in making robots our&nbsp; **friends!**

So if you find...

In Stock
[Buy Now](https://www.adafruit.com/product/3093)
[Related Guides to the Product](https://learn.adafruit.com/products/3093/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

Out of Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
### Wire Light LED Strand - 10 Warm White LEDs + Coin Cell Holder

[Wire Light LED Strand - 10 Warm White LEDs + Coin Cell Holder](https://www.adafruit.com/product/893)
Add sparkle to your project with these lovely silver wire LED strands. These strands are very interesting, they use two silver wires that are coated so they don't short if they touch, then tiny 1000mcd LEDs are bonded onto the wires and coated with epoxy. The result is a very flexible...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/893)
[Related Guides to the Product](https://learn.adafruit.com/products/893/guides)
### 5V 2A (2000mA) switching power supply - UL Listed

[5V 2A (2000mA) switching power supply - UL Listed](https://www.adafruit.com/product/276)
This is an FCC/CE certified and UL listed power supply. Need a lot of 5V power? This switching supply gives a clean regulated 5V output at up to 2000mA. 110 or 240 input, so it works in any country. The plugs are "US 2-prong" style so you may need a plug adapter, but you can pick one...

In Stock
[Buy Now](https://www.adafruit.com/product/276)
[Related Guides to the Product](https://learn.adafruit.com/products/276/guides)
### Hakko Professional Quality 20-30 AWG Wire Strippers

[Hakko Professional Quality 20-30 AWG Wire Strippers](https://www.adafruit.com/product/527)
These are the finest wire strippers we have used, and if you have to do a lot of wiring, you will agree! They have soft rounded grips - very comfortable to use, and precision ground notches that do a perfect job every time. No more yanking or twisting to strip wires cleanly and quickly.<br...></br...>

In Stock
[Buy Now](https://www.adafruit.com/product/527)
[Related Guides to the Product](https://learn.adafruit.com/products/527/guides)
### Wire Light LED Strand - 10 Cool White LEDs + Coin Cell Holder

[Wire Light LED Strand - 10 Cool White LEDs + Coin Cell Holder](https://www.adafruit.com/product/894)
Add sparkle to your project with these lovely silver wire LED strands. These strands are very interesting, they use two silver wires that are coated so they don't short if they touch, then tiny 1000mcd LEDs are bonded onto the wires and coated with epoxy. The result is a very flexible...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/894)
[Related Guides to the Product](https://learn.adafruit.com/products/894/guides)

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Using EduBlocks with Circuit Playground Express](https://learn.adafruit.com/using-edublocks-with-circuit-playground-express.md)
- [Paper Airplane Launcher](https://learn.adafruit.com/paper-airplane-launcher-with-crickit.md)
- [Professor Bubbleton’s Breathing Head in a Jar](https://learn.adafruit.com/professor-bubbleton-s-breathing-head-in-a-jar.md)
- [Interactive Map with Circuit Playground Express](https://learn.adafruit.com/interactive-map-with-cpx.md)
- [Makecode para la Circuit Playground Express](https://learn.adafruit.com/makecode-es.md)
- [CircuitPython Hardware: ILI9341 TFT & FeatherWing](https://learn.adafruit.com/micropython-hardware-ili9341-tft-and-featherwing.md)
- [Buttermilk Boat with Circuit Playground Express](https://learn.adafruit.com/boat-with-circuit-playground-express.md)
- [NeoPixels with MakeCode](https://learn.adafruit.com/neopixels-with-makecode.md)
- [Bluetooth Turtle Bot with CircuitPython and Crickit](https://learn.adafruit.com/bluetooth-turtle-bot-with-circuitpython-and-crickit.md)
- [MakeCode Course for Circuit Playground Express](https://learn.adafruit.com/makecode-circuit-playground-express-course.md)
- [Circuit Playground Express Head-Tilt Ears](https://learn.adafruit.com/circuit-playground-express-head-tilt-ears.md)
- [Crickit Harmonic Drawing Machine](https://learn.adafruit.com/crickit-harmonic-drawing-machine.md)
- [Fidget Spinner Tachometer](https://learn.adafruit.com/fidget-spinner-tachometer.md)
- [Glowing Bottle Castle and Capacitive Touch Piano](https://learn.adafruit.com/glowing-bottle-castle-and-capacitive-touch-piano.md)
- [Light Up Paper Dragon Wall Sconce](https://learn.adafruit.com/light-up-paper-dragon-wall-sconce.md)
