Sensors with Analog Voltage Output
Many sensors will just give you an analog voltage. Some common sensors with analog output that you might see and use:
- ADXL335 – Three-axis accelerometer with analog output. Easy to use.
Many sensors are just resistors that change their resistance value based on some external input (light, temperature, force etc.). The Arduino is not able to read the change in resistance directly, but we can convert that resistance change into a change in voltage using a voltage divider.
If you connect two resistors in series as in the image below, the voltage read from Vout depends on the ratio of the two resistors. Read the Wikipedia article or check this tutorial from Sparkfun, if you want to learn how to calculate the values.
Potentiometers are essentially voltage dividers built inside a handy interface. They come in different shapes and sizes, but all of them work roughly the same way.