How to use Excel with micro:bit

What is Excel?

Microsoft Excel is a very popular interactive computer application for analysis and storage of data in tabular form. Users can easily perform basic arithmetic and statistical operation. It would be really handy if we could also log time and data values automatically from micro:bits’ three analog input pins, store them in an Excel Spreadsheet and plot a chart with the data automatically. The Muselab team achieves this by utilizing the powerful macro scripting language of VBA within Excel. We can do the logging task in 5 easy steps.

What is Excel?

Microsoft Excel is a very popular interactive computer application for analysis and storage of data in tabular form. Users can easily perform basic arithmetic and statistical operation. It would be really handy if we could also log time and data values automatically from micro:bits’ three analog input pins, store them in an Excel Spreadsheet and plot a chart with the data automatically. The Muselab team achieves this by utilizing the powerful macro scripting language of VBA within Excel. We can do the logging task in 5 easy steps.

Step 1. First you have to set up your network connection on the MuseLab micro:bit Booster. If you have already done so, please continue with “Step 2”, otherwise click below link and follow the instructions.

How to connect micro:bit to the internet

Step 2. We need to turn on the WiFi remote control function so that the WiFi IoT Shield is open for control* (or access). Otherwise, we won’t be able to receive the data externally. In this example, we will use the “on button A pressed”-listener to start the remote control as shown below:

After the shield has been connected to the Internet:

Press the button A on the micro:bit, and you will get the below feedback message on the OLED screen:

The “Start listen OK” means that your  MuseLab micro:bit Booster can now be controlled by externally!

* In technical terms, the MuseLab micro:bit Booster starts a web server (port 80) for other devices to access its functions via HTTP requests.

Step 3. We can now get data into MS Excel by using VBA script! For an easy dive into this subject, you can download our excel template to try getting your data!

Step 4. After the download has completed, start Excel and open the downloaded excel file. Just amend and verify the IP address and the number of times you want to take records.

Step 5. If you are all set and ready, click the start button. After you have clicked it, “Let’s go” window will be prompted. Confirm that message and a graph will be shown and updated in real-time, while values are read from your WiFi IoT Shield. Every new entry will automatically be given a timestamp, so it is easier to analyse your data later on.

Reminder:

If you have problems receiving the data and Excel throws an error message at you, please make sure that your computer and the MuseLab micro:bit Booster are connected to the same network! For example, if the pc is now connected to the “muselab”, your shield should also connect to “muselab”.

If you do not have a WiFi Router or Access Point available, you can perhaps set up your own WiFi Hotspot. Under Windows 10 it is fairly easy, just click on the WiFi symbol and enable the hotspot function.

Repeat steps 3 to 5 if necessary and having fun logging your data!