Getting data from a BBC:microbit
Since the BBC:microbit has an accelerometer chip on it it seems only natural to turn it into the heart of an educational seismometer.
So what steps need to be done
1) install the mbed serial driver to connect your microbit to your (windows) computer using a USB lead
2) write some code to output acceleration data to the serial line on the microbit
3) make sure you have suitable microbit device file for jamaseis
4) connect it all together
In detail
1) install the mbed serial driver for windows see https://developer.mbed.org/handbook/Windows-serial-configuration This will create a virtual serial COM port on your computer... you can check this by looking at Computer...properties...device manager (windows7)
2) write some code to output acceleration data to the serial line.. you can do this in a browser on the
3) view the data using serialplot
The microbit should now be sending data as a stream of acceleration values onto its USB port which will appear as a serial port when plugged into a computer. A simple tool for graphically viewing this data in realtime is a free program called Serialplot https://hackaday.io/project/5334-serialplot-realtime-plotting-software To configure the software you need to know the baud rate that the microbit uses (115200 bits per second)
![]() |
microbit accelerometer data recorded by jAmaseis datalogging software |
So what steps need to be done
1) install the mbed serial driver to connect your microbit to your (windows) computer using a USB lead
2) write some code to output acceleration data to the serial line on the microbit
3) make sure you have suitable microbit device file for jamaseis
4) connect it all together
In detail
1) install the mbed serial driver for windows see https://developer.mbed.org/handbook/Windows-serial-configuration This will create a virtual serial COM port on your computer... you can check this by looking at Computer...properties...device manager (windows7)
![]() |
On my computer the microbit appears as COM23 |
microsoft code the microbit website https://codethemicrobit.com/
The website has instructions on how to upload this file to your microbit (hit the download button and copy the downloaded .hex file to the attached microbit) You can download my .hex file copy here
3) view the data using serialplot
The microbit should now be sending data as a stream of acceleration values onto its USB port which will appear as a serial port when plugged into a computer. A simple tool for graphically viewing this data in realtime is a free program called Serialplot https://hackaday.io/project/5334-serialplot-realtime-plotting-software To configure the software you need to know the baud rate that the microbit uses (115200 bits per second)
The data can then be plotted as a realtime trace onto the screen by choosing the plot width and pressing the "open" button
3) jAmaseis software lets you plot streaming data from a number of different data sources... to configure a new one you just need to use the command line option from the jamaseis directory (usually c:\program files\jamaseis )
The crucial parameter is baudrate=115200 this will create a new device file 8.dat which needs to be copied to folder
../jAmasSeis/devices/supported/
You can download a .dat device file that I created here
4) next time you run jamaseis you can then add your microbit as a local device ... remembering to select device microbit
The microbit only has an acceleration resolution of 1 milli-g so is not very useful for measuring earthquakes in the UK, however you can use it to test the resonance frequency of vibrational systems or as part of teaching exercise in how seismometers work
I use a single line display of one minute on jamaseis to see what is gong on clearly.
Comments
Post a Comment