Scenario
H2O monitor is a connected device that both measures the volume of liquid within a container, as well as the liquid’s temperature.
A force sensor measures the weight of the liquid and displays the information via two LEDs. If no pitcher is present on the force sensor, neither LED will light. If a half full pitcher is placed on the force sensor, the red LED will light. Finally, if a full pitcher is place on the force sensor, the green LED will light.
A temperature sensor measure the liquid temperature. This information is also visualized through two LEDs. A warm temperature elicits a red LED, while a cool liquid creates a green LED.
Both the liquid temperature and liquid weight can be accessed via Spark cloud variables.
Process
I began by individually coding in each sensor and verifying that they functioned correctly. While I was checking for sensor operation, I documented the minimum and maximum analogRead() values so that I could set the thresholds in my code later. Once all the components were working correctly, I coded in the status LEDs and finished the wiring. The components are listed below:
(2x) red LED
(2x) green LED
(1x) resistive force sensor
(1x) temperature sensor
(1x) 10KΩ resistor
(4x) 1kΩ resistor
(1x) 103 µf capacitor
various jumpers