Embedded Watering System with Tetris

github

Key Features

Embedded Watering System with Tetris

Stm32C031c6

For the prototype, I used a stm32 board. I connected an OLED screen and an accelerometer via I2C. The remote control works with an NRF chip via SPI. The pulses of the DHT11 temperature sensor are captured with a timer set to input capture mode. An RTC alarm is used to wake the processor up periodically from sleep to check the dryness sensor. I started out using the HAL library but switched most peripherals to LL as the project progressed.

Embedded Watering System with Tetris

QP/c

I used the QP framework. It uses active objects who's inner logic is implemented inside their own state machine, while event signals are sent asynchronously between these objects.

Embedded Watering System with Tetris

Tetris!

This project is not only an automated watering system, you can also play Tetris on the OLED! The blocks can be controlled by tilting the plant.

Embedded Watering System with Tetris

Using a Logic Analyzer

I captured the data the DHT11 sensor send me with a timer in input capture mode. To parse the data properly, I used a logic analyzer and Pulse View.

Goals and Motivation

With this project I got more familiar with the stm32 family of microcontrollers and I learned how to use the QP framework and implement the project in an event driven way.

#C

#QPeventFramework

#UMLstatemachines

#stm32

#LogicAnalizer

#HAL

#LL

#SPI

#UART

#I2C

#TIM

#RTC