Hooking It Up

Let’s start by making sure our flex sensor works the way we intend it to. Connect the positive lead of the sensor to the Arduino’s 5.0-volt pin using a wire. When looking at the flex sensor standing on its end, the positive lead is the trace that runs vertically. The negative lead is the one that looks like the rungs of a ladder. Connect the negative lead to the analog 0 pin with another wire. Lastly, bridge the analog 0 pin to the ground pin using the 10k ohm resistor to dampen the flow of current through the circuit. Refer to Figure 3, Water Level Notifier wiring diagram, to make sure you attach the wires and resistor to the correct pins.

Attach the bobber to the end of the flex sensor. Most bobbers come with a retractable ...

Get Programming Your Home now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.