Missed lesson

Missed lessons: it is your responsibility to catch up with the work before the next lesson. This is in the school rules. It is also really important if you want to have all the work for tests. You will not get any sympathy or test concessions if you do not catch up as the resources are here !

 If you need help, contact me here.

Using the Microbits

 Updated October 2023

 How to use the Micro:bits to collect and then process data

1. Download this file: Microbits hex file

2. Go to www.makecode.microbit.org. Add a new project - call it battery or something sensible.

3. Import the Microbits hex file (it is in the downloads folder on your machine). The easiset way to do this is to  click the arrow on the top right of the  toolbar (in chrome) and drag the folder  from the 'recent downloads list, OR drag the file from the bottom of the browser window onto the right hand side of your makecode window. 

4. Plug the microbit into the laptop with the USB cable. Allow it to set up. Be patient with the next few steps and follow the instructions on screen by pairing the microbit by clicking on the three dots by 'download' on the purple bar, bottom right. Follow instructions to pair. 

5. Download the code file to the microbit by clicking download. The microbit should show R

6. If you do not have another text under where it says 'Show console, Simulator'.  If not, check with Karin.
 
7. Now connect up the circuit to the microbit as described below. The metal parts of the clip should cover the text on the microbit pins (0, 1,2 GND), and not overlap to other pins.

Summary of connections for microbit circuit and AA battery:

RED to 0 on microbit

BLACK to GND on microbit

GREEN   to the negative side (flat)  of the battery

YELLOW to the positive side (raised) of the battery


Summary of connections for microbit circuit and fruit:

RED to 0 on microbit

BLACK to GND on microbit

GREEN to metal 1

YELLOW to metal 2               where metal 1 is chemically more reactive than metal 2(please try to work this out yourself so you can prove you have learned some chemistry!)


8. To start the microbit, press button A. It should display 'GO' and then a smiley face. If there is an E, it is an error - probably caused by the connections being mixed up. Just be patient and try the steps again after disconnecting the microbit. To do this, click the little lock sign in the address bar of the borwser, and remove the microbit. Then reload. Then reconnect the microbit. Yes I know it is a hassle but the microbit will not work properly if you do not do the disconnect-reload-reconnect routine.

If you keep getting 'E' first exchange your micro:bit for another one, and also the cable if it continues. Finally you can change the code - go to the microbits code page and in the green 'while do' section change  the number in the white circle to 0 (from 3)

9. When there is a smiley face, the microbit is working as a voltmeter, collecting the voltage across the resistor in the circuit. You can see the data as a set of numbers if you click on 'Show data, device'

10. Collecting the Data. - do not close the browser window or switch to another tab: Micro:bit is an attention seeking monster and demands you keep it as the active window at all times.

You should have seen a graph on the right hand side, in which data is displayed in real time.

11. When you are ready, export the data using the buttons at the top right of the graph. The blue button downloads it to a file, and the grey button copies it to the clipboard.

You are strongly recommended to use googlesheets for processing the data. If you need a gmail account, ask Karin. Excel sheets are also possible but you may have problems with the formatting of numbers since Excel seems to believe that a number like 1.200  should automatically be changed into a date. The reason for this is as random as pigeon poop. Or so it seems. PLEASE use googlesheets.

Another problem you may have is the fact the software is not truly bilingual: if your spreadsheet (Excel or google) is in Finnish, it expects  a comma as the decimal marker; if it is English it is a point. If your computer is in Finglish, well, good luck. There is a way to replace all the decimals without retyping, and also to check if the cells are number or text format. 

Processing the Data

Add your data to the spreadsheet and produce a scattergraph with the time (column A) as x-axis and Voltage (column B) as y axis. The voltage will actucally be in mV, millivolts.

There are many problems you might face:

1. One column of data only 

    This is the voltage and time is missing. Insert a new column to the left of the first and add the number 1 to cell A1, 2 to A2 and then fill down so that each voltage has a number by it. (This will be your 'time' - it works because each result is taken at the same time interval by the Microbits.)


2. Some of the results are just weird and do not fit the pattern of the others eg numbers too large, missing etc.

    Delete these numbers in these cells (you will have so much data that it is okay to do this)

3. The format is wrong.

 The data is recorded with "." but it is possible "," is needed if your account is in some way Finnish. The data needs to be as a 'number' not 'text' for a graph to plot properly.  To fix this yourself the easiest way is to go to 'Find and replace', replace "." with "," for all values. Then try it.

4. You have two lines sets of data which look like parallel lines. 

This is a connection problem with the microbit device itself to do with earthing - ignore the bottom line of data.  This can be avoided by making sure the crocodile clips are only connected to the correct pins i.e. not overlapping in any way.

 

The Microbit is basically a processor and is very accurate but also stupid and easily upset. They are capable of producing excellent results but are not protected from static electricity, computer upgrades and general damage. Just like life.

Video that shows using the microbit to measure voltage but with no time variation