Version 3.0 for iOS and Android was released today and adds an exciting and hopefully, very useful major new feature. It's now possible to capture, chart and export data from devices like sensors which you have connected to the micro:bits pins on its edge connector.
|The micro:bit edge connector|
You can connect up to three things at a time, to pins 0, 1 or 2. What might you connect? All sorts of things! I've mostly been experimenting with a TMP36 temperature sensor and a couple of Light Dependent Resistors (LDRs) but you could connect any electrically compatible sensor, be it for measuring humidity, acidity, the occupancy of a room or anything else you can measure in the environment.
|A temperature sensor and two LDRs|
As a way to investigate physical phenomena and the behaviour of electronic circuits, Bitty Data Logger is a fantastic tool. Visualising behaviours using real time charts is a highly effective way of helping to develop an understanding of the behaviour. And Bitty Data Logger's export facility lets you take the captured data and process it in another tool like a spreadsheet.
With the new sensor logging capability, you can opt to log the raw data values read using the micro:bit's APIs, convert these values to millivolts or, you can supply your own formulae with which to calculate derivable values. For example when I have my TMP36 temperature sensor connected to pin 0, I use the following formula to convert the raw micro:bit data into the corresponding temperature in degrees celsius:
((p0_raw * 3300 / 1024) - 500) / 10
|Data acquired from the micro:bit pins can be processed by formulae in real time|
Meanwhile, I've been having fun testing and trying out various sensors. Here are some screenshots to close this short post.
|Temperature sensor data in raw micro:bit format|
|Temperature data, converted to degrees Celsius using a pin formula|
|Light sensor (LDR) data in mV: sensor being repeatedly blocked then opened to the light|