Wall Detecting Robot
If you need to build it using IR you will face two problems. First, the black color &amp; glass will create a problem. Secondly, sunlight or any other IR source will cause problems. The intensity of sunlight varies randomly. In the case of line follower robots, this factor don't cause much problem as the sensor is under the car.  

So, the best way is to use a 22KHz sine wave (with proper DC offset) for the IR LED. And a bandpass filter on the receiver side. (Like tv remote IR transmitter and receiver)  

If you can't do that, then buy TCRT1000. Connect the output to a comparator (Non-Invertinginput). And calibrate by giving a reference voltage at inverting input.  

Use the op amp output to drive a wheel. Just turning on and off one wheel of two, you can rotate a car.