In order to properly connect sensors to the Arduino board, we'll need to know a bit about electronics.
In our electrical circuits, we will need to consider variables of voltage (V) and current (I). It might be helpful to think of a water hose as an analogous system. Voltage is like water pressure and current is like the velocity of the water passing through the hose.
All of our circuits will include one or more resistors, which in our water-hose analogy are like sponges inserted inside the hose to slow the water flow.
Ohm's Law relates the voltage (V) across a resistor (R) and the current (I) flowing through it as V = I R.
In general, our voltage source will be 5 Volts.
We'll want to limit the current in our circuits to minimize power consumption. For example, in a typical switch circuit we'll add a 10 K ohm resistor so that the current when the switch is closed is I = V / R or 0.0005 amps (0.5 milliamps).
A basic switch circuit.
For the circuit of Fig. 1, the voltage measured at the pin with the switch open is 0 because no connection is made to the +5V source. When the switch is closed, there is a direct connection and a binary input pin would register a ``high'' value.
The circuit above can be easily modified to measure a variable resistance, as shown in Fig. 2. The resulting variable voltage would have to be measured with an analog input pin.
Basic circuits to measure a variable resistance.
We'll see that a large number of sensors can be connected using the configurations shown above.
It is often helpful to have a multimeter and/or an oscilloscope available to evaluate electrical circuits.