Lesson 4 Simulate an AC - Water-Monitor/IoT-Portfolio-FJS GitHub Wiki

Simulate an AC

One of the final task was to create a system that simulates an air conditioner. The temperature should rise and fall linearly and as soon as the temperature gets "too hot", the AC should turn on. If it gets cold enough, the AC should turn off. There are multiple ways to solve this problem.

In Node red, we need of course an inject and a debug node. The inject node will start with a starter value of our temperature. With a loop, we manage to increase the value linearly. However, we also need a solution to decrease the value as well. This can be done with a delay node or with javascript. In general can everything be coded in javascript as well. Ulrich even told us, that we do not need to use node red. We could use anything as long as it solves the task (vs code, google collab, ...).

If one succeeded with the node or the programming, then one can also do the same for increasing the temperature as well. And if the temperature simulator is working as well, then we can add a graph and a switch to it as well. Simply connect the nodes with the graph node to display the values. For the switch, we need to add two exchange nodes (which will send a "on" or "off" depending on the true or false statement) which will then lead to the dashboard-switch.

Then the AC simulator should be done and working :)