Sharp GP2D02 to Basic Stamp II
ltmhall
Posts: 102
I'm building a mobile robot and want to design a collision avoidance circuit. I've been researching the Sharp GP2D02 and I think it's a good idea to go this route. Does anyone think this is a good idea. Has anyone had any sucess interfacing one to a Basic Stamp II. Any input would be helpful.
Note:I've already been to www.acroname.com/robotics/.html
Thats where I got the idea from.
Post Edited (ltmhall) : 1/5/2007 12:56:45 AM GMT
Note:I've already been to www.acroname.com/robotics/.html
Thats where I got the idea from.
Post Edited (ltmhall) : 1/5/2007 12:56:45 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
see
http://forums.parallax.com/showthread.php?p=601475
this is the code that Acroname gives
www.acroname.com/robotics/info/examples/GP2D02-4/GP2D02-4.bs2
and see this code I used.
http://forums.parallax.com/showthread.php?p=575175
let me know if t his helps.
I have tweaked my GP2D02 to centimeter code I can send it to you if you like.
Which Sharp sensor is best, really depends on your specific needs. Here is a (somewhat dated) list (attached) of all the various Sharp distance sensors of that general type. Nearly all of them have been used successfully with a PBASIC Stamp.
Regards,
Bruce Bates
Post Edited (ltmhall) : 1/5/2007 10:47:36 AM GMT
Just as a matter of information, and to be honest, you don't NEED such a sensor when you build your first or first few robots IMHO. "Whiskers" can do a fine job and will teach you many things about both circuity and programming that a Sharp-type sensoer won't do.
On the other hand, here is a step-by-step procedure to choose the proper Sharp Distance Sensor for your needs, You need to ask yourself the following questions, since there is no ... easier or harder Sharp sensor necessarily. If you don't have the answers to any or many of these following questions, then may I suggest you need to go back to the planning stage. In my experience there is no such thing as too much design planning for a robot, no matter how large or small.
1. Are you constrained in some way by using just an analog or just a digital distance sensor? If so, eliminate those which do not meet your needs by looking in the "Output" column in the Sharp Guide.
A PBASIC Stamp has no such direct constraints, although as a general matter digital sensors are generally easier to implement than analog ones. "Easy" should not be the most important criteria, since it's a L-O-N-G way between easy and HARD! Some are just not AS easy, but that DOESN'T make theimplementation overly difficult even for a novice or first timer.
2. How far out in front of the robot, and how near to it·do you need to look? This question can generally be answered by knowing about how fast your robot will be traveling.
Reference the pictures at the bottom of the Sharp Guide I provided earlier to determine which of the sensors fits your needs. There may well be more than one which fits, so mark them all down on a separate piece of paper.
3. Are there any power (current or amperage) constraints?
If so, eliminate those which draw too much current for your application. Refer to the "On Current" and "Off Current" columns in the Sharp Guide to make this determination.
4. Last, keep in mind what Special_K wrote, about the speed of data aquisition, if this is important to your robot. it may or may not be - only you can be the judge of that.
I would view the Sharp "fixed range" distance sensors as a special issue, and not worthy of consideration at present, but just keep them in mind·for possible, future reference.
Hopefully this is more helpful than confusing.
Regards,
Bruce Bates
You need·two IR Emitters:
http://www.parallax.com/detail.asp?product_id=350-00017
You need two IR Receivers:
http://www.parallax.com/detail.asp?product_id=350-00014
You need two resistors:
http://www.parallax.com/detail.asp?product_id=150-02210
Follow the instructions in the document
http://www.parallax.com/dl/docs/books/edu/RoboticsV2_2.pdf·(start on page 235)
IR Detector... no
Resistors... yes
Theses are pretty common components that are sold at most on-line electronic "stores" (like jameco, digi-key, allelectronics, etc.), but I suggest you buy from Parallax for two key reasons: 1. Support for this great company; and 2. ensures you get the exact correct components!
I think this is the IR Detector.
Radioshack part number 276-0640 or 276-640
it is called an IR Receiver Module
in blue letters it says 38kHZ
it has 3 pins but remember they are not in the same order as the one Parallax sells.
www.radioshack.com/product/index.jsp?productId=2049727&cp
I have one but have yet to use it.