NeoPixel Hedgehog Necklace

Mocha the hedgehog wearing her new NeoPixel necklace – designed by students in Street Corner STEAM.

NeoPixel Hedgehog Necklace

In this activity guide, you will learn to program an infrared remote control to change the color of lights on a NeoPixel strip.

Total read time: <7 minutes

Skill level: Beginner

Street Corner STEAM

On Wednesday evenings, I lead a free STEAM activity in a location that also serves free meals. Activities are designed for 10-12 year old students, but in reality we have five-year-olds through senior adults who attend. There are three activity tables: sewing, painting, and drawing, as well as one special project I bring each week – such as this one. The goal of Street Corner STEAM is to offer socially-distant and spontaneous play to build skills and confidence with technology. Below you will see pictures from Street Corner STEAM.

Materials for this project:

There are five main electronics parts for this project.
  1. micro:bit – Go pack – $18.00 (set of 10 – $160.00)
  2. basic:bit – $4.99 – 1 per project
  3. NeoPixel Strip – $4.99 – 1 per project
  4. Infrared receiver sensor – $2.90 – 1 per project
  5. Infrared remote control – $4.95 – 1 per project
  6. Free software: MicroBlocks

Note: These materials are fully reusable.

Optional:

A stuffed animal or toy

If you want to help a group to create their own toys, I like this kit: Woodland creatures felt animal kits – 12 sewable felt kits – $22.99, but you can also make your own toys basically for free from old socks

Connecting the electronics

Use the five screws that come with the basic bit to connect it to your micro:bit.
There are three pins available to you: Pin 0, Pin 1, and Pin 2.
The NeoPixels are plugged into Pin 0 and the infrared sensor is plugged into Pin 1.

When you attach the NeoPixel strip and infrared sensor, be sure to line the black wire up next to the letter /G/ which stands for ‘ground.’ If you plug the wires in backwards, your program won’t run properly. Make sure the slide switch on the basic:bit is set to ‘P0’, not to the speaker.

Get to know your materials

  1. Connect your micro:bit via USB to your computer.
  2. Open MicroBlocks and be sure you have a green circle in the top left corner.
  3. Add the NeoPixel library to MicroBlocks.
Connect your micro:bit via USB to your computer. Then, open MicroBlocks and be sure that you have a green circle in the top left corner.
Add the NeoPixel library to MicroBlocks.

At this point you can play with the NeoPixel library. Below is sample code I shared with the students in Street Corner STEAM. With these code snippets, they were able to create new scripts.

Starter scripts for students to get to know their materials.
Zoomed in picture of code from video above.
Get the free MicroBlocks NeoPixel activity card here: https://microblocks.fun/cards/mb_NeoPixels.pdf
Getting the NeoPixels to come on for the first time is always exciting 🙂

Infrared sensor and remote control

Infrared light is invisible to the human eye, but if you look at it through the lens of a video camera, including most cellphone cameras, you can see it. Below is a way to use the remote control with your NeoPixel strip.

If you look at the tip of your infrared remote through a video camera, including most cellphone cameras, you will see the light.
Pressing each button on the infrared remote control causes a series of flashes with a UNIQUE pattern of delays.
How can we use these unique signals in our code?
Zoomed in picture of code from video above.
Here is one way to find the unique signal for each button on the remote. Don’t forget to add the IR Remote library to your tool bar. See how here: https://microblocks.fun/cards/mb_IR_Remote_Control.pdf
Zoomed in picture of code from video above.
Students used the code in the picture above to check the value of each button press on the remote control.
Students recorded the value of each button press on the remote like this.
Bring it all together and use your IR remote to control your NeoPixel necklace
Zoomed in picture of code from video above.
Mocha is seeing her new necklace for the first time. She likes it 🙂
A happy hedgehog

NeoPixel and IR activity cards for your students

https://microblocks.fun/learn#activity_cards
https://microblocks.fun/learn#activity_cards