What to expect
In the last activity you set up your own Kitronik Air Quality Board. In this activity, you will be coding your micro:bit and Kitronik Air Quality Board to collect data from different locations at your school.
Connections
In our last activity, we became familiar with using the Kitronik Air Quality Board. This activity will explore how to collect data with an air quality sensor.
Materials
Micro:bit
Kitronik Air Quality (AQ) Board
Instructions
Now that you are familiar with coding the Kitronik Air Quality Board, we will program it to record data. Find 4-5 locations at your school that would be interesting to take these measurements from. Each group will choose measurement locations that they think might have good or bad air quality.
Open MakeCode and start a new project. A suggested file name would be “3.2 Kitronik AQ_Part 2”.
2. Click on the extensions tab. This is the tab that has the plus sign. It is at the bottom of the list, beneath the math tab.
3. After you enter the tab, type in “Kitronik air quality.” You should choose the one that says “kitronik-air-quality-v2-only”. Please note that the micro:bit's LED screen should be facing in when plugged into the AQ board.
4. Start with “on start” and add “establish gas baseline” and “setup gas sensor.”
5. Add “forever”; inside, add “measure all data reading.” This will be under the sensor tab under the air quality tab. Then under that, place "join" to add "T:" in front of "Read Temperature in C" and add "C" after to show the proper unit for the temperature reading. "Read Temperature in C" is located under "Display."
6. Repeat the previous step to add Pressure, Humidity, IAQ, and eCO2.
7. Add a “pause (ms)” block with a 5-second interval.
8. This shows how appropriate units are labeled with the data measured. In addition, you can see that a “T:” was added, so when it pops up on the Kitronik AQ display screen, it tells you what you are measuring with a proper unit that goes with the measurement.
It’s time to start recording the data. You can copy or download Table 1 and Table 2 via this link and then type in your data measurements collected from the five locations you chose. We will use the collected data next week to generate some useful graphs!
Table 1. Air quality data collection table example
Table 2. Measurement range for temperature, pressure, humidity, IAQ, and CO2
Think about it
In this activity you became familiar with the Kitronik air quality board and collected temperature, pressure, humidity, air quality index, and CO2 data.
Which location had the highest temperature? What do you think made this location the hottest?
Which location has the best or worst air quality? Why does this location have the best or worst air quality?
Feedback Link
How did you feel about this activity? Change the emoji to show your feelings.
Next Activity
In the next activity, we will graph the data we collected to compare different locations. Graphing can help you visualize the differences in the data set. You will also be comparing it with other groups.
Button-activated data collection
You may have noticed that we made today’s data collection manually. There is a way to make this process automated by pressing the button. You can download the code to program your Kitronik AQ board to save the collected data. Here are a couple of suggestions helpful for this extension activity.
You need to set the date and time in the program before you download, as the time stamps will be posted with the data measurements.
Once you download the program, wait 5 minutes to set up the gas sensor and establish the gas baseline & ambient temperature. Once it’s ready, you will see “✓” on the micro:bit display.
To collect data at each location, press the “A” button.
Once you are done with the data measurements, you need to turn off the AQ board. Then you turn it on and connect the micro:bit to the computer.
Now download the coding again to “transfer” the collected data to your computer. Wait for 5 minutes as you did in Step 2. Once it’s ready, press the “B” Button to transfer the data.
By pressing the “B” button, you will see “Show data” on the screen. Press it to see the collected data. This button is at the lower left corner, as shown in Figure 1.
Figure 1. Data transfer in the extension activity
7. Finally, you can export the collected data as a text file by pressing the icon at the top right corner of the screen.
8. Please note that downloading the collected data as an Excel file (“Export Data”) doesn’t work very well. That’s the blue icon right next to the one we used.
9. Once the text file is downloaded, you can generate the graph using Google Sheets or Microsoft Excel, as demonstrated in the next activity.