Connection
Thermometer – Module Connection
- Yellow cable: signal wire – connect to terminal Y (yellow)
- Red cable: power wire – connect to terminal R (red)
- Black cable: ground wire – connect to terminal B
Connection Module – MB2 (micro:bit)
- SIG: signal pin – connect to pin P0 (yellow signal bar)
- VCC: power pin – connect to 3V3 (white positive power rail)
- GND: ground pin – connect to GND (black negative power rail)
The connection can be done in another way, but it is necessary to set the correct signal pin in the program. If you use the program below, connect the wire to the yellow pin 2 or adjust the signal pin setting in the program.
LCD-MB2 connection
- VCC: power pin – connect to 3V3 (white power strip)
- GND: ground pin – connect to GND (black ground bar)
- SCL: I2C clock signal – connect to SCL pin
- SDA: I2C data signal – connect to SDA pin
Program
Basic program
Basic program - LCD display
When starting the program, we first initialize the LCD display using the “connect LCD at I2C” block with a fixed address of 39, which is standard for the LCD1602 display. We then display the name “OMG Robotics” or any custom text, such as the name of the school, on the display. After a short pause, we clear the display and set static text on the first line – ideally a description of the measured quantity including the unit, such as “Temperature (°C)”. This text will be displayed from the first position of the line, we can leave the length as default and set the alignment as needed.
In the infinite loop of the program, we will continuously display the current measured value from pin P0, to which the thermometer is connected, on the second line of the display. This value is first rounded to one decimal place to make the display clearer. The program created in this way serves as a simple thermometer with output to the LCD display.




