Introduction: Switch-Activated Sweeping Arm

About: The Duquesne Assistive and Rehabilitative Technology Lab is part of the Department of Occupational Therapy at Duquesne University. We teach students to make assistive technology. Check out our Minor in Assisti…

The Switch-Activated Sweeping Arm is a semi-autonomous assistive device designed to help individuals with limited mobility. It mimics the function of a sweeping motion using a robotic appendage, controlled by a button to sweep around 90 degrees. Ideal for wheelchair users, elderly individuals, or anyone needing support with daily household tasks.


Design Considerations:

  1. Motion Range: The Arm is designed to sweep in a wide, controlled arc for around 90 degrees
  2. Adaptability: Mountable to wheelchairs, mobility aids, or fixed stands
  3. Accessibility: Controlled via a simple switch


Designed by Abbey Surdy, 2025

Supplies

Materials

Breadboard

Raspberry Pi Pico H

Jumper Wires

1/8" Mono Switch Jack

Servo Motor

Battery Holder

Power Cable


Tools

Glue Gun


Bill of Materials

Step 1: Connect Servo Motor to Pico

Connect the servo motor to the Pico:

  1. Motor Power (Red) to Pico VBUS (Pin 40)
  2. Motor Ground (Black) to Pico Ground (Pin 3, 8, 12, 18, 23, 28, 33 or 38)
  3. Motor Signal to Pico GP0 (Pin 1)


Upload the MicroPython code to the Raspberry Pi Pico. I use Thonny, but there are lots of ways to do it.


from machine import Pin
from machine import PWM
import time

def gpio_set(pin,value):
if value >= 1:
Pin(pin, Pin.OUT).on()
else:
Pin(pin, Pin.OUT).off()

# Describe this function...
def sweep():
pwm0 = PWM(Pin(0))
pwm0.freq(50)
pwm0.duty_u16(1802)
time.sleep_ms(2000)
pwm0.duty_u16(5800)
time.sleep_ms(2000)


while True:
sweep()
time.sleep_ms(2000)


Step 2: Connect Switch Jack to Pico

Connect the switch jack to the Pico

  1. Wire 1 (either wire) to Pico Ground (Pin 3, 8, 12, 18, 23, 28, 33 or 38)
  2. Wire 2 (either wire) to Pico GP16 (Pin 21)


Upload the MicroPython code to the Raspberry Pi Pico.

from machine import Pin
from machine import PWM
import time

pIn21=Pin(21, Pin.IN, Pin.PULL_UP)

def gpio_set(pin,value):
if value >= 1:
Pin(pin, Pin.OUT).on()
else:
Pin(pin, Pin.OUT).off()

# Describe this function...
def sweep():
pwm0 = PWM(Pin(0))
pwm0.freq(50)
pwm0.duty_u16(1802)
time.sleep_ms(2000)
pwm0.duty_u16(5800)
time.sleep_ms(2000)


while True:
if not (pIn21.value()):
gpio_set(1, True)
sweep()
else:
gpio_set(1, False)


For testing purposes, you can use a button on the breadboard instead of a switch jack.

Step 3: 3D Print Enclosure and Arm

Print the sweeping arm and the enclosure.

Step 4: Attach Servo to Sweeping Arm

Attach the plastic arm (which I hope you got with your servo motor) to the servo using the screw that (I hope) came with it.

We used hot glue to attach the sweeping arm to the servo motor's arm (just be careful that the hot glue doesn't get on the motor itself).

Step 5: Finish Assembling Enclosure

Use hot glue to attach the servo motor to the exterior of the enclosure. Run wires from the switch jack and the motor through the hole in the enclosure to the breadboard.

Step 6: Make It Mobile

Hardening the connections

If you want to use this for real, you will need to make sure the connections between components are robust and reliable. You should replace the breadboard with something you can solder to and solder wires and components.


Powering your Pico

I used a battery pack and a USB-micro "pigtail" with power and ground exposed.


Running a script without being attached to a computer

I followed these instructions for running a program on a Raspberry Pi Pico without a computer attached.


1. Write and Save Your Script:

Create your Python script using Thonny or your preferred editor.

Save the file as "main.py" on your Pico . This is crucial for automatic execution when the Pico is powered on.

2. Connect to the Pico:

Connect the Pico to your computer via a USB cable.

3. Transfer the Script:

In Thonny, open the "MicroPython (Raspberry Pi Pico)" interpreter and click "Open".

Select your "main.py" file and click "Open".

Optionally, you can click the thonny_run button in Thonny to get the script running in the Raspberry Pi Pico

4. Unplug and Power Up:

Disconnect the Pico from your computer.

Power on the Pico. It will automatically run the main.py script when powered up.