The above photo shows these parts installed on the front of a robot. This is called modulation. The circuit that does modulation is called an oscillator, and I have shown one below. A simple 40khz modulation circuit. The above circuit is an interesting one to look at.
Lets take a quick tour.
There are three major parts to the circuit. Now, there is a gate propagation delay factor that causes this circuit to continuously flip states. The resistors and capacitor in the circuit are there to regulate the frequency at which this circuit feeds back into itself. Resistor R2 can be used to adjust the frequency of this circuit. The Sharp detector is fairly forgiving about the exact modulation frequency, but getting it as close as possible to 40khz is recommended.