micro:bit Temperature Sensor
A very accurate temperature sensor using a calibrated chip called a TMP36GZ.
It is accurate to ±1°C at +25°C. At this temperature it outputs 750mV. It changes by 10mV per °C.
The black lead goes on GND, the red lead goes on 3v and the blue lead goes on which ever pin is being used in the program.
This item is polarity sensitive, the red & black leads need to be on the correct connections for it to work.
Use the analog input blocks to read the sensor value:
You can use any one of the three pins 0, 1 or 2.
The micro:bit analog input reads from 0 to 1023 for 0v to 3.3v so some light maths is going to be needed by the student to figure out expected value for a temperature.
Quick answer: At +25°C you would get (0.75/3.3) * 1024 = 233.
There will be some small voltage drops as the crocodile clips aren’t a best case connection, so some discovery & analysis by the students to find out what the typical readings are for their application before they start coding &/or testing is a good idea.
The sensor has some thermal mass so won’t instantly change, but just holding it between finger & thumb for a few seconds is enough.
This version is not waterproof – it won’t do anything particularly bad if put in water but certainly won’t fare well if put in boiling water.
The internal temperature sensor on the micro:bit tends to read a few degrees above ambient temperature as the CPU generates some heat as it works. It it works hard, it generates more heat and so the temperature rises. So a direct comparison between the internal temperature and this sensor isn’t possible.