3.2 Building the Solution
Before the Water Level Notifier can start broadcasting alerts, we need to complete the following tasks:
-
Attach wires and a resistor to the exposed sensor leads on one end of the flex resistor and the fishing bobber on its other end.
-
Connect the leads of the flex sensor to an analog pin of an Arduino.
-
Write a program (i.e., sketch) for the Arduino that will monitor changes in the flex sensor readings. It should trigger an event when a large-enough deviation from the initial value is detected.
-
Attach an Ethernet shield to the Arduino so that the sketch can communicate with a web server running PHP.
-
Write a PHP script that will capture incoming values from the Arduino. When the water level has changed, it should format a message and send an email alert to the intended recipient, who will need to react quickly to the alert!
We will begin by assembling the hardware and testing out the flex sensor measurements.