I have a project where I intend to use a stepper motor and a servo motor. The stepper motor will be connected to the RPi using this HAT as shown in this video made by Core Electronics.
Since I’m using a HAT, will I still be able to connect the servo motor to the RPi’s GPIO pins? Or will the HAT make them inaccessible? I believe I need these GPIO headers (or do I need the 2x20 version?), but even with these, I want to be sure I can connect a servo to the GPIO pins while the hat is connected.
Bonus question: Will the servo motor I linked be powerful enough to pull a toilet’s lever to flush it?
If it matters: I have a RPi 3 Model B V1.2
The most important factor in knowing what you can re-use pin wise while using a hat is what pins the hat uses. Once you have determined that, you can choose to use pins that the hat does not.
That is except if the hat uses I2C, then you can use them as well as they are a bus.
If you read the description of that hat you will see that this is the case, it uses I2C so you can even use multiple hats stacked.
Yes that pin header with the long legs will let you stack the hats.
The servo linked has a torque of 3.1kg at 1cm arm length, this is a best case figure.
It depends on you mechanism and what force the flush lever requires, I dont think that anyone can answer that question for you, you will probably have to do some testing.
I don’t want to stack hats. I want to use the one hat I linked and also the GPIO pins on the RPi itself. It seems possible that the hat will make the pins inaccessible. Is this true?
Whether you are stacking hats or stacking individual pin connectors, the solution is the same: get the extra long stacking headers when you get the hat, and use them instead of the included headers. Then plug whatever you want to use into the stacking headers in the same you would plug directly into the Pi.
Got it, thanks @Jeff105671. So it sounds like I can connect the stepper to the hat’s screw-down headers and the servo to the regular RPi GPIO pins, right? Thanks a ton for the help, clearly I’m very new to this.
I also notice that you linked the 2x20 headers, where Adafruit’s listing for the hat says to purchase the 2x13 configuration for the RPi B (although this doesn’t make much sense to me since it has 20 pins…)
It’s difficult to know exactly what the ‘prototyping area’ contains, but t looks like they are all non-connected pads.
It also looks like ALL the RPi GPIO pins are in use, making none available to use.
It also looks like that board is overkill for what you want to do, have you considered using just an individual stepper driver and interfacing directly with it and the servo?
Ah, if none of the GPIO pins are available after connecting the HAT, this won’t work for me. Thanks a ton for pointing that out.
Perhaps an individual driver would be better. I just need to be sure, with whatever solution I use, that I can use both a servo and stepper.
As I said, I am not 100% sure, the info isnt forthcoming, maybe someone from Core can validate my statement, however, if ALL you want is stepper and servo then you can easily drive the stepper from a stepper driver, it only needs a few GPIO pins (enable, direction and step) and a servo is pretty much the same, although you can drive a servo direct from the RPi using only a single pin…
Choose 20 or 13 according to which model of Pi you have.
You can get an idea of the torque required to push the button by measuring the distance it needs to move and the weight you have to stack on it (or hang from it) in order to make it move. Torque is force by distance. Using a stepper instead of a servo might be a more complex setup, but it gives you access to as much torque as needed, because you can choose a gearing arrangement that uses any amount of rotation rather than the maximum 90 degrees of a servo (and you already have a second stepper driver in that hat).
According to Ada only SCL and SDA are used, plus power.
I did see that, but look at the board layout and schematic, https://learn.adafruit.com/assets/22656
Looks pretty well loaded to me.
It’s fully loaded, but the only pins used for the motor driver are SCL and SDA. Everything else goes to the prototyping area.
Deleted inaccurate post, here’s the proper one
I see what are saying, the small proto area, I was looking at the large one.
Interesting, maybe it would be OK in that sense, however it is still overkill for @Justin217242 as all he wants to use on it is Stepper control.
I’d still go with a dedicated stepper board.
Like the bonnet?
That could be used with a single-row female header for expansion.
Nah, something dead simple like a A4988 or similar like this:
If you want to see what pins are free I’d recommend https://pinout.xyz/ it’s a great resource.
If you want an easy way to add an extra row of pins then have a look at Pimoroni Pico HAT Hacker | PIM300 | Core Electronics Australia it’s pretty cheap and easy way