Introducing sensors
Sensors are how our robot collects information. You’ve already seen and used one – the encoders. You were also introduced to absolute versus relative sensors in Chapter 6, Measuring Movement with Encoders on Raspberry Pi Pico, so what additional sensors can we consider? And how do we interface with them?
Sensors collect information from devices on the robot, making closed-control feedback loops. Sensors can also collect information about the world around the robot, what is present there, or how it has changed in response to the robot’s motions.
Analog sensor types
We briefly talked about analog and digital in Chapter 1. Analog sensors create a varying voltage, whereas digital sensors output only 1s and 0s – binary – using two fixed voltages.
Raspberry Pi Pico has a 12-bit Analog-to-Digital Converter (ADC) supporting analog sensors connected to 4 pins. Analog inputs are suitable for simple light sensors and variable...