Understanding IoT Sensors: the Basics
Sensors convert various forms of physical energy into electrical energy, allowing microcontrollers, Raspberry Pi and Arduino to read changes in the physical world.
The simplest sensors read changes in mechanical energy, usually by moving electrical contacts.
For example, the pushbutton or switch converts mechanical energy (e.g., your finger’s press) into electrical energy by closing a connection between two metal contacts.
The potentiometer is another sensor that reads mechanical energy changes: a metal contact called a wiper slides along a resistor, effectively short circuiting the resistor into two halves and creating a voltage divider circuit.
Analog and Digital Sensors:
Analog sensors are much different than digital sensors and typically have less features.
Analog sensors create analog signals from the quantity that is sensed. In comparison, digital sensors produce digital signals when performing a measurement.
The most common types of analog sensors include sound sensors, light sensors, temperature sensors, and pressure sensors.
Typical example of a digital sensor can be a door sensor, which gives the output in two states either normally closed (NC) when the door is open or normally open (NO) when the door is closed.