Driving General-Purpose Input/Output (GPIO)
Fundamentally, a sensor is any device that generates some sort of output when exposed to a phenomenon – say, temperature, humidity, light, vibration, and so on. In an IoT application, we use sensors as data sources by connecting their output via an interface. General-Purpose Input/Output (GPIO) is the simplest form of communication interface in the list of peripherals. It provides high or low values. For instance, it is quite possible to read the status of a contact sensor by interfacing it with GPIO, since a contact sensor can only be either open or closed. Other, more complex sensors may require different types of interfaces, such as Inter-Integrated Circuit (I2C) or Serial Peripheral Interface (SPI).
Actuators are on the output side of IoT solutions. They change their state according to an analog or digital signal coming from the microcontroller and generate output to the environment. Some examples are a buzzer to make sound...