PanTilt HAT with SG90 servo (MIN and MAX values)

Hi. I bought the PanTilt HAT (module only) and one of my sevos is a SG90. Does anyone have the MIN and MAX values for this servo to use in my pantilt.py?

Thank you.

If its a 180 degree of motion servo its -90 to +90, 0 is centered. I do believe those are the ones Adafruit uses in the pan tilt kit and those ones are 180 degree servo’s.
If your building one of the Adafruit pan tilts make sure you center the servo’s before you put it all together.

I have a Waveshare PanTilt HAT and it didn’t to what I needed it to do so I’ve bought this PanTilt Hat. The module only. One of the Waveshare servos is a SG90. The other one works as expected but i would need the values for it in the pantilt.py file:

def __init__(self,
             enable_lights=True,
             idle_timeout=2, # Idle timeout in seconds
             light_mode=WS2812,
             light_type=RGB,
             servo1_min=575, # works fine
             servo1_max=2325, # works fine
             servo2_min=800, # this is a SG90 
             servo2_max=2400, # does not work as expected
             address=0x15,

Ah, OK, I didn’t do it that way. I used the pan and tilt commands. To center my two servo’s I do this.

import pantilthat

pantilthat.pan(0)
pantilthat.tilt(0)

From here, http://docs.pimoroni.com/pantilthat/

Pan

pantilthat. pan ( angle )

Set position of servo 1 in degrees.

Parameters: angle – Angle in degrees from -90 to 90

My servo is not the one that comes with the Pimoroni kit. Therefore its pulse values are not

servo_min=575,
servo_max=2325

which you later translate to degrees.

SG90’s are what came with mine. Anyway, it looks like I don’t have the info you need. You may have to wait for someone else to reply or play with the values.

Weird. Are you sure they’re not MG90S?

Yes, I have a Pan Tilt I just recently bought from Adafruit. It arrived broken and I have one servo removed. It’s marked SG90. If you go to the Adafruit product page it states, It also comes fully assembled with two Micro Servos (SG-90 or SG-92 type) included.

I didn’t give it much thought and just used the pan tilt commands, and it worked out very well for me. I usually just try the easy route first. I’m using mine in Motion Eye OS. I’ll be getting a second one at some point to replace the defective one I got from Adafruit.

I have one already in service that I bought here. Just FYI.

Thank you for letting me know.