Please help with my Motor control with IR motion sensor project
Ulsterhound
Posts: 2
Hello All,
I am new to microcontrollers and my new Basic Stamp.
I would like to use my basic stamp to start a motor using an IR sensor to monitor motion. This would start a motor that rotates something. When the rotating object rotates enough I would like it to stop by activating a button. This would then reverse the rotation and hen it has returned to it's starting position it would stop again because it activates another button. Then repeat the process again.
What components should I buy and how do you suggest I program this? Thank you much.
Ulsterhound
I am new to microcontrollers and my new Basic Stamp.
I would like to use my basic stamp to start a motor using an IR sensor to monitor motion. This would start a motor that rotates something. When the rotating object rotates enough I would like it to stop by activating a button. This would then reverse the rotation and hen it has returned to it's starting position it would stop again because it activates another button. Then repeat the process again.
What components should I buy and how do you suggest I program this? Thank you much.
Ulsterhound
Comments
I would suggest you first try to describe what you want in more detail before trying to buy components unless you want to experiment first.
Radio Shack:
Breadboard - $10 (you can reuse for many projects)
Jumper wire kit - $6 (you can reuse for many projects)
Parallax IR detector - (My Radio Shack sells this Parallax part)
several small momentary pushbuttons
9V battery and connector or 4xAA pack or?
Any Hobby shop with radio control stuff:
Standard size servo (Hitec, Futaba, Airtronics, JR, whatever) will usually give you roughly 180 degrees of movement. Some are only 90 degrees though. It's easy to control right from your stamp and has a built in position sensor so you always(?) know where it's at.
If you need more than 180 degrees, a continuous rotation servo from Parallax is your best bet, but returning to home position will take a little thought especially if you expect to run it multiple revolutions.
Make sure you read the book linked if you are a complete beginner. Let us know, there's a lot of people willing to help.
I am basically making something similar to a skee ball game where you throw a ball through a hole and that triggers a reward if you make it.
The reward is what the project is for, it is simply a sign on a small piece of 1/8 inch thick extruded PVC that rotates 90-120 degrees, stops for a short amount of time (5 seconds), then rotates back down and awaits another ball passing through the hole.
So I figured I could use an IR emitter and detector as the trigger to start the sequence, when a ball (made of low density foam) blocks the IR signal that would start the rotation of the reward sign. When the sign has rotated the 90-120 degrees or so it would hit a button and that would stop the rotation. After a 5 second count, then the sign would rotate back down 90-120 degrees. The motion would stop again when the sign triggers another button. The process would repeat when triggered again. I would also like it so that the sequence would not try to start again if the IR signal is broken while the rotation sequence is running.
Any other suggestions on components, assembly, and coding would be greatly appreciated.
It sounds like the typical standard 180 degree servo will work. I wouldn't use the Parallax motion detector though. A simple IR Tx/Rx would do just fine. If you gut an old serial mouse it should give you the parts you need. IR transmitter and IR phototransistor that will pretty much hook right to the input pin of your stamp.
http://www.seattlerobotics.org/encoder/200311/johnson/Mousebot.html
I don't think anyone will write the code for you, but start small. Read the book, write a program to count 1-10, then DEBUG the state of a switch on the screen (On/Off), then drive an LED or eight, then get your servo running. Build everything in little sections, get each running properly and put em' together.
Let us know about any more questions!