First 'science experiments' lesson (#640)

* First 'science experiments' lesson

* Add package tag for 'radio'

* Add attributions, links, and license logos
This commit is contained in:
Galen Nickel 2018-02-14 14:37:50 -08:00 committed by GitHub
parent 1b9a15715e
commit 6d38db5741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 385 additions and 1 deletions

View File

@ -130,6 +130,12 @@
* [Project](/courses/csintro/finalproject/project)
* [Examples](/courses/csintro/finalproject/examples)
* [Standards](/courses/csintro/finalproject/standards)
* [Science experiments](/courses/ucp-science)
* [Data collection](/courses/ucp-science/data-collection)
* [Overview](/courses/ucp-science/data-collection/overview)
* [Setup and procedure](/courses/ucp-science/data-collection/setup-procedure)
* [Resources](/courses/ucp-science/data-collection/resources)
## #reference

View File

@ -4,7 +4,7 @@ A collection of courses and tutorials built for the @boardname@.
## Classroom
Structured courses for teaching computer science in the classroom.
Structured courses for teaching science and technology in the classroom.
```codecard
[{
@ -12,6 +12,11 @@ Structured courses for teaching computer science in the classroom.
"description": "14 week computer science course for middle school grades 6-8",
"url":"/courses/csintro",
"imageUrl": "/static/courses/csintro.jpg"
}, {
"name": "micro:bit Science Experiments",
"description": "Science experiment lessons with measurements and data analysis activites",
"url":"/courses/ucp-science",
"imageUrl": "/static/courses/plonk.jpg"
}]
```

View File

@ -0,0 +1,27 @@
# micro:bit Science Experiments
The micro:bit Science Experiments are lessons geared for students in middle school and early high school grades. The lessons are designed help the student gain a greater understanding of the forces and behavior of the physical world. This is done using methods of observation, measurement, and data analysis. By incorporating the micro:bit in the experiments, the lessons are a great way to teach both science and computing in the same activity.
These lessons guide the student in hands-on, practical measurement activities along with using the micro:bit to control and record data for the experiments. Each lesson provides an overview of the activity, outlines expected results, explains the setup of the experiment, and the gives a coding activity to measure and collect the data.
## Lesson series
### ~hint
This is a new course, so we're adding new lessons. All lessons will be available here shortly.
### ~
The lesson series includes:
* [micro:bit Data Collection Methods](/courses/ucp-science/data-collection)
* Population Trait Data Counter
* Temperature Data
* Soil Moisture Tester
* Body Electrical & Waves
* Magnetic Forces
* Electricity - Battery Tester
The [micro:bit Science Experiments](https://sites.google.com/view/utahcodingproject/csta/microbit-science-experiments) lesson series is generously provided by the [Utah Coding Project](https://sites.google.com/view/utahcodingproject/home) and is developed by [Carl Lyman](mailto:utahcoding@outlook.com).
[![CC BY-NC-SA](https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png)](https://creativecommons.org/licenses/by-nc-sa/4.0/)

View File

@ -0,0 +1,15 @@
# Data collection
This lesson introduces the student to using the micro:bit to take measurements and report the results. A few brief experiments are presented and data collected from the experiments is graphed in the MakeCode editor. The data is then available to download to a spreadsheet program for further analysis.
## Contents
* [Overview](/courses/ucp-science/data-collection/overview)
* [Setup and procedure](/courses/ucp-science/data-collection/setup-procedure)
* [Resources](/courses/ucp-science/data-collection/resources)
<br/>
| | | |
|-|-|-|
| Adapted from "[Microbit Data Collection Methods](https://drive.google.com/open?id=13Mi6caoelyzgch6tUj-wlw0bmgS7ikGEwYR2a37mEww)" by [C Lyman](http://utahcoding.org) | | [![CC BY-NC-SA](https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-nc-sa/4.0/) |

View File

@ -0,0 +1,62 @@
# Overview
## Science concept
Science is a way of knowing, a process for gaining knowledge and understanding of the natural world. Engineering combines the fields of science, technology, and mathematics to provide solutions to real-world problems. Students should be active learners who demonstrate their scientific understanding by using it. It is not enough for students to read about science; they must participate in the three dimensions of science. They should observe, inquire, question, formulate and test hypotheses, analyze data, report, and evaluate findings. The students, as scientists, should have hands-on, active experiences throughout the instruction of the science curriculum. These standards help students find value in developing novel solutions as they engage with complex problems.
![microbit display side view](/static/courses/ucp-science/data-collection/mb-display-side.jpg)
## Project goal
To use a variety of methods to collect science experiment data using microbits and its sensors. The micro:bit is the result of companies and communities all around the world working together to help people learn to code, and become confident and creative with technology. The BBCs Microbit is a small programmable device created in the UK and is given to all 7th graders to help them learn coding, to see the relationship between hardware and software, and how to use it in an innovative way.
![microbit front side view](/static/courses/ucp-science/data-collection/mb-front-side.jpg)
## micro:bit features
The micro:bit has these features:
* 25 individually-programmable LEDs
* 2 programmable buttons
* Physical connection pins (GPIO)
* Light and temperature sensors
* Motion sensors (accelerometer and compass)
* Wireless Communication, via Radio and Bluetooth
* USB interface
Read about what the micro:bit can do at the [micro:bit features](http://microbit.org/guide/features/) page.
## Prior knowledge
Students need:
* a basic knowledge of how to code using block style programming (Scratch, Code.org, etc.)
* some knowledge file management skills in Windows.
* to know how to download a program and copy it to a micro:bit.
See [Using a micro:bit in 5 easy steps](http://microbit.org/guide/quick/) for a quick introduction to using the micro:bit.
## Student outcomes
Students will:
* create experiments to collect data using microbits and its sensors.
* setup different experiments to observe the effects.
* code a microbit to collect data by observing the data displayed on the LED screen.
* code a microbit to collect data, graph it, and download it using a USB cable and a serial write value command.
* code the microbits to collect data remotely over the microbit radios.
* analyze the data collected.
## Materials Needed
* A microbit with a longer USB cable
* Windows 10 MakeCode app
* 2 microbits with batteries connected
* A longer USB microbit cable
* Spreadsheet program for data analysis
<br/>
| | | |
|-|-|-|
| Adapted from "[Microbit Data Collection Methods](https://drive.google.com/open?id=13Mi6caoelyzgch6tUj-wlw0bmgS7ikGEwYR2a37mEww)" by [C Lyman](http://utahcoding.org) | | [![CC BY-NC-SA](https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-nc-sa/4.0/) |

View File

@ -0,0 +1,52 @@
# Resources
## Utah Science with Engineering Education (SEEd)
* [Utah Science Website](https://schools.utah.gov/curr/science)
* [Utah Grades 6-8 SEEd Standards](https://schools.utah.gov/file/265a0b53-b6a7-48fb-b253-b6a5f38ffe19)
* [Sixth grade OER Science text](https://eq.uen.org/emedia/items/dae58176-b839-4b26-87e4-09ca5ed98875/1/Grade6RS.pdf)
* [Seventh grade OER Science text](https://eq.uen.org/emedia/items/afd89ff1-054c-4ac5-a712-67f4c6029644/1/Grade7RS.pdf)
* [Eighth grade OER Science text](https://eq.uen.org/emedia/items/e5219302-32b9-4c2f-ad65-38f303da6654/1/Grade8RS.pdf)
## CSTA Standards
Computer Science Teachers Association (CSTA) Standards 2017.
http://www.csteachers.org/page/standards.
### Level 2 (Grades 6-8)
#### Computing Systems
* 02 - Design projects that combine hardware and so􀁸ware components to collect and exchange data.
* 03 - Systematically identify and fix problems with computing devices and their components.
#### Networks & the Internet
* 04 - Model the role of protocols in transmitting data across networks and the Internet.
#### Data and analysis
* 07 - Represent data using multiple encoding schemes.
* 08 - Collect data using computational tools and transform the data to make it more useful and reliable.
* 09 - Refine computational models based on the data they have generated.
#### Algorithms and programming
* 11 - Create clearly named variables that represent different data types and perform operations on their values.
* 13 - Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.
* 17 - Systematically test and refine programs using a range of test cases.
* 19 - Document programs in order to make them easier to follow, test, and debug.
## micro:bit
* [Microbit.org](http://microbit.org)
* [MakeCode.com](https://makecode.com)
* [Utah Coding Project](http://utahcoding.org)
* [Blog entry on Windows 10 MakeCode app](https://sites.google.com/view/utahcodingproject/blog/2018-jan-makecode-app)
<br/>
| | | |
|-|-|-|
| Adapted from "[Microbit Data Collection Methods](https://drive.google.com/open?id=13Mi6caoelyzgch6tUj-wlw0bmgS7ikGEwYR2a37mEww)" by [C Lyman](http://utahcoding.org) | | [![CC BY-NC-SA](https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-nc-sa/4.0/) |

View File

@ -0,0 +1,217 @@
# Setup and procedure
## micro:bit setup and coding concepts
This document describes different methods using micro:bits to collect and record data for science experiments. There are several ways to collect data from an experiment. The simplest is having the data display on the LED screen and manually record the data on a paper. Data can also be collected using the Windows 10 MakeCode app. The third way is using 2 micro:bits with one observing the data and then radioing the results to a second micro:bit so it can allow the remote collection of data.
## Data collection options
### Option 1 - LED display
Data collection can be setup to display data collected from different micro:bit sensors on the LEDs by using a ``|||basic:show number||`` block from the ``||basic:Basic||`` toolbox:
```blocks
basic.showNumber(input.temperature())
```
As data is displayed it can then be recorded on a paper for further analysis.
Data can also be displayed graphically on the micro:bit using the ``||led:plot bar graph o||`` block from the ``||led:LED||`` toolbox.
```blocks
led.plotBarGraph(
input.temperature(), 0
)
```
### Option 2 - micro:bit Windows 10 MakeCode app and a USB connection
The Windows 10 MakeCode app allows data to be directly read from the micro:bit when it is attached using USB cable. Data can be sent from the micro:bit to the Windows 10 MakeCode app using serial data connection. The data collected over the serial connection can be graphed and the data can be downloaded. A limit of only about the last 20 seconds of data can be downloaded as a "data.csv" file. This allows the collection of data in real time. This file can be opened in a spreadsheet for further analysis. Many different kinds of experiments can be performed using this data logging technique.
You can download the [Windows 10 MakeCode](https://www.microsoft.com/store/apps/9PJC7SV48LCX) app.
With the program downloaded from the MakeCode app to the micro:bit and the USB cable left connected and using the ``||serial:serial write value||`` block from the ``||serial:Serial||`` toolbox in the **Advanced** tool section.
```blocks
serial.writeValue("Celsius", input.temperature())
```
When the program is running, a purple **Show data Device** button shows up under the Simulator. By clicking on the button the data being observed can be monitored and graphed in the **Show data Device** window.
![Show data device button](/static/courses/ucp-science/data-collection/show-data-device.jpg)
The graph is highlighted with the blue box. The **Download** button in the red highlighted box allows the downloading of the recorded data as a CSV file which can be opened in a spreadsheet and analyzed.
![Graph of recorded temperature values](/static/courses/ucp-science/data-collection/temperature-graph.jpg)
### Option 3 - Remote radio collecting to receiving radio displaying
Two micro:bits can be used to collect and record data using the radio commands. One micro:bit can be setup remotely and the other micro:bit can be used to observe the data. The first micro:bit can send the data it observes to the second micro:bit for the observer to record. To set up 2 micro:bits so they can communicate over the radio they need to be on the same radio group.
#### micro:bit radio sending code
In the starting of the code the title is displayed, radio group 99 is setup, and the initial ``temperature`` variable is set to `0`.
In the forever loop the temperature is collected from the micro:bit sensor and stored in the ``temperature`` variable. The temperature is displayed on the LED display. A radio signal is sent to all micro:bit radios in group `99`. The program pauses for 1000 milliseconds and then loops again.
```blocks
// Temperature Radio Sender
// by C Lyman
// January 2018
temperature = 0
basic.showString("TEMPERATURE RADIO REMOTE")
radio.setGroup(99)
let temperature = 0
// Forever Loop event
basic.forever(() => {
temperature = input.temperature()
basic.showNumber(temperature)
radio.sendNumber(temperature)
basic.pause(1000)
})
```
Shared "Temperature Radio Sender" program: https://makecode.micro:bit.org/_DLmi641H5CP0
#### Radio receiver code
In the starting of the code the title is displayed, radio group 99 is setup, and the initial ``temperature`` variable is set to `0`.
In the radio received event, the temperature is received from sending the micro:bit radio. The received temperature is then displayed on the LED display. This is repeated whenever a radio signal is received.
```typescript
// Temperature Radio Receiver
// by C Lyman
// January 2018
temperature = 0
basic.showString("TEMPERATURE RADIO RECEIVER")
radio.setGroup(99)
let temperature = 0
// Radio Packet Received event
radio.onDataPacketReceived( ({ receivedNumber: temperature }) => {
basic.showNumber(temperature)
})
```
### micro:bit radio receiver code with serial write
This code is the same as above but one additional line of code is added to write to the word `"Celisus"` and the temperature to the MakeCode app to the USB serial connection. This is the same as described peviously in [Option 2](#option-2-micro-bit-windows-10-makecode-app-and-a-usb-connection).
```typescript
// Temperature Radio Receiver
// by C Lyman
// January 2018
temperature = 0
basic.showString("TEMPERATURE RADIO RECEIVER SERIAL")
radio.setGroup(99)
let temperature = 0
// Radio Data Packet Received event
radio.onDataPacketReceived( ({ receivedNumber: temperature }) => {
basic.showNumber(temperature)
serial.writeValue("Celisus", temperature)
})
```
Shared "Temperature Radio Receiver" program: https://makecode.micro:bit.org/_44HRETXpC2ib
## Sample Project to Collect Accelerator Data
This sample project demonstrates the coding of the 2 micro:bits to collect data from the micro:bit accelerator sensor. It will also show the data collection and downloaded data to be further analyzed in a spreadsheet.
### "Sender" micro:bit code
Code the first micro:bit using MakeCode for micro:bit. Name the project, "Gravity Sender".
The ``||basic:on start||`` event will display the title and function of the micro:bit in all caps, `"GRAVITY SENDER"`. Add some comments to the ``||basic:on start||`` event:
* Name of the project
* Creator
* Date created
![Show comment block](/static/courses/ucp-science/data-collection/comment-block.jpg)
Set up a radio group using the ``||radio:radio set group||``. Both micro:bits need the same radio group.
```blocks
// Gravity Sender
// by C Lyman
// Jan 2018
basic.showString("GRAVITY SENDER")
radio.setGroup(99)
```
The ``||basic:forever||`` event will constantly monitor the _strength_ of the acceleration and send the value to any other micro:bits that might be receiving radio signals in the same radio group.
Open the pull down menu in the ``||input:acceleration||`` block and and change the ``x`` value to the ``strength`` value. This maximizes the x, y, and z dimensions of the acceleration into one value.
```blocks
basic.forever(() => {
radio.sendNumber(input.acceleration(Dimension.Strength))
})
```
Shared "Gravity Sender" program: https://makecode.micro:bit.org/_83oRcxDfyPpa
### "Receiver" micro:bit code
Using the Windows 10 MakeCode app, setup and code the second micro:bit. This micro:bit will remain connected to the computer through the USB cable and the Windows 10 MakeCode app to monitor the data being received.
Name the project, "Gravity Receiver". The ``||basic:on start||`` event will display the title and function of the micro:bit in all caps, `"GRAVITY RECEIVER"`. Add comments to the ``||basic:on start||`` event like before: Name the project, creator, and date created. Set up a radio group using the ``||radio:radio set group||`` block. Both micro:bits need the same radio group.
```blocks
// Gravity Receiver
// by C Lyman
// Jan 2018
basic.showString("GRAVITY RECEIVER")
radio.setGroup(99)
```
The ``||radio:on radio received||`` event will constantly monitor radio signals from the radio group.
When a value is received from the group it is stored in the ``gravity`` variable.
The ``||serial:serial write value||`` sends 2 pieces of data back to the MakeCode app through the USB cable. First it sends a label `"gravity"` and then the value received as gravity from the ``||input:acceleration||`` method from the first micro:bit.
```blocks
radio.onDataPacketReceived( ({ receivedNumber: gravity }) => {
serial.writeValue("gravity", gravity)
})
```
Shared "Gravity Receiver" program: https://makecode.micro:bit.org/_gXjhkyb3PWzh
### Monitoring, downloading, and analyzing the data
With the micro:bit code downloaded from the MakeCode app to the micro:bit and the USB cable connected it will start receiving data from the first micro:bit. Under the simulator in the app a purple outlined button shows up **Show data Device**.
![Show data device button](/static/courses/ucp-science/data-collection/show-data-device.jpg)
By clicking on the **Show data Device** button a window opens up to the right showing values and graph of the gravity data being received (The dips in the graph are 3 tosses of the micro:bit in the air).
![Graph of acceleration values](/static/courses/ucp-science/data-collection/acceleration-graph.jpg)
The **Download** button in the red highlighted box allows the downloading of about the last 20 seconds of recorded data as a CSV file.
![Graph with download button](/static/courses/ucp-science/data-collection/temperature-graph.jpg)
When the data recorded is downloaded as a CSV spreadsheet file, it is named "data.csv".
#### ~hint
The CSV file usually opens in directly into a spreadsheet but sometimes it doesnt which makes it hard to find. A search of the C:\ drive might be necessary to find it.
#### ~
Here is a link to sample downloaded data from the "data.csv" file that's already imported into Google Sheets:
https://docs.google.com/spreadsheets/d/1L_3Gq61UFEEjVZYQk31yTwzrTF3nlv55Ic2CjQdbIW8/edit?usp=sharing
Additional analysis and graphing can be done in a spreadsheet.
<br/>
| | | |
|-|-|-|
| Adapted from "[Microbit Data Collection Methods](https://drive.google.com/open?id=13Mi6caoelyzgch6tUj-wlw0bmgS7ikGEwYR2a37mEww)" by [C Lyman](http://utahcoding.org) | | [![CC BY-NC-SA](https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-nc-sa/4.0/) |
```package
radio
```

BIN
docs/static/courses/plonk.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB