not using the smae micros as everyone else(well I can get pics for free, so I just put up with horrible compilers)

the basic bit would be,

read pin (the one the device is conected to)if pin is 1{ left motor foward right motor back}else{ left motor foward right motor foward}

you can take the same code for controling the motors as the sharp IR robot.

you only need to conect up a digital in, and code the micro to read from the digital in. as well as do an if else statement. the if else should be in the sharp IR code, and digital in is realitivly easy to set up.

as for values and timings. chuck something in and see what happens. make a guess. then revise the guess based on if its too slow or too fast. or turns too far.

If you wanna use a TSOPxxxx, you need more hardware. You need an IR-LED of the wavelength of the TSOP and you need an oscillator to modulate it at the carrier frequency the TSOPxxxx needs.

Further, not all TSOPxxxx's will do, as many have a noise cancelling scheme that makes the AGC turn the gain of the TSOPxxxx all the way down when it sees a continuous signal and as such won't work - you need to get one of the types used for IR curtains.

Alternatively, your oscillator could be made more complicated, to make burst patterns and irregular breaks to fool the noise cancelling circuitry.

Given the cost of extra hardware and the time you need to get it working, perhaps a Sharp sensor is worth the higher cost after all?

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

If you wanna use a TSOPxxxx, you need more hardware. You need an IR-LED of the wavelength of the TSOP and you need an oscillator to modulate it at the carrier frequency the TSOPxxxx needs.

Further, not all TSOPxxxx's will do, as many have a noise cancelling scheme that makes the AGC turn the gain of the TSOPxxxx all the way down when it sees a continuous signal and as such won't work - you need to get one of the types used for IR curtains.

Alternatively, your oscillator could be made more complicated, to make burst patterns and irregular breaks to fool the noise cancelling circuitry.

Given the cost of extra hardware and the time you need to get it working, perhaps a Sharp sensor is worth the higher cost after all?

I designed and built a distance detector similar to the one the OP linked to.The one in the link uses a 555 to generate the 38kHz for the IR LED modulation and either detects or not detects an object within a fixed distance. This works fairly well for a non-contact collision detector.

My design used a PIC12C505 to drive a combination of resistors to the IR LED. These lit the LED at different brightnesses and the PIC read whether the reflection was detected at each brightness levels to determine near, medium, far or too far distances. Two pins of the PIC encoded the detection distance to be read by the Bot control processor. While it is not an analog value of distance, which is desirable for mapping, it was useful.

Schematic is really simple. +5V to IR LED, other end of IR LED connects to three resistors, 1.8k, 1.2k & 390. Each of these resistors then connects to a PIC output pin. When all three PIC outputs are low the LED current is maximum at about 15mA. Change the PIC pin that should not be low to an input reduces the number of resistors in parallel and thus the LED current and brightness. The combinations are:1.8k || 1.2k || 390 = 252, ~14.3mA1.8k || 390 = 320, ~11mA1.8k || 1.2k = 720, ~5mA1.8k, ~2mAAllowing four maximum detection distances.

The PIC code has a timing loop to pulse the active pins with a 38kHz square wave. Once this loop runs for the PNA4602's detection time (600us) the PIC input pin from the PNA4602's output is sampled. The code then loops through the resistor (LED current) combinations and sets the two PIC output pins to the detection distance code.