Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: aruna1 on February 14, 2009, 08:06:02 PM

Title: SHARP GP2D120 urgent help
Post by: aruna1 on February 14, 2009, 08:06:02 PM
I have 2 SHARP GP2D120 sensors.can some one tel me how to use these two sensors as obstecle detectors? (without rotating sensors-thatis fixed position sensors).i read tutorial about SHARP range finder techniques that says about cross beam system.but I'm not sure whether it will cover whole front face of robot.
can someone please help me.
thanks

p.s. no distance measuring required.i just want to detect obstecle at safe range and avoid it
Title: Re: SHARP GP2D120 urgent help
Post by: superchiku on February 14, 2009, 10:14:21 PM
use a servo to scan the area using the sharp ir,..it will work out
Title: Re: SHARP GP2D120 urgent help
Post by: Soeren on February 14, 2009, 10:44:23 PM
Hi,

[...] (without rotating sensors-thatis fixed position sensors).i read tutorial about SHARP range finder techniques that says about cross beam system.but I'm not sure whether it will cover whole front face of robot.
[...] p.s. no distance measuring required.i just want to detect obstecle at safe range and avoid it
If you don't wanna scan it, you'd be better of with either US (mounted a bit high) or a row of IR tx/rx detectors on the front bumper.
But what do you define as "safe range"? (It will obviously depend on velocity, detection speed and braking/turning time).
Title: Re: SHARP GP2D120 urgent help
Post by: Tomas on February 15, 2009, 03:48:19 AM
So are you looking for obstacle avoidance code or just the placement for the sensors?

If you are wondering about the placement, perhaps you should use the "bumper switch" mechanism described in this document: http://www.societyofrobots.com/sensors_sharpirrange.shtml

Or you could just place the sensors at each side scanning left and right, but I dont think two sensors will be optimal. They wont see forward then right? But the bumper switch will just say if there is anything in the way, they will not say the distance. You should just try the bumper switch, and make the robot turn randomly until its free again perhaps? :)
Title: Re: SHARP GP2D120 urgent help
Post by: aruna1 on February 15, 2009, 04:15:42 AM
I'm looking for obstecle avoidence code using two sharp sensors without rotating sensors
Title: Re: SHARP GP2D120 urgent help
Post by: Admin on February 17, 2009, 12:03:52 PM
I'm looking for obstecle avoidence code using two sharp sensors without rotating sensors
For which microcontroller?

pseudocode:

if(sensor_detected_something())
   rotate();
Title: Re: SHARP GP2D120 urgent help
Post by: aruna1 on February 17, 2009, 11:51:02 PM
I'm looking for obstecle avoidence code using two sharp sensors without rotating sensors
For which microcontroller?

pseudocode:

if(sensor_detected_something())
   rotate();

i'm using PIC 16F877A

how to do this with interrupts.when detects an obstecle it interrupts and rotate?
Title: Re: SHARP GP2D120 urgent help
Post by: Admin on February 17, 2009, 11:58:23 PM
Look at my 16F877 code and try to study the comments, etc.

Try to program it, and if it doesn't work, post your code here. I'd like to help you more, but its unfair for you to ask us to write it for you . . . :P
Title: Re: SHARP GP2D120 urgent help
Post by: aruna1 on February 17, 2009, 11:59:51 PM
Look at my 16F877 code and try to study the comments, etc.

Try to program it, and if it doesn't work, post your code here. I'd like to help you more, but its unfair for you to ask us to write it for you . . . :P

where can i get your code?
Title: Re: SHARP GP2D120 urgent help
Post by: Admin on February 18, 2009, 12:07:15 AM
ummmm by searching the forum for '16F877 code' of course! :P