Wearing 2 hats: how to combine capacitive touch input with servo output on RPi zero


#1

Hi, I just bought a Raspberry Pi zero and I’m fairly new to all this. I want to use a capacitive touch interface to control three servos, independent of one another.

For the touch input, I am looking at purchasing either the Touch phat (https://shop.pimoroni.com/products/touch-phat) or the drum hat (https://shop.pimoroni.com/collections/raspberry-pi/products/drum-hat).

The problem is, I can’t figure out how I would use either of these hats and still be able to have room for the servos. The hats seem to cover the GPIOs. How would I get around this and make room for some sort of PWM controller or anything else that lets me control three servos? Could you link to what servo controllers would work for this application, and explain how they would connect when there is already a hat on the pi?

Thanks!


#2

In terms of multiple HATs on a Pi, your options are:

The Mini Black HAT Hacker allows you to use multiple HATs per Pi and the ribbon cable lets you position them away from the Pi, which might be useful for the cap touch input. Whilst the stacking headers give you access to GPIO pins that would otherwise be blocked off (but only for pHATs). I use the latter for pass-through access on my Explorer pHAT.

I might be wrong but the Explorer range of boards only allow 2 motors to be connected, so you might have to look elsewhere, from a quick shop search:

might be appropriate though I don’t have much experience with motor drivers so someone else might be able to suggest something better.

Hope that helps.


#3

Thanks! I ended up using a black hat hacker, the Pimoroni drum hat, and the Adafruit PWM / Servo Driver hat. Here’s a sketch of my setup for anyone who has the same question:


(“Long” and the arrow indicate she which direction the long side of the header faces.