SE3 Expansion header

Hi team! We are trying to control a vacuum gripper with the SE3. But, it didn’t look like the wrist expansion header documentation was posted. Wrist Expansion Header - Stretch Docs
How can we program the wrist arduino to control an external device?

Are there any other methods of controlling an external device using the base instead of the wrist header? I’m asking because our vacuum pump is mounted to the base.

Hi Michael,

I am working some documentation about the wrist expansion header that I will share with you soon. Unfortunately in the base there is no external IOs that can be accessed other than the trunk hub usb ports, Stretch only provides access to the battery voltage at the base.

How is the vacuum pump controlled? If you could provide details of this maybe there is another way we can control the pump. In the mean time ill get the wrist expansion documentation to you asap

All i need is to control a relay so I need to provide an “arduino output high” 3.5V-5V and be able to control that programmatically!

Thanks so much :slight_smile:

@Visaacan_Rathiraj Thank you for your help! I couldn’t find anything on the stretch documentation even after digging through the code base about how to use the wrist expansion header. Let me know if you can find any documentation or examples

The header pins utilize 3V3 TTL logic. They have limited interface protection (eg, ESD, over-voltage, shorts). It is possible to damage your robot if pin specifications are exceeded

The pin mapping is:

Pin Name Function
1 GND Ground
2 3V3 3.3V Power (current limited at 250mA)
3 12V 12V Power (current limited at 500mA)
4 D3 Digital Output
5 D2 Digital Output
6 D0 Digital Input
7 D1 Digital Input
8 I2C SCL I2C Serial Clock Connection
9 I2C SDA I2C Serial Data Connection
10 A0 Analog Input

The expansion DIO uses a 10 pin JST header B10B-PHDSS(LF)(SN). It is compatible with a JST PHDR-10VS housing. JST provides pre-crimped wire compatible with this housing ( part APAPA22K305).

Pin 1 & 10 are indicated below:

Below is an example code that I quickly wrote to toggle the GPIO D2 (Pin number 5 on the connector) high and then LOW from stretch_body

from stretch_body.robot import Robot
import time

robot = Robot()

def toggle_vacuum_pump(output):
    # Accessing wrist expansion header GPIO D2
    robot.wacc.set_D2(output)

def main():
    if not robot.startup():
        print("Error with robot startup")

    # toggle vacuum pump GPIO (D2) HIGH
    toggle_vacuum_pump(True)
    robot.push_command()
    time.sleep(1)

    # toggle vacuum pump GPIO (D2) LOW
    toggle_vacuum_pump(False)
    robot.push_command()
    time.sleep(1)

    robot.stop()

main()

If you have any more questions please let us know

3 Likes

Thank you! This worked well. I appreciate it!