Project prepared with @dariak153.
Goal of the project was to prepare a window application in Matlab that can be used to control temperature (in this example inside a box) and to see how the temperature is changing over time. For this a Simulink model was created that is being run on Raspberry PI 3B.
Important
You need Matlab version R2023b and download Simulink Support Package for Raspberry Pi Hardware to run it!
System used in this project can be seen below. Each number corresponds to:
- Raspberry PI model 3B - running the controller
- Box with a resistor and temperature sensor inside and fan outside of it
- IRF520 Transistor
- AC adapter
- Connector
- Raspberry PI model 4 - MQTT broker
In the project a Mamdani type fuzzy controller was implemented. It was decided to use error and change of error (delta error) as inputs and duty of PWM for heating and cooling as outputs.
And rules were defined like shown below:
Screenshot of application can be seen below. The numbers correspond to:
- Input for reference value of temperature
- Temperature graph
- Information about current PWM duty (0-255) for Heating and Cooling.
Built system is working properly, however the results depend on temperature of surroundings. Also some slight changes in structure of the controller might be done to get better results.