Skip to main content
Version: FILS English

ClimaControl

Monitors sensors,displays temperature, and controls motor and buzzer based on threshold logic.

info

Author:Tudor Bianca Elena
GitHub Project Link:https://github.com/UPB-PMRust-Students/project-biancatudor1234

Description

This smart system keeps track of temperature, light, and a button input, and uses that information to control things like a fan, buzzer, and LEDs, while also showing the temperature and pressure on an LCD screen. It reads data from temperature and light sensors and lets you control some features manually with a button. The 8-segment Display shows the current temperature in real time. The fan can turn on by itself when it gets too hot or when there is too much luminosity . If the temperature gets too high, a buzzer goes off as a warning. There are two LEDs to show what’s going on: green means everything’s okay, and green and red alternating means there’s an alert or problem. The system checks sensors all the time and changes the outputs as they are needed to help keep the environment comfortable.

Motivation

The motivation behind this project is to create a smart system that makes the environment more comfortable by automatically monitoring and adjusting things like temperature and lighting. I chose this project because having a system that reacts to changes in temperature or light without needing constant input is practical and efficient. The display is helpful for showing the real-time temperature and pressure, and the fan and buzzer make sure the environment stays just right. It’s designed to make your space adapt to you effortlessly and keep things comfortable.

Architecture

architecture

The Raspberry Pi Pico 2W acts as the central controller for all functions. It collects data from sensors and controls all connected components based on programmed logic.

The temperature and light sensors constantly check the surroundings and send updated values to the Raspberry Pi Pico, which then reacts accordingly.

The 8-segment Display is used to display the current temperature and pressure in real time, helping users monitor the environment .

The fan, which runs on a DC motor, is starts automatically once the temperature or luminosity goes above a certain level.

The buzzer works as a warning system and makes a sound when the temperature gets too high, letting users know it’s getting too hot.

There are two LEDs that show what’s going on: the green one lights up when everything is working fine, and the red and green alternating if there is the temperature or luminosity go above the preset level .

Log

Week 6 - 12 May

I bought the components needed for the project to make sure I had everything ready to start. Then, I worked on the initial documentation and architecture. I also drew the first version of the KiCad schematic, connecting the components based on my design. After that, I started coding and testing the sensors, buzzer, and LEDs to check that they were working properly and i integrated them in the project.

Week 7 - 19 May

This week I bought the rest of the components for the project. I finished the circuit design using KICad and completed the architecture of the project. I also built a stand for the DC motor. In addition, I worked on the code for the project, specifically for the screen to display the temperature and pressure.

Week 20 - 26 May

This week, I completed the code, adding new elements to the project. I also designed a case for the project and finished a stand for my DC motor. Additionally, I incorporated all the sensors and the display into the new case that I designed using a 3D printer.

Hardware

Raspberry Pi Pico:

  • Function: It is the main control unit. It manages and controls all connected components, such as sensors, the fan, buzzer, LEDs, and the 8-segment display based on the data it receives.

  • Connection: For 8-segment display :

  • SPI1:

    • CLK: Connected to PIN_10
    • MOSI: Connected to PIN_11
    • MISO: Connected to PIN_12
    • CS: Connected to PIN_13

    For TSL2561 Sensor:

  • I2C1:

    • SDA: Connected to PIN_2
    • SCL: Connected to PIN_3

For BMP280 Sensor:

  • I2C0:

    • SDA: Connected to PIN_0.
    • SCL: Connected to PIN_1.
  • GPIO:

For Buzzer: Connected to PIN_17

Green LED: Connected to PIN_9

Red LED: Connected to PIN_8

DC Motor Control: Connected to PIN_16

Light Sensor:

  • Function: To detect ambient light levels. Sends light readings to the Pico, which can use this data to influence system behavior (like adjusting LED indicators).
  • Connection:
    • VCC: is connect to the 3.3V pin on the Raspberry Pi Pico W.
    • GND: is connect to a GND on the Raspberry Pi Pico W.
    • SCL: is connect to PIN_3 .
    • SDA: is connect to PIN_2 .

