Microbit analogue input sensors
This tutorial covers how to connect analogue input sensors to your Microbit and how to read their values.
Example input sensors that this tutorial is suitable for:
- Temperature sensors ( Thermistors)
- Light sensors ( LDRs)
- Resistance sensors ( Variable resistors)
- Pressure sensors
- Many more…
In order to read input from analogue sensors such as temperature sensors and light sensors, you will need the following components:
- 1 Microbit + USB lead
- 1 Microbit battery + 2 AA batteries
- 1 10,000 Ohm resistor ( or similar size)
- 1 temperature sensitive resister (Thermister) or light dependent resister (Photoresistor)
- 4 Crocodile clips
Demo code 1 – Say the sensor value.
Depending on the light in the room, the Microbit will say about:
- 1008 in the light
- 700 in the dark
If you have used a different size resistor then you will probably get different values to me. It doesn’t matter, you will just have to adapt the code in the next section!
Demo code 2 – using the sensor value