Skip to content

A project to program a Useless Box using an Arduino Mega, a Nema17 stepper motor, an EasyDriver stepper driver, and a standard metal-geared servo.

License

Notifications You must be signed in to change notification settings

Aklesk/UselessBox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

UselessBox

This is a project which uses a stepper motor and metal servo to achieve a multi-switch Useless Box. It is set up for 15 switches, but more can easily be added (or removed). The included sketch is designed for an Arduino Mega (more pins), but with fewer switches can be adapted to other arduinos.

Order of Action

  • Wait for servo control pin to broadcast properly
  • Activate power to the servo
  • Reset servo position
  • Set stepper to slow fixed-speed
  • Move stepper towards the home switch
  • When home click is found, set stepper position to zero
  • Set stepper to full speed with acceleration
BEGIN LOOP
  • Decide on a destination: poll each switch for state and distance from current position, choose closest. If no switch, go to rest.
  • Travel to distination (blocking)
  • Check for active switch at current position
  • If active switch found, activate servo until switch turns off
  • If servo reaches maximum extent without switch turning off, reset servo and re-home
  • Loop back to beginning.

Physical Electronics

  • Arduino Mega
  • Easy Driver Stepper Driver
  • Nema17 Stepper Motor
  • standard metal-geared servo motor
  • 5V external power supply (for servo)
  • 12V external power supply
  • One Transistor

Required libraries

  • AccelStepper.h
  • Servo.h

Pin assignments

  • Pin 6: Servo control pin
  • Pin 10: Pin connected to a transistor controlling power to the 5V supply (Servo moves randomly during intialization if powered)
  • Pin 11: Home switch to find stepper position - shorted to ground when switch is activated
  • Pin 12: Stepper driver step pin
  • Pin 13: Stepper driver direction pin
  • Pins 31-45: Useless Box control switches

About

A project to program a Useless Box using an Arduino Mega, a Nema17 stepper motor, an EasyDriver stepper driver, and a standard metal-geared servo.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%