---
title: micro:bit Light and Music Show
description: Students will create their own light and music show using micro:bit and gator:boards.
image: https://activities.sparkfuneducation.com/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure%202.a.jpg
---

[![Sparkfun](https://www.sparkfuneducation.com/img/logo.png)](https://www.sparkfuneducation.com/index.html)

- [SparkFun Webstore](https://www.sparkfuneducation.com)
- [Higher Ed](https://sparkfuneducation.com/higher-ed/index.html)
- [Contact Us](https://www.sparkfuneducation.com/contact-us.html)
- [Follow Us](https://twitter.com/SparkFunEDU)

- [Home](https://www.sparkfuneducation.com)
- [Blog](https://blog.sparkfuneducation.com)
- [Curriculum](https://www.sparkfuneducation.com/curriculum.html)
- [PD/Events](https://www.sparkfuneducation.com/professional-dev.html)
- [KITS/Materials](https://www.sparkfuneducation.com/materials.html)
- [Educator Stories](https://www.sparkfuneducation.com/educator-stories.html)
- [Activities](https://activities.sparkfuneducation.com)

![STEAM Classroom Download](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/jeff-classroom-backgroun.jpg?width=1440&name=jeff-classroom-backgroun.jpg "STEAM Classroom Download")

![steam-activities-2](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/steam-activities-2.png?width=600&name=steam-activities-2.png "steam-activities-2")

Bringing maker education and computational thinking to the classroom.

## Latest Activities

Search this site on Google

S

[Michael Jones](https://activities.sparkfuneducation.com/author/michael-jones)

Dec 13, 2019

## [How Turbid is Your Pond? Using Comput...](https://activities.sparkfuneducation.com/how-polluted-is-your-pond-using-computer-systems-to-monitor-the-environment)

[Arduino](https://activities.sparkfuneducation.com/topic/arduino)

<https://activities.sparkfuneducation.com/how-polluted-is-your-pond-using-computer-systems-to-monitor-the-environment>

[![Alexandra Gendreau Chakarov](https://activities.sparkfuneducation.com/hs-fs/hubfs/agc_headshot.jpg?width=20&name=agc_headshot.jpg) Alexandra Gendreau Chakarov](https://activities.sparkfuneducation.com/author/alexandra-gendreau-chakarov)

Oct 15, 2019

## [Monitor My Plant](https://activities.sparkfuneducation.com/monitor-my-plant)

[micro:bit](https://activities.sparkfuneducation.com/topic/microbit)

<https://activities.sparkfuneducation.com/monitor-my-plant>

[![Alexandra Gendreau Chakarov](https://activities.sparkfuneducation.com/hs-fs/hubfs/agc_headshot.jpg?width=20&name=agc_headshot.jpg) Alexandra Gendreau Chakarov](https://activities.sparkfuneducation.com/author/alexandra-gendreau-chakarov)

Oct 14, 2019

## [Classroom Noise Monitor with micro:bi...](https://activities.sparkfuneducation.com/classroom-noise-monitor)

[micro:bit](https://activities.sparkfuneducation.com/topic/microbit)

<https://activities.sparkfuneducation.com/classroom-noise-monitor>

[![Alexandra Gendreau Chakarov](https://activities.sparkfuneducation.com/hs-fs/hubfs/agc_headshot.jpg?width=20&name=agc_headshot.jpg) Alexandra Gendreau Chakarov](https://activities.sparkfuneducation.com/author/alexandra-gendreau-chakarov)

Oct 14, 2019

## [micro:bit Light and Music Show](https://activities.sparkfuneducation.com/light-and-music-show)

[micro:bit](https://activities.sparkfuneducation.com/topic/microbit)

<https://activities.sparkfuneducation.com/light-and-music-show>

## Featured Stories

- [micro:bit](https://activities.sparkfuneducation.com/topic/microbit)
- [Arduino](https://activities.sparkfuneducation.com/topic/arduino)

[![Alexandra Gendreau Chakarov](https://activities.sparkfuneducation.com/hubfs/agc_headshot.jpg)](https://activities.sparkfuneducation.com/author/alexandra-gendreau-chakarov)

 By

[Alexandra Gendreau Chakarov](https://activities.sparkfuneducation.com/author/alexandra-gendreau-chakarov)

 October 14, 2019

<https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Factivities.sparkfuneducation.com%2Flight-and-music-show> <https://www.twitter.com/share?url=https%3A%2F%2Factivities.sparkfuneducation.com%2Flight-and-music-show> <http://www.linkedin.com/shareArticle?mini=true&url=https://activities.sparkfuneducation.com/light-and-music-show>

## [micro:bit Light and Music Show](https://activities.sparkfuneducation.com/light-and-music-show)

  [micro:bit](https://activities.sparkfuneducation.com/topic/microbit)

**Activity Name:**

Light and Music Show

**Grade Level:**

7 (Could work for 5-8)

**Time Required:**

180 minutes (approximately 2-3 class periods)

**Expendable Cost:**

$0

**Group Size:**

2

**Subject area:**

science, technology

 

 

**Summary:**

Students design a light and music show that is controlled using the gator:environment sensor, which will measure things such as temperature, humidity, and carbon dioxide. The students begin by using one value collected by the sensor, such as temperature, to control sequences of lights and sound. They then augment their project using multiple values collected by the sensor (i.e. temperature and humidity). Students must use at least two different values. This would work well in a class that has some optional project work at the end. Students will be able to complete simple shows in the 3 class periods for this activity, but there is a lot of room for personalization and continued development for interested groups of students.

 

**Keywords**:

micro:bit, gator:bit, gator: environment, environmental sensor, middle school, coding, music, lights

 

**Educational Standards:**

*ISTE*

- Innovative Designer 4c
- Computational Thinker 5d
- Creative Communicator 6b

*NGSS*

- SEP 4: Analyzing and Interpreting Data 
    - MS-ETS1-3: Analyze data from tests to determine similarities and differences among several design solutions to identify the best characteristics of each that can be combined into a new solution to better meet the criteria for success.
- SEP 8: Obtaining, Evaluating, and Communicating Information 
    - MS-PS4-3: Integrate qualitative scientific and technical information to support the claim that digitized signals are a more reliable way to encode and transmit information than analog signals.
    - MS-LS1-8: Gather and synthesize information that sensory receptors respond to stimuli by sending messages to the brain for immediate behavior or storage as memories.

**Prerequisite Knowledge:**

Students should have some experience programming the micro:bit. This project requires more familiarity with variables and if/then/else statements. Ideally, students will have some understanding of these topics through other programming environments or previous MakeCode activities. Students should be comfortable with the rock paper scissors tutorial on the[MakeCode website](https://makecode.microbit.org/). Additionally students should be comfortable exploring unknown blocks and experimenting to figure out how they work.

 

**Learning Objectives:**

1. Students iterate on their light and music show at least once based on feedback from the class and their own developing understanding.
2. Students develop an automated light and music show that displays information about the environment.
3. Students create original compositions and sequences of lights to create a light and music show using the values obtained from the gator:environment to control the display.

**Materials List:**

- micro:bit
- USB cord
- Power supply (micro:bit battery pack should be sufficient)
- gator:bit
- gator:environment Sensor
- 4 alligator clips
- Computer or tablet capable of flashing code to micro:bit

**Introduction / Motivation:**

*(Begin by showing at least a couple minutes of [the symphony of lights in Hong Kong.](https://www.youtube.com/watch?v=FeyX2oWis1U))* What did you notice about the video? How do you think they are creating something like this? *(Get kids excited and thinking about how to create something similar.)* Today you get to design your own light and music show.

 

**Procedure:**

*Background*

Make sure you are familiar with the different capabilities of the gator:bit and micro:bit. The main ones to focus on here are the different ways to represent information using the 5 LEDS on the gator:bit controlled by pin P12, the speaker controlled by pin P0, and the 25 LEDs on the micro:bit itself (see Figure 1). In addition, make sure you are familiar with the [gator:environment sensor](https://learn.sparkfun.com/tutorials/sparkfun-gatorenvironment-hookup-guide/all) and how to wire it (see Figure 2). There are two blocks for controlling the gator:environment (see Figure 3). The main thing to ***remember is to connect the ground wire first to prevent any incomplete circuits***. Incomplete circuits can cause parts of the system to heat up.

 

![Figure 1](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure%201.jpg?width=552&name=Figure%201.jpg)

*Figure 1: Ways to use the gator:bit/micro:bit to represent information.*

 

![Figure 2.a](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure%202.a.jpg?width=369&name=Figure%202.a.jpg)![Figure 2.b](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure%202.b.jpg?width=273&name=Figure%202.b.jpg)

 

 

 

 

 

 

 

 

 

*Figure 2: Wiring diagram for the gator:environment sensor and picture of an actual set up.*

 

| ![Figure3a](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure3a.png?width=261&name=Figure3a.png) | This block must be run in the on start block to make a little room on the micro:bit for the gator:environment to get the values from the sensor. |
| --- | --- |
| ![Figure 3.b](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure%203.b.png?width=255&name=Figure%203.b.png) | The gator:environment can measure six different things: temperature in Fahrenheit and Celsius, Pressure, Humidity, Carbon Dioxide (CO2) and Total Volatile Organic Compounds. To change which value the gator:environment gives you, click the down arrow in the block sensor. |

*Figure 3: Control blocks for the gator:environment.*

 

*Before the Activity*

- Separate all the materials so that each group has all the parts they need.  
  \*I recommend printing out the wiring guidelines in Figure 2.
- Print the [environmental sensor activity sheet](https://activities.sparkfuneducation.com/hubfs/EDU/Activities/2019/Lights%20and%20Music/Lights%20and%20Music%20Activity%20Sheet.pdf) that guides students through the activity

 

*With the Students*

- Divide the class into pairs and make sure each pair has a set of the materials
- The first step is to wire the sensor so students can start taking measurements. Have students wire their particle sensor using the wiring diagram in *Figure 2.*
- Confirm that students have wired the sensor correctly by having them share their wiring configuration with another pair of students.
- The first project that students will code gets them familiar with creating light and sound effects controlled using one value from the gator:environment.
- If students are familiar with the different options for display on the gator:bit and micro:bit, they can proceed to making a plan for the single value sensor.
- Show students the different options they have for creating their lights and music show. This can be done by showing one you created (This is a [video example](https://youtu.be/tq0cdpkkbBA)of a possible solution. This is the [MakeCode project](https://makecode.microbit.org/64123-18155-81632-55192) that corresponds to the video example.) or just illustrate the different features on the gator:bit/micro:bit as shown in *Figure 1*.
- First students make a plan for the single sensor value controlled light and music show using the [activity sheet](https://activities.sparkfuneducation.com/hubfs/EDU/Activities/2019/Lights%20and%20Music/Lights%20and%20Music%20Activity%20Sheet.pdf).
- Students create a new project on [MakeCode](https://makecode.microbit.org/) and import the sensor library by going to Extensions and searching for the [this repository](https://github.com/sparkfun/pxt-gator-particle)(see *Figure 4*). For students to use the LEDs on the gator:bit they should import the neopixel library (see *Figure 5*).
  
  | ![Figure 4a](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure%204a.png?width=182&name=Figure%204a.png) | ![Figure 4b](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure%204b.png?width=117&name=Figure%204b.png) | ![Figure 4c](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure%204c.png?width=1156&name=Figure%204c.png) | ![Figure 4d](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure%204d.png?width=299&name=Figure%204d.png) |
  | --- | --- | --- | --- |
  
  *Figure 4: Sequence of moves in MakeCode to add the gator:environment.*

| ![Figure 4a](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure%204a.png?width=187&name=Figure%204a.png) | ![Figure 4b](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/Figure%204b.png?width=158&name=Figure%204b.png) | ![image4 edit](https://activities.sparkfuneducation.com/hs-fs/hubfs/EDU/Activities/2019/Lights%20and%20Music/image4%20edit.png?width=383&name=image4%20edit.png) |
| --- | --- | --- |

*Figure 5: Sequence of moves in MakeCode to add the neopixel library*

1. Once students have finished the single sensor value controlled light and music show, have them partner with another pair of students and try out each others designs.
2. Now students move on to adding addition sensor values. Again have the students plan their design using the activity sheet.
3. Students build on the MakeCode project they already created to add more complexity.
4. Once students complete their programs, have them test it out. This is a [video example](https://youtu.be/tq0cdpkkbBA) of a possible solution. This is [the MakeCode project](https://makecode.microbit.org/64123-18155-81632-55192) that corresponds to the video example.
5. Students conduct design share outs where they explain their design choices. Some suggested strategies for doing this are
6. Finish with a brief whole class discussion on struggles the students had completing the tasks and how they overcame them.

**Troubleshooting Tips:**

- Coding
- gator:environment
- Wiring
- Displays

**Going Further:**

- Students can add more lights to their show using the [gator:color](https://www.sparkfun.com/products/14890) board.

 

 

 

![](https://static.hubspot.com/final/img/content/email-template-images/placeholder_200x200.png)

### Subscribe Email

### Popular Activities

<https://activities.sparkfuneducation.com/keep-out-make-an-electronic-safe-with-remote-alarm>

[Keep Out! Make an Electronic Safe with Remote Alarm](https://activities.sparkfuneducation.com/keep-out-make-an-electronic-safe-with-remote-alarm) Aug 13, 2019

<https://activities.sparkfuneducation.com/classroom-noise-monitor>

[Classroom Noise Monitor with micro:bit](https://activities.sparkfuneducation.com/classroom-noise-monitor) Oct 14, 2019

<https://activities.sparkfuneducation.com/heart-rate-monitor>

[Heart Rate Monitor](https://activities.sparkfuneducation.com/heart-rate-monitor) Oct 10, 2019

### Popular Tags

[micro:bit](https://activities.sparkfuneducation.com/topic/microbit) [Arduino](https://activities.sparkfuneducation.com/topic/arduino)

[Tweets by @SparkFunEDU](https://twitter.com/SparkFunEDU)

[Previous Post](https://activities.sparkfuneducation.com/heart-rate-monitor)

##### [Heart Rate Monitor](https://activities.sparkfuneducation.com/heart-rate-monitor)

[Next Post](https://activities.sparkfuneducation.com/classroom-noise-monitor)

##### [Classroom Noise Monitor with micro:bit](https://activities.sparkfuneducation.com/classroom-noise-monitor)

[![SparkFun Education](https://www.sparkfuneducation.com/img/logo.png)](http://www.sparkfuneducation.com/index.html)

#### Other Resources

- [Contact Us](http://www.sparkfuneducation.com/contact-us.html)
- [About SparkFun](http://www.sparkfun.com)
- [FAQs](https://www.sparkfun.com/static/faq)

- [Customer Service](https://www.sparkfun.com/support)
- [Shipping](https://www.sparkfun.com/support)
- [Terms and Conditions](https://www.sparkfun.com/terms)

#### Sign Up for Newsletter

© Copyright 2016. All Rights Reserved.