Producing a data logger using the microbit to detect and log changes in the magnetic field. Traces The micro:bit includes a built-in compass that can also be used as a magnetic field detector . With a small amount of code, we can use this sensor to measure changes in the magnetic field and log the data to a computer . If you are new to this idea, a useful introduction is the video from Mr Morrison below, which explains the basic concept. The video demonstrates how the micro:bit can detect magnetic fields and display the readings on the device itself. Let’s extend that idea by turning the micro:bit into a data logger that continuously records magnetic field changes . Coding and Sending data to a Computer Instead of displaying the magnetic readings directly on the micro:bit’s LEDs, we can send the data through the USB cable to a computer . The MakeCode editor already provides blocks that allow data to be sent using the serial connection . By placing the magnetic measurement inside a c...
Robots and getting computers to work with the physical world is fun; this blog looks at my own personal experimenting and building in this area.