Shop OBEX P1 Docs P2 Docs Learn Events
Just want to use a GP2D120 as a Bumper switch. — Parallax Forums

Just want to use a GP2D120 as a Bumper switch.

MovieMakerMovieMaker Posts: 502
edited 2009-01-26 13:43 in Robotics
Just want to use a Sharp GP2D120 as a Bumper switch. Simple. or , maybe not.

Anyone got any ideas how I would use it and how I would wire it. And, how I would program it. I have many diagrams and they sortof conflict each other. I tried using an A/D converter without too much luck. I read somewhere that I should put a 10mf cap from Voltage to Ground on the pins close to the IR Detector and have a 10-12k Pull-up resistor also. Maybe I could use it without the A/D converter. Just as a Digital switch. I do not need a million readings, just 1 or zero if it has on the left or right side objects close by. I bought this because I thought it would be an easier way than the IR Detector I am having problems with.

Also, any idea how to program this in PBASIC2.5? I have also a lot of subroutines, but would still like your suggestions.

Any feedback will be appreciated.

Thanks!

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-01-25 05:08
    Hook it up to your stamp and test it. If you hook it up to a pin and then read the pin at some point the pin should change state. If this point is in the range you can use you can go ahead and use that.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • SRLMSRLM Posts: 5,045
    edited 2009-01-25 05:57
    Note the shape of the graph: it spike sharply, then decreases exponentially. So, there will be a space of several inches where the sensor will read high, a space of about 1 " immediately close to the bot that reads low, and the remainder low. You can fix this by moving the sensor back, to beyond the minimum distance.
  • GWJaxGWJax Posts: 267
    edited 2009-01-25 08:53
    Here is a link that I use instead of the a/d converter and works with the RCTIME command. Plus the circuit is very easy to build and can be found in your standard scrap pile of electronics.

    www.noisemantra.com/BASICStampAnalogInput.htm

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • MovieMakerMovieMaker Posts: 502
    edited 2009-01-25 16:23
    Thanks Guys!

    GWJax, I am still waiting . . . .
  • MovieMakerMovieMaker Posts: 502
    edited 2009-01-25 16:35
    What is the model of the diode. would a 1n914 work? This model is the only one I have in stock.
  • GWJaxGWJax Posts: 267
    edited 2009-01-25 16:55
    MovieMaker said...
    What is the model of the diode. would a 1n914 work? This model is the only one I have in stock.

    Yes this will do, any diode will work in this circuit. I would still put at least a 100uF cap from the Vdd to the Vss on the sensor to cut down on a lot of the ripple spikes that the sensor makes you can also go all the way up to a 3000uF cap but nothing higher is needed.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • GWJaxGWJax Posts: 267
    edited 2009-01-25 17:14
    MovieMaker said...
    Thanks Guys!

    GWJax, I am still waiting . . . .

    MovieMaker I have not forgot about you! I have a major project going on right now that I have a time limit on it so all my attention is on that right now. Once I get this project figured out and programmed correctly using the BS2px24 then I'll have time to help you program the Boe-Bot with some AI intelligence as discussed before.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • MovieMakerMovieMaker Posts: 502
    edited 2009-01-25 17:50
    Thank You.

    Sorry, JAX, I have been a little impatient lately. A lot of things going on at my place. I may have a major move and a few other stressful things going on and It seems my bot has been put on hold and I am afraid he will stay on hold by me because I haven't gotten to the point where I fully understand all about him. I desire him to be so much more. But, I am a dreamer and I am hoping that I am not being un-realistic about the project. It just seems so do-able in my mind's eye.

    Post Edited (MovieMaker) : 1/25/2009 6:02:05 PM GMT
  • MovieMakerMovieMaker Posts: 502
    edited 2009-01-25 17:55
    this 100-3000 uf cap. Is it an electrolitic?
  • GWJaxGWJax Posts: 267
    edited 2009-01-25 18:12
    MovieMaker said...
    this 100-3000 uf cap. Is it an electrolitic?

    Yes it is. sorry for not saying so.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • Tom CTom C Posts: 461
    edited 2009-01-25 20:35
    Hi all,

    I plan to use the Sharp GP2D120 on my robotic gripper so that I will know when the arm gripper is close enough to grab the beer bottle. Seriously!cool.gif
    If you want to linearize the Sharp IR range finder·output, here is a link expaining how to do so: http://www.acroname.com/robotics/info/articles/irlinear/irlinear.html

    Regards,
    TCIII

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
  • GWJaxGWJax Posts: 267
    edited 2009-01-26 00:21
    Tom C thanks for the post but MovieMaker in an earlier thread had asked how to use this sensor without using a 10 bit a/d converter so I had given him the schematics for this and anyone else who does not want to use the converter and just use the RCTIME command. You still can get very good results with this circuit and you can still pick up that beer bottle as well. As they say there's more than one way to skin a cat... Of course I would never do that....

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-01-26 03:01
    D12_339.jpg
  • MovieMakerMovieMaker Posts: 502
    edited 2009-01-26 13:43
    I built the schematic that was in pdf form from the parallax sight. I used a 10k pot. Only the extreme side of the pot would work a little bit. Maybe is should've been a 50k pot. But, that is why I decided to go another route. There is not a lot of room on my breadboard for a lot more stuff.

    Thanks Guys for the feedback.
Sign In or Register to comment.