Coder Social home page Coder Social logo

aklesk / uselessbox Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 21 KB

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: GNU General Public License v3.0

Arduino 100.00%

uselessbox's Introduction

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

uselessbox's People

Watchers

James Cloos avatar  avatar Wolf Hatch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.