Rasperry Pi Pico – Operate Baomain Pneumatic Cylinder SC 32-200

Took Mark Rober monthly class on creative engineering which introduced us to pneumatics. Made a quick guide to operating the Baomain Pneumatic cylinder in the recommended parts list! Hope someone finds it helpful. A 5/2 solenoid can be used to operate this double acting cylinder; this is easy to control with a raspberry pi pico using a transistor.

from machine import Pin
import time
led = Pin(15, Pin.OUT)
button = Pin(14, Pin.IN, Pin.PULL_DOWN)
blueLED = Pin(16, Pin.OUT)
blueLED.value(0)
while True:
if button.value():
print("ACTIVATION SEQUENCE")
for i in range(0,20):
blueLED.value(1)
time.sleep(0.1)
blueLED.value(0)
time.sleep(0.1)
led.value(1)
time.sleep(1)
led.value(0)
time.sleep(1)
led.value(1)
time.sleep(1)
led.value(0)
time.sleep(1)
else:
led.value(0)
print(button.value())
#time.sleep(0.5)