Day 12: Light monitor
Behind today’s door, you’ll find a phototransistor. This is a sensor with which the brightness can be measured. You’ll do that today, but in addition to simple measurement, the project also sounds an alarm as soon as limit values that you’ve pre-set in the app are exceeded. So that everything will function, you have to connect the sensor with a voltage divider circuit at Pin A0, as shown in the picture below. Pay attention to the correct polarity of the phototransistor (short leg to VCC). It does also work the other way round, but not nearly as sensitively.
The Blynk interface looks pretty full today. Many different functions are realised with widgets. Through one of them, represented by the Twitter bird, you can connect your Twitter account to the project. This is one of the channels through which you can receive an alarm message.
There’s something more to do in the Arduino programme today, too. In addition to WLAN data and token, you can enter an email address today. That’s the other channel through which an alarm message is sent.
If you start the interface now, you’ll already see a row of measured values scrolling above the topmost element. You can follow the progression of values with the line. If you pass your hand over the sensor, the measured values become significantly lower. Using the sliding switch directly below the measured values, you can set limit values that must not be exceeded or fallen below. At the bottom, there’s also a blue and a white button. With these, you can activate or deactivate the reporting via Twitter or via email. The LED next to the respective symbol shows the current status. If a measured value leaves the allowed range, the system goes into an alarm state and sends a message. A terminal in the centre also gives information about current events. You can also set a new message text using the terminal. Thus you’re always up to date on whether e.g. your plants are getting enough light.