#7 Smart Cooler Project With micro:bit
To cool off during the summer months and warm up in the winter months, air conditioners are used. Air conditioners adjust the heating and cooling degrees based on the temperature of the environment. Ovens, on the other hand, strive to reach and maintain the temperature value set by the user while cooking. Both of these electronic devices use special temperature sensors to control the temperature. Additionally, in greenhouses, temperature and humidity are measured together. To maintain a balance at the desired level, a fan is used to provide air circulation.
You can measure temperature and humidity separately with Picobricks and interact with the environment using these measurements. In this project, we will prepare a cooling system with Picobricks that automatically adjusts fan speed based on temperature. This way, you will learn about the operation of a DC motor system and how to adjust motor speed.
In this project, we will adjust the speed of the fan connected to the motor driver based on the value obtained from the temperature and humidity module. The fan connected to the motor driver will operate when the temperature exceeds a certain value. If the temperature falls below a certain value, the fan will stop.
Connection Diagram:
You can prepare this project without making any cable connections.

Project Images:
![]() |
![]() |
MakeCode Code of The Project
Python Code of The Project:
#Smart Cooler Project from microbit import * from picobricks import * # Function Initialization oled = SSD1306() oled.init() oled.clear() shtc = SHTC3() motor = motordriver() def celsius(): display.show(Image('00009:' '09900:' '90000:' '90000:' '09900')) celsius() while True: temp = shtc.temperature() hum=shtc.humidity() oled.add_text(0,0,"TEMP:") oled.add_text(5,0,str(float(temp))) oled.add_text(0,1,"HUM:") oled.add_text(5,1,str(float(hum))) motorSpeed=round( shtc.temperature() - 0 ) * ( 100 - 0 ) / ( 40 - 0 ) + 0 if temp>25: motor.dc(1,round(motorSpeed),1) oled.add_text(0,2,"Fan Speed:") oled.add_text(5,3,str(round(motorSpeed))) else: motor.dc(1,0,1)