Skip to main content

CPX Pinhole Projects: Light and Shadow Experiments

CPX Pinhole Projects: Light and Shadow Experiments
CPX: Circuit Playground Express
Circular board with various electronic components and colorful lights.
Circuit Playground Express makecode coding interface

Since last year, we've been doing some interesting R&Ds on light and shadow using the CPX, and I wanted to document and share some project examples here. CPX, which stands for Circuit Playground Express, is an interactive board that has various sensors and LEDs. It allows for easy experimentation and coding, making it a great tool for exploring light and shadow, specifically pinhole effects.  


CPX lights go through a tiny hole creating pinhole effects
Pinhole flower project

The first idea that came to mind was the pinhole flower. This project was inspired by a serendipitous observation during one of our experiments. While all the CPX LEDs were lit up, I noticed a phenomenon where the light passed through a nearby cardboard box with a small hole, creating a pinhole effect. Seeing the ten LEDs pass through a single tiny hole and project as ten distinct points inside the box was truly fascinating.  

I wondered what it would look like if I added colors. It looked like a flower, so I poked more holes in the cardboard, drew stems and leaves on the projected side, and created several colorful flowers. It felt magical to me that a single light source could multiply through the holes when projected, making it look like there were as many lights as there were holes.

Colorful circles of light resembling flowers against a dark backdrop.
CPX lights go through tiny holes, creating several flowers with pinhole effects


That was so fascinating that I started experimenting with different shapes for the holes and used flexible lights like NeoPixel strip lights to create a variety of projections on the wall. It was a lot of fun exploring the different effects. 

Glowing blue moon silhouette against a dark background.


At the Exploratorium, we have an exhibit called "Sophisticated Shadows" that explores the pinhole effect, but this felt like an entirely new way to investigate pinholes. The use of multiple colorful lights, various shapes of pinhole openings, and the ability to freely move the light source may have contributed to a different and more dynamic experience than the exhibit.


Using Cardboard Tubes and Coding Exploration

Around that time, I remembered a CPX project I saw on Twitter. Since the CPX is round, it fits nicely into a cylindrical cardboard tube, and I thought it would be a great idea to attach tracing paper to the end for projection.

CPX makecode coding interface

Up until this point, I had mostly been using the default animations in MakeCode, like Rainbow, Comet, and Sparkle. They all looked beautiful through the pinholes, and I didn’t feel the need to tinker with the code. Then, I started to wonder what kind of projects would make me want to dive into the code. When would people want to program their own light timings, colors, and patterns? One answer, I thought, was to create narrative, story-driven projects. Here are a few of those projects.


Storytelling with Pinhole Light Projections

Ten red lights light up one by one, shining through a flame-shaped hole and projecting onto the tracing paper. When you overlay a transparent sheet with a drawing of a birthday cake... there you go, Happy Birthday!

Look at the glowing streaks above the cloud, Red, Orange, Yellow, Green, Blue, Indigo, Violet... wow, it's a rainbow!

A single light blinking from bottom to top, when passing through multiple rain-shaped pinholes, becomes a rainfall from top to bottom!

These projects were not only exciting to create but also thrilling to see in action. The distance between the light and the projection surface greatly affects the size of the light displayed through the pinholes. There were so many elements to tinker with, such as the shapes of the pinhole openings, light programming, patterns, timings, colors, and deciding which parts to represent with light and which to create with craft materials.There are countless stories you can express with light, code, and crafts, from birthday candles lighting up one by one, to a rainbow shining in seven colors, to raindrops gently falling on an umbrella!


Below is a list of suggested materials. The project ideas mentioned above are just a few examples, and I expect many more exciting ideas to emerge. Please feel free to try them out yourself, and be sure to share your creations with us!

A collection of various circular and rectangular objects arranged on a black surface, including cardboard tubes, discs, and a small stone-like object.


National Science Foundation Official Logo


This project is generously supported by the National Science Foundation under Grant No. 2005764.