I've been running a D&D event called the Grindhouse Arena at gaming conventions for the past decade. This arena that I designed and built has eight players around the table all running gladiators in a trap-filled, spinning arena of glorious carnage and mayhem. The original was built from plywood and painted, and the moving rings of the board are moved manually each round of the game.
This has been a smash success, but I always knew I could do this better. I enlisted the help of an engineer, and the arena has been redesigned and rebuilt using laser-cut and etched black acrylic. The rings of the new arena will be driven using stepper motors and (hopefully) a push button.
What I have:
(16) 28BYJ-48 5V stepper motors mounted under the board, that will move the four rings of the arena (4 motors per ring) with rubber wheels to turn the rings Edited to add: each stepper motor also has a ULN2003 driver
(1) Arduino Starter Kit (with Arduino Uno) has been purchased and is on its way (but hasn't arrived yet)
(1) laser-cut and assembled arena, with stepper motors mounted and ready for wiring
(1) basic knowledge of electronic circuits and wiring that has been gathering dust on a shelf since I graduated college 20 years ago
What I need:
A button that, when pressed, tells (16) motors to run for a specified amount of time. I want my Arduino to have a program that will run based on that single digital input.
When the button is pressed, it sends output signals to the motors to simply run for X amount of time, then stop.
There is no reason for the motors to run in both CW and CCW directions. Each ring only moves in one direction.
Ideally I'd like to be able to have separate outputs to each of the 4 rings' motors, but in the interest of getting this done before the end of February I'm okay with a single output controlling all 16 motors. Alternatively, I could definitely see using potentiometers to set the speed of each ring's motors instead of using four separate outputs for four rings. That might be a better solution.
I'm happy to write my own program, but I'm a complete n00b with Arduinos. I'm looking for expert advice on how to get this done. Where should I start??
while Starter Kit is on the way, you can watch video tutorials about basics: input, output, installing, uploading. learning handling of: LEDs, buttons, both type of stepper motor.
most 28BYJ-48 unipolar stepper motors are sales with ULN2003 module. Its 4 input pins should be connected to Arduino. no additional hardware needed, because you can connect three further drivers inputs (of same ring) parallel to first one.
despite of ULN2003 have 8 amplifiers the module uses only 4. if you manipulate motors to be bipolar you can use stepper driver and such require only 2-3 pins of Arduino.
I reached out to Arduino tech support and learned that the above wiring diagram will NOT work. The Arduino cannot reliably control multiple stepper motors in parallel from a single set of outputs. So now I'm looking into just what I can do with shift registers.
The power problem is now solved (I think). Thanks to @Maverick over on the Discord server for helping me muddle through and locate a battery pack that should be able to handle this project. (There will be testing once it's built.)
Arduino tech support confirmed that I cannot run four stepper motors in parallel from the same set of four outputs, but they also confirmed that I definitely CAN run four sets of four motors from an Arduino with a shift register.
After digging into this for a while, I comprehend the gist of how a shift register works. But coding this thing is still a complete mystery.
THE END GOAL
There are four concentric rings in the floor of the arena with four motors driving each of the rings (16 motors total). These four motors will all turn simultaneously to rotate the ring. At the center of the arena is a tower with a push button on top.
Pressing that button will send a momentary 5V pulse to a digital input on the Arduino. (A two-second debouncing delay will be included in the code.)
That digital input will signal the Arduino to tell the four sets of motors to rotate the four rings one one-inch step, then stop. Rings A and C will always rotate clockwise, and rings B and D will always rotate counterclockwise. The distance of this step will ideally be adjustable for each individual ring, since they're different diameters. I think I can do that with enough shift registers, and I ordered 30 of 'em for six bucks.
To be clear: I'm not asking anyone to write this for me. But what existing building blocks in the code library can I combine to build this?
Specifically, I don't know how to incorporate the stepper motor code into the shift register code. It seems like there should be extra steps.
Did the Arduino guys say why you can't double up the stepper driver on one set of pins? I assume it would pull too much current. Shift registers would do it, but their strength is that the pins are individually addressable, so you can make each motor independent. Since you don't want that, they seem like overkill to me.
An IC that just switches some transistors and can handle more current seems better because then you wouldn't have to hack the stepper library to use the shift registers. I'm more of a software guy though, so I can't help you with the specifics.
Also, life would be easier it you had one stepper per ring. They would need to be stronger, pull more current and need a nicer driver I expect.
If you want to use the hardware you have and run a software solution, you will find it rather complex I suspect.
Yeah, tech support said it was going to be too much current draw on the individual output pins.
It's definitely much too late in the game for me to redesign this project - it's fully built with the motors already mounted, and aside from wiring and programming it's ready to go.
I really don't mind having some overkill for the shift registers. I needed one, but the best price was 30 of 'em for six bucks. So I now have oodles of the things.
I've got just over 2 weeks to complete this beast before the next gaming convention, and I've now got all the physical components in hand. I just need to program it and wire it at this point.
I would be inclined to do the usual thing and try to test a small portion of the solution. Do you have a spare stepper & driver (or preferably several) to figure out how to get it going with shift registers?