Day 20: Plant Guard
Behind the door is an NTC resistor (Negative Temperature Coefficient) that measures the temperature. Together with the photo transistor and a few wires, we are going to build a plant guard that alerts us, when a plant it is monitoring is exposed to bad conditions. We will use the following setup besides the program of today.
The two yellow wires are just simple wires that can be inserted into the potting soil. They are used to monitor the level of moisture in the soil. During our initial tests, we will just touch the two wires with a finger.
Today you can import the flow straight into the Node-RED environment, but not without disabling previous ones and adjust the topic. The out topic will receive a JSON string that looks similar to this:
Light, temperature and humidity data are sent. Light here is a relative value in the range of 0 to 4095; the same is true for the humidity measured. Temperature values are also sent using this value range. But because you can’t do anything with this value, we have a function node that converts the values t o Celsius. The values are displayed conveniently in the user interface. Besides the indicator, we also have a few controls there.
The controls are used to define the thresholds for measurements. You can define the minimum and the maximum value. In case you don’t want limit values, you can also set the control to an extreme position, which the board will never be able to measure. For example, if you do not want that an alarm is triggered at night because the light intensity is too low, set the minimum control simply to -1.
In the case that one of the limits is exceeded, the matching switch node will be triggered and a message is prepared and then output via the UI. Because most of the time these messages are not opened, you can also enter your email data into the email node. This will send an email reminder that you should water the plant or provide better lighting conditions. That’s how you can even turn a simple houseplant into a smart plant.