Sensors

8. Sensors#

It is of no use to be able to connect to a microprocessor and log values from it if we can’t make measurements.

This section will cover how to use sensors to measure some type of input, be that temperature, light levels or something else.

There are two main types of sensor you will meet

  1. Analog

  2. Digital

Analog require an input voltage and then return a voltage which is proportional to the signal that is measured.

Digital also require an input voltage but the microprocessor then talks to the sensor over a digital interface, for example I2C.

Voltage levels

Sensors often use different voltage levels. Very common is the 5 V level. Arduinos also work with 5 V so there is rarely an issue.

Picos on the other hand work with 3.3 V levels. At best connecting a 5 V sensor to a Pico won’t work. At worst it has the potential to damage the Pico as too high a voltage is applied. We will explain about potential dividers and level shifters later