pxt-calliope/olddocs/lessons/seismograph/activity.md

189 lines
6.0 KiB
Markdown
Raw Normal View History

2016-04-29 01:49:57 +02:00
# Seismograph Activity
2016-05-10 18:24:30 +02:00
Welcome! In this project, you will build your own seismograph. This activity will teach how to use the micro:bit to chart the strength of the acceleration. Let's get started! Project duration: 25 minutes.
2016-04-29 01:49:57 +02:00
2016-05-10 01:07:11 +02:00
### ~avatar avatar
2016-05-10 18:24:30 +02:00
Engineering: In this project, you will build your own seismograph micro:bit from tape and a household plate.
2016-04-29 01:49:57 +02:00
2016-05-10 00:50:39 +02:00
### ~
2016-04-29 01:49:57 +02:00
## What you'll need:
2016-05-12 00:35:24 +02:00
* BBC micro:bit
2016-05-11 20:10:55 +02:00
* micro USB cable
2016-05-10 00:20:51 +02:00
* Plate
* Tape
2016-05-05 23:23:56 +02:00
* Scissors
2016-04-29 01:49:57 +02:00
2016-05-11 20:09:38 +02:00
![](/static/mb/lessons/seismograph11.png)
2016-05-11 20:42:21 +02:00
# Engineering Steps
2016-05-11 20:11:46 +02:00
2016-05-10 19:54:25 +02:00
## 1.
2016-05-10 19:52:10 +02:00
Prepare Tape: Measure and cut approximately 10mm of tape. The tape will be fastened to a micro USB cable.
2016-05-05 23:23:56 +02:00
2016-05-10 01:41:43 +02:00
![](/static/mb/lessons/seismograph1.png)
2016-05-10 01:04:43 +02:00
2016-05-10 19:54:25 +02:00
## 2.
2016-05-10 19:52:10 +02:00
Fasten Tape: Fasten tape to the micro USB cable and to the plate. Attach the micro:bit to the micro:bit USB cable.
2016-04-29 01:49:57 +02:00
2016-05-10 01:02:22 +02:00
![](/static/mb/lessons/seismograph0.png)
2016-05-10 01:08:10 +02:00
### ~avatar avatar
2016-04-29 02:02:33 +02:00
2016-05-10 19:41:36 +02:00
Computer Science: The seismograph has been built. We are ready to program the micro:bit to be a seismograph!
2016-04-29 02:02:33 +02:00
### ~
2016-04-29 01:49:57 +02:00
2016-06-02 06:08:46 +02:00
# Programming Steps
2016-04-29 02:02:33 +02:00
2016-06-02 06:08:46 +02:00
## 3.
2016-04-29 02:02:33 +02:00
2016-06-02 06:08:46 +02:00
We will measure `acceleration (mg)` in terms of strength or Magnitude.
2016-04-29 01:49:57 +02:00
```blocks
input.acceleration(Dimension.Strength);
```
2016-06-02 06:08:46 +02:00
## 4.
2016-04-29 02:02:33 +02:00
2016-06-02 06:08:46 +02:00
Use the plot bar chart to visualize the acceleration on the LED screen. Use a forever to keep reading the acceleration value and displaying it on the screen.
2016-04-29 01:49:57 +02:00
```blocks
basic.forever(() => {
led.plotBarGraph(input.acceleration(Dimension.Strength), 0);
});
```
2016-05-11 22:36:36 +02:00
## 6.
2016-04-29 02:02:33 +02:00
2016-06-02 06:08:46 +02:00
At rest, the micro:bit is always subject to Earth gravity, whose magnitude is measured around ``1023``. Substract ``1023`` to measure a data close to ``0``.
2016-04-29 01:49:57 +02:00
```blocks
basic.forever(() => {
led.plotBarGraph(input.acceleration(Dimension.Strength) - 1023, 0);
});
```
### ~
2016-04-29 02:02:33 +02:00
2016-05-10 18:09:30 +02:00
### ~avatar avatar
2016-06-02 06:08:46 +02:00
Data Analysis: We now need to use the micro:bit to Analyze Data and chart for the strength of the acceleration.
2016-05-10 18:09:30 +02:00
### ~
2016-06-02 06:08:46 +02:00
# Data Analysis Steps
2016-05-11 20:12:39 +02:00
2016-05-11 22:36:36 +02:00
## 7.
2016-04-29 02:02:33 +02:00
2016-05-11 21:34:00 +02:00
First, notice that moving the micro:bit in the simulator in any direction, you will change the acceleration value, which is being displayed as the same color as the micro:bit simulator. Also, notice that by moving the micro:bit simulator, there is a changing acceleration value. Second, the flat colored horizontal line will start a waving line to display the value of the strength as measured in milli-gravities. Finally, notice that the LED display will fluctate based on the movement of the micro:bit simulator.
2016-04-29 01:49:57 +02:00
2016-05-11 21:34:00 +02:00
![](/static/mb/lessons/analyze20.png)
2016-04-29 01:49:57 +02:00
2016-05-11 22:36:36 +02:00
## 8.
2016-04-29 01:49:57 +02:00
2016-05-10 22:15:53 +02:00
Connect a micro:bit to your computer using your USB cable
2016-05-10 01:41:43 +02:00
2016-05-11 21:24:58 +02:00
![](/static/mb/lessons/seismograph33.png)
2016-05-10 01:32:06 +02:00
2016-05-10 22:15:53 +02:00
Click or tap the compile button for the seismograph program to run the program on the micro:bit.
2016-05-10 20:56:41 +02:00
2016-05-11 21:20:01 +02:00
![](/static/mb/lessons/seismograph22.png)
2016-05-10 20:56:41 +02:00
2016-05-11 22:36:36 +02:00
## 9.
2016-05-10 01:47:08 +02:00
2016-05-12 18:41:54 +02:00
A black line should appear directly beneath the colored line. The black line measures the micro:bit acceleration. And the colored line measures micro:bit simulator acceleration.
2016-05-10 20:40:46 +02:00
2016-05-10 21:28:45 +02:00
Run the acceleration experiment by vigarously moving the plate in any direction or move the object below the micro:bit (such as a table).
Every time the micro:bit moves in any direction, you generate data points that can be reviewed in Excel later. The more attempts to move the micro:bit, the more data to be reviewed in Excel.
2016-05-10 20:56:41 +02:00
2016-05-10 20:52:55 +02:00
![](/static/mb/lessons/seismograph5.png)
2016-05-10 20:47:35 +02:00
2016-05-11 22:36:36 +02:00
## 10.
2016-05-10 21:28:45 +02:00
2016-05-10 21:31:22 +02:00
Please find seismogrph experiment obervations:
2016-05-10 21:28:45 +02:00
2016-05-11 19:39:19 +02:00
First, notice that moving the micro:bit in any direction, you will change the acceleration value, which is being displayed as a milli-gravities value. By moving the micro:bit, there will be a changing acceleration value.
2016-05-10 20:47:35 +02:00
![](/static/mb/lessons/seismograph7.png)
2016-05-12 18:41:54 +02:00
Second, the horizontal line will move to plot the value of the strength as measured in milli-gravities. The horizontal line's movement is based on the micro:bit acceleration in Magnitude or Strength.
2016-05-10 20:52:55 +02:00
![](/static/mb/lessons/seismograph6.png)
2016-05-10 20:40:46 +02:00
2016-05-10 21:28:45 +02:00
Third, notice that the LED display fluctates based on the movement of the micro:bit.
![](/static/mb/lessons/seismograph8.png)
2016-05-12 18:41:54 +02:00
Now we are ready to graph or chart the accceleration of the micro:bit. We want a printout of the micro:bit acceleration graphed in Excel.
2016-05-10 21:28:45 +02:00
2016-05-11 22:36:36 +02:00
## 11.
2016-05-10 01:47:08 +02:00
2016-05-10 21:31:22 +02:00
In order to receive the the data plotted by Excel, click or tap anywhere in the on the chart data.
2016-05-10 21:28:45 +02:00
2016-05-10 20:40:46 +02:00
![](/static/mb/analyze1.png)
2016-05-10 21:28:45 +02:00
2016-05-11 22:36:36 +02:00
## 12.
2016-05-10 20:40:46 +02:00
2016-05-10 21:28:45 +02:00
You have two options to Analyze Data:
2016-05-10 20:21:40 +02:00
2016-05-10 21:28:45 +02:00
* Local File: Save the data to your local Downloads folder and open it in Excel.
* Stream to Cloud: Upload your data to Microsoft Azure to analyze it.
2016-04-29 01:49:57 +02:00
2016-05-10 21:28:45 +02:00
Click or tap Download data
2016-04-29 02:02:33 +02:00
2016-06-02 17:33:21 +02:00
![](/static/mb/lessons/seismograph9.png)
2016-05-10 01:32:06 +02:00
2016-05-11 22:36:36 +02:00
## 13.
2016-04-29 01:49:57 +02:00
2016-05-10 20:40:46 +02:00
A CSV file will be generated to display the data points collected by the micro:bit. Click or tap on the data Excel file that was downloaded to your local Downloads Folder.
2016-05-11 20:51:52 +02:00
![](/static/mb/lessons/analyze9.png)
2016-05-11 22:36:36 +02:00
## 14.
2016-05-10 20:40:46 +02:00
2016-05-11 00:20:56 +02:00
Select the data that you want to include in your chart. The chart should include the first two columns: time and acceleration.
2016-05-10 23:23:34 +02:00
2016-05-11 00:20:56 +02:00
Click or tap on the first two columns (A, B) to include time and acceleration data from the micro:bit
2016-05-10 23:23:34 +02:00
2016-05-11 22:36:36 +02:00
## 15.
2016-05-10 22:29:07 +02:00
2016-05-11 00:20:56 +02:00
Click or tap on Insert then select Recommended Charts. We can select a chart thats just right for the data.
2016-05-10 19:47:51 +02:00
2016-05-10 23:05:25 +02:00
![](/static/mb/analyze3.png)
2016-05-11 00:20:56 +02:00
On the Recommended Charts tab, scroll through the list of chart types that Excel recommends for your data.
2016-05-10 19:47:51 +02:00
2016-05-11 00:20:56 +02:00
We want to select the chart called Line. A line chart is used to display trends over time. We will use the line chart because there are many data points over time.
2016-05-10 19:47:51 +02:00
2016-05-11 00:20:56 +02:00
Click on the chart type to see how your data will look in that format. When you find the chart type that you want, click it, and then click OK.
2016-04-29 01:49:57 +02:00
2016-05-11 21:08:19 +02:00
![](/static/mb/lessons/analyze16.png)
2016-04-29 01:49:57 +02:00
2016-05-11 00:20:56 +02:00
Tip: If you dont see the line chart, click the All Charts tab to see the line chart.
2016-04-29 01:49:57 +02:00
2016-05-11 22:36:36 +02:00
## 16.
2016-04-29 01:49:57 +02:00
2016-05-11 00:20:56 +02:00
Use the Chart Elements, Chart Styles, and Chart Filters buttons next to the upper-right corner of the chart to add chart elements like axis titles or data labels, to customize the look of your chart
2016-04-29 01:49:57 +02:00
2016-05-11 00:20:56 +02:00
Alternatively, click or tap on the Design Ribbon.
2016-04-29 01:49:57 +02:00
2016-05-11 00:20:56 +02:00
Let's select Style 10 as an example.
2016-04-29 02:02:33 +02:00
2016-05-11 21:08:19 +02:00
![](/static/mb/lessons/analyze19.png)
2016-04-29 01:49:57 +02:00
### ~avatar avatar
Excellent, you're ready to continue with the [challenges](/lessons/seismograph/challenge)
### ~