Once you have acknowledged various ways to connect external sensors to the Raspberry Pi GPIO, it is a good time to make a decision whether you will connect sensors directly or through so called Raspberry Pi HATs. This decision may also be affected by the stage of the project as well as cost. Assuming that you have chosen Raspberry Pi HATs, or Hardware On Top extensions, you might find yourself confused at the sheer amount of options. Different HATs can vary quite a lot in terms of their capabilities and features. Choosing the right Raspberry Pi HAT will depend on your application and budget primarily and below we will list the key attributes and benefits of some of the very popular Raspberry Pi HATs on the market.
Sense HAT
Raspberry Pi Sense HAT is an add-on board that was developed for educational project AstroPi done in collaboration between Raspberry Pi foundation and European Space Agency. Original idea was for it to be used in International Space Station, therefore it is well suited for applications where motion, position and orientation may be important. Note that Sense HAT is compatible with all Raspberry Pi models with 40 pins GPIO Header.
The board gives possibility of measuring temperature, humidity, pressure, and orientation, color and movement. Information can be output through built-in 8X8 LED matrix.
Software:
Officially supported Python library exists and it gives access to all the sensors as well as LED on the board.
Additional Plus:
Online emulator exists which you can use in your browser to write and test code for the Sense HAT if the actual HAT is not available. Once the hardware is in place, it is sufficient to change one line of code and get up and running.
Grove Base HAT
Grove Base HAT is a base unit part of the Grove modular prototyping system. It is essentially an expansion board for Raspberry Pi that is promising to bring orderliness of sensors to your project. It is in fact a microprocessor that allows for communication and control of various Grove modules. Each Grove module typically performs a single function such as simple button or a sensor.
Grove Base HAT is capable of maintaining 24 GPIO pins as well as offering 15 additional Grove ports based on 12-bit ADC MM32 chip. 15 Grove ports include 3× I2C, 1× UART, 6× Digital, and 4× Analog, which also contains 1x PWM port, and the SWD Debug interface.
Software:
Python Library by Seeed Studio, the founders of Grove HAT exists for Raspberry Pi.
Additional Plus:
Originally, Raspberry Pi provides no analog to digital converter (ADC) and is able to connect only to digital sensors. However, the Grove base HAT with its built-in MCU can work with external 12-bit ADC which enables user to connect analog sensors. After ADC, analog voltage that was turned into 12 bit digital signal goes through I2C interface to the Raspberry Pi.
Pimoroni Explorer HAT Pro
As the name suggests, this is an ideal HAT solution for exploring Raspberry Pi functionality safely without risk of shorting GPIO pins. This HAT includes 8 capacitive touch pads, 4 individually controllable LEDs (red, blue, green and yellow), 4 buffered 5V tolerant inputs, 4 powered 5V outputs ideal for step motors, relays and solenoids and a mini breadboard. Therefore, this HAT is ideal for driving motors, using analog sensors and interfacing with 5V systems.
Software:
Python library with examples as well as clear, detailed and simple instructions are provided with the HAT.
Additional Plus:
Main thing users of this HAT mention as an advantage is its very simple Python API enabling you to easily get up and running with a wide range of functionalities. Additionally, it is praised for its motor drivers.
Adafruit PWM/Servo HAT
This HAT allows control of up to 16 PWM outputs which means that it is ideal for projects including servos or LED control. Namely, it is not very easy to use Raspberry Pi on its own to produce very specific short pulses needed to control servo motors. That is where this HAT comes into the picture. PWM (pulse width modulation) controller will drive all 16 channels simultaneously with no additional Raspberry Pi processing needed. PWM can go up to 1.6KHz with 21 bit precision and it is completely free-running.
Software:
As with most HATs nowadays, Python library is available to get you up and running quickly.
Additional Plus:
PWM outputs are driven over I2C with only 2 pins. Moreover, you can stack up to 62 of them to control up to 992 servos using same 2 pins.
Pimoroni Automation HAT
This HAT is ideal for home automation projects. It is powered with 3 24V tolerant inputs, equally many sinking outputs, 3 12-bit ADCs (0-24V) and relays as well as an additional 3.3V 12-bit ADC channel.
Software:
Simple Python library with examples is available by Pimoroni to help you get up and running with this super powerful HAT.
Additional Plus:
Each channel has a LED indicator which enables user to easily understand what is happening with the setup. This is true for analog channels too. Dimming LEDs indicate the values that analog channels are sensing.
To conclude, choice of HAT is heavily dependent on the application itself, budget, type of sensors you may need as well as the indications and controls of interest.