The goal of project is to implement an automatic coffee machine using FreeRTOS on the STM32F407-Disco1 board. This coffee machine should be capable of executing multiple tasks based on FreeRTOS. All four LEDs, button, audio output and PWM (for servo motor control) of the STM32F407-Disco1 will be utilized.
- Programmable coffee brewing
- Customizable brewing timing
- STM32F407-Disco1
- Servo motor
- MDK-ARM (5.26) with MDK Legacy Support
- STLinkV2 Driver
The user of this coffee machine has the ability to program add coffee brewing jobs to the FreeRTOS queue with the user button.
First, single click to cycle through the coffee selection menu. Each LED represents a different coffee type, which is shown in the table below. Double click on any coffee type to add the coffee brewing task to the queue.
LED representations in the coffee selection menu:
LED | Coffee type |
---|---|
red | espresso |
blue | latte |
orange | mocha |
If no actions are captured after entering the coffee selection menu within the idle timeout, the coffee machine will return to the appropriate state.
While the coffee brews, the peripheral devices will perform several actions. First, the LED that represents the coffee will blink. Before the machine dispenses an ingredient, a sound will play. Next, the servo motor will change positions based on the current dispensing ingredient. Lastly, once all ingredients are dispensed, meaning the coffee is brewed, a short tune will play to indicate that the job is completed.
To customize the brewing times of the ingredients, enter the coffee selection menu with a single click. Once in the selection menu, each LED represents a different ingredient used in the coffee types. The table below shows the corresponding LED and ingredient list.
LED representations in the coffee selection menu:
LED | Ingredient |
---|---|
red | espresso |
blue | milk |
orange | chocolate milk |
If no actions are captured after entering the coffee selection menu within the idle timeout, the coffee machine will return to the appropriate state.
Once in the selection menu, long press to enter timing programming mode. This mode will accept three types of inputs. A single click will increment the brewing time by 1 second. Double clicks will exit the programming mode. Lastly, a long press will confirm and set the current timing of an ingredient to the new timing.