Temperature Sensor:

  • Function: It masures the surrounding temperature. Continuously sends temperature data to the Raspberry Pi Pico, which uses the information to decide when to activate other components.
  • Connection:
    • VCC: is connected to the 3.3V pin on the Raspberry Pi Pico W.
    • GND: is connected to GND on the Raspberry Pi Pico W.
    • SCL: is connected to PIN_1 .
    • SDA: is connected to PIN_0 .

DC Motor with Fan:

  • Function: It cools the system when it's too hot. Turns on automatically when the temperature passes a certain threshold or manually through the button.
  • Connection: The DC motor itself is powered by an external power supply. The motor's power leads are connected to the output of the transistor or motor driver, which is switched on or off based on the signal received from PIN_16.

Active Buzzer:

  • Function: It provides a sound alert. Beeps when the temperature is too high to warn the user of overheating.
  • Connection: The control signal comes from PIN_17 of the Raspberry Pi Pico W. The other pin is connected to Ground.

Green and Red LEDs:

  • Function: It shows system status. The green LED lights up during normal operation, while the red and green alternating LEDs turn on when there’s an alert or issue.
  • Connection:
    • The anodes of the Red LED connect to PIN_8 through a resistor.
    • The anodes of the Green LED connect to PIN_9 through a resistor.
    • The cathodes of both LEDs connect to Ground.

8-Segment Display:

  • Function: It displays sensor data. Shows the current temperature and pressure in real time so the user can easily monitor the environment.
  • Connection:
    • CLK: Connect PIN_10 of the Raspberry Pi Pico W .
    • MOSI: Connect PIN_11 of the Raspberry Pi Pico W .
    • MISO: Connect PIN_12 of the Raspberry Pi Pico W .
    • CS: Connect PIN_13 of the Raspberry Pi Pico W .

Schematics

KiCad

Img1

Img2

Img3

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico WThe microcontroller35 RON
Breadboard Power SupplyThe Power Supply4,69 RON
Modul cu Driver de Motoare Dual L298N RosuMotor Driver10,99 RON
BMP280 SensorThe Temperature and Humidity Sensor DHT117,99 RON
TSL2561 SensorThe Light Intensity Sensor22,99 RON
MAX7219 8-Digit LED DisplayDisplay9,99 RON
400p HQ BreadboardBreadboard HQ4,56 RON
PCB-Mounted Active BuzzerThe Buzzer4,98 RON
Blue Propeller 80 mmPropeller1,99 RON
15000 RPM MotorDC Motor4,99 RON
LEDSLED with Diffused Lens0,80 RON
DC Power Male Connector with Locking 2.1/5.5 mmMale Power Plug0,99 RON
9V Battery HolderBttery Holder1,29 RON

Software

LibraryDescriptionUsage
embassy-rpRP2040 PeripheralsUsed to interface with GPIO, I2C, SPI, and peripherals like pins
embassy-executorAsync task executor for embeddedUsed to spawn and manage async tasks
embassy-embedded-halShared bus and helper traitsUsed to wrap and share I2C bus access
embassy-timeTimer and delays for async systemsUsed for time-based delays
embassy-syncChannel and mutex synchronizationUsed to send messages between tasks using Channel
defmtLogging framework for embeddedUsed for efficient debug logging
tsl256xDriver for TSL2561 light sensorUsed to read ambient light values over I2C
max7219-driverMAX7219 LED driverUsed to control 7-segment LED display
panic-probePanic handler for embedded RustUsed to handle and log panics in embedded environments
static_cellSafe statics with interior mutabilityUsed for static initialization of resources
  1. Connect BMP280 to Raspberry Pi Pico/Pico W - Measure Temperature and Atmospheric Pressure
  2. Raspberry Pi Pico Temperature Controlled
  3. ClimaControl Youtube Video ...