Pi Servo HAT Questions

Hello SparkFun,

I have purchased a SparkFun Pi Servo HAT and need to use it with a Pi Zero. (It is meant to drive a gimbal on a drone which holds a PiCam hooked up to the Pi Zero.)

But not being an electronics whizz (yet), I thought I better ask for help first.

https://www.sparkfun.com/products/14328 states:

“Thanks to its I2C capabilities, this PWM HAT saves the Raspberry Pi’s GPIO, allowing you to use them for other purposes. Additionally, the Pi Servo HAT adds a serial terminal connection,…”

I have searched a long time now, but cannot come up with a clear answer as to which PINs from the Pi are used by your HAT, and which aren’t.

I have found this: https://pinout.xyz/pinout/pi_servo_hat#, but am uncertain how to interpret the graphic and information there.

My assumption: BCM 2 & 3 are used for the I2C bus, and BCM 14 & 15 are used for a serial connection.

My questions:

  1. Is this interpretation/ assumption correct?

  2. How can I then access the serial ports? (From the graphic above they seem to be in use…)

I need the serial port for bi-directional comms, so the flight controller (which issues commands to the PiCam and the gimbal) can talk with Pi Servo HAT/ Pi Zero combo.

I am looking forward to your insights, so I can move on with this project.

Thank you in advance and Kind Regards, camti

sorry - just realized this is not quite the same product - could mod pls move this to the right thread? Thanks!

Hi camti,

That is correct. The Servo HAT uses the I2C pins (8 and 9) for controlling the servos and, if connected via USB to a computer, the onboard FTDI taps into the serial pins on 15 and 16. If you do not have a serial connection over USB present, those pins are available to use. We added the USB serial connection to connect to the Pi with a serial connection if you wanted to set up the Pi without needing a monitor and keyboard. The [Hookup Guide covers this in a bit more detail along with a bunch of other information on the hardware, setting it up with your Pi and example code.

I hope this answers your questions thoroughly. Let us know if you have any other questions about the Servo HAT and we would be happy to help as much as we can.](Pi Servo Hat Hookup Guide - SparkFun Learn)

The schematic can be found under the documents tab: https://cdn.sparkfun.com/assets/1/a/1/6 … ld_v10.pdf

It looks like, in order to use the Pi’s serial port on pins 8 and 10 to connect to something other than a PC thru the usb port, you will need to cut the traces from those pins (at least pin 10, which is the receive input to the Pi)

/mike

TS-Mark:
If you do not have a serial connection over USB present, those pins are available to use.

Thank you for the prompt, helpful and clear response.

What about the statement of mike though, about needing to make this modification:

It looks like, in order to use the Pi’s serial port on pins 8 and 10 to connect to something other than a PC thru the usb port, you will need to cut the traces from those pins (at least pin 10, which is the receive input to the Pi)

Is this necessary to do, if the USB port (on the HAT) is not used?

Thanks for your insights!

Hi camti!

If you’re already using those pins for other purposes, you’re going to want to not connect them to the Pi Servo HAT when you attach the hat to your Pi.

The easiest way to do that would be to clip off pins 8 and 10 on the socket you solder to the HAT so that RX and TX are disconnected. Then, connect the HAT last in the stack of HATs you’re adding to the Pi. That will allow all the other pins to connect except for pins 8 and 10. (RX and TX)

(If you’re NOT already using those pins, it’s OK to leave them in place.)

0J5966.500.jpg

Hello TS-Chris,

thanks for the explanation. Call me dense, but I still don’t fully grasp it and want to confirm my understanding is correct.

I would be using the Pi Zero and only your Servo HAT (nothing else stacked).

My intention would be to NOT use the USB port on the HAT to make a serial connection to the flight controller, but instead use pins 8 and 10 for the serial connection.

Will those pins then work in this constellation, without modification?

Thanks in advance for your patience and guidance!

P.S.: The socket is already soldered on solid.

Hi camti.

Since you’ve already soldered the headers, it gets a bit tougher to isolate the RX and TX lines unless you cut pins 8 and 10 off your Pi.

I’d try your serial device with the Servo HAT in place and see if it works. There’s a chance it will but if it doesn’t you’re going to need to modify the shield to disconnect RX and TX. There’s a trace on the top and bottom of the board that would need cut and it could be tricky to do without breaking other things on the HAT if you’re not experienced with that. The attached pictures show the traces you would need to cut in green.

14328-05.jpg
14328-04.jpg

Dear TS-Chris,

thanks very much for clarifying this and your prompt help through this support channel.

This is in line with the friendly impression I have of Sparkfun, and goes along with the image you portray. Well done.