I have this motor as seen in the link provided below
My question is: Can I make it so that the stepper motor rotates 360 from 0 when triggered, then have it stay at 360 while it is triggered and only after it is no longered triggered return back to 0. Then hold the pos 0 until it gets triggered again and then it would repeat the same process. Any help would be great. Thanks!!
Strictly speaking, no, it can't. A stepper motor, by itself, does not know what "0 degrees" is. It may be able to accurately turn through 360 degrees, but it does not know where it started from. Do you follow?
Other than that, yes, the rest sounds simple enough. Although you have not explained what "triggered" means. I assume it's just like a push button or something?
A Servo motor knows where 0 degrees is. Unfortunately, most servo motors can't turn through 360 degrees. Most can only do 180 or maybe 270 degrees. But with an external gear, you could do 360.
Sure you can. If you want to know how, we need to know:
What stepper driver are you using? What supplies the "trigger" signal? How will you power the stepper?
Sure I have one of these lil guys 28BYJ-48 High Quality Stepper Motor 5V. And Im signaling it with an ultrasound sensor. So essentially once somethings gets close enough its sets off the sensor which in turn sets off the Stepper Motor. and Im hoping to be able to plug this into a wall using a socket because its going to be part of an installation
Stepper basics. to get started with steppers.
The Ping library and this will help with using the HCSR04.
Yeah I've read that and all I can get the stepper to do is to continuously turn in one direction until it receives an input from the ultrasound sensor in which case it then begins to continuously turn in the other direction and then goes back to spinning the original direction when the input stops. I cant figure out how to "pause" it so it stays at 360 while it is receiving a signal from the ultrasound sensor
Post your sketch and a schematic. Follow forum rules when you do that.
I’ve attached a jpg of my setup hopefully it helps. I’m new so if I messed up or if that is not what you meant please let me know. Thanks again for the help everyone!
The forum rules are not clear about how to make a picture appear once you have attached it to your post. The rules were written back when pictures appeared automatically in your post. Now you have to copy the link address of the attachment, edit your post again and paste in the picture, like this:
The picture is better than nothing, but can you please attach a real schematic (switch Fritzing to schematic view, and make the diagram look neat and easy to follow) and your sketch as requested.