Introduction: Temperature Sensor

Hello i am joseph and i am 10. In this tutorial I will show you how to make a temperature sensor/reader with micro:bit.

Supplies

micro:bit

dht11 temp humidity sensor

micro:bit breakout

wires female to female

makecode installed

usb cord

(optional) OLED 12864

Step 1: Connect

connect the temperature sensor to the micro:bit

-- to ground

+ to 3.3

out to pin 0

on some sensors out may be marked S

Step 2: Dht11

open a new project in makecode

drop down advanced and click extensions and add dht11 in your extensions

Step 3: Change Pin Pull Up

get a query and put it in a forever

change pin pull up to false if you want it to fail less

Step 4: Display Temp

put a show string t under the query dht11

put a wait 500 milliseconds under the show string

put a read temperature in a show number and put under the wait

download to your micro:bit

Step 5: Oled

connect sda to pin 20 scl to pin 19 vin or + to 3.3 gnd or - to gnd on the micro:bit

delete all you did in step 4

add the OLED extension

put a init OLED with addr in the on start leave it at 60 unless it doesn't work, then change it to 61

under query dht11 put a show string "t"

under that put show number "read temperature" MAKE SURE X IS 2