Several different systems are used. The most common is a modulated infra red light beam sent from one "sensor" (actually just a transmitter) to the other (actually a receiver). The signal is modulated so that the receiver will not recognise other sources of IR, eg ambient lighting. When someone stands between the transmitter and receiver, the signal is blocked and the sensor triggers the "obstacle" alarm.
I am assuming that it did work once, but has now become unreliable. And that there are no other symptoms - eg interference on the TV or radio at the time these detections happen.
Whilst there are various tests that you can do, these do require specialised test equipment. eg to measure the light output from the transmitter and the sensitivity of the receiver. It may be that the units are fine - but the system is, say, responding to electrical noise on the power lines. There may be dirt or condensation between the outer lens and the actual emitter or receiver element within the enclosure.
However, if nothing else has changed, the odds are that either the transmitter output has fallen, say because of an occluded lens, or the receiver sensitivity has fallen - for a similar reason. Or both.
I'm afraid that all I can suggest, if you don't want to call in a professional, is to replace the two "sensors" with new units. It may not fix the problem. You may be replacing both units, although only one is faulty. You could always do it one at a time... They do need to be the same part numbers as the original, from the same manufacturer. Of course if the problem isn't with the "sensors" - you have gambled the cost of new ones and lost.
What you should see is that the voltage on one "sensor" stays constant - what you are measuring is the fixed voltage fed to the transmitter. Whereas the voltage on the other unit changes (possibly drops to near zero) when something obstructs the line of sight between units. However, depending on the design, it may drop and rise again too quickly for you to see without suitable test equipment.
It isn't only money that you are gambling though:
Bearing in mind that these sensors are a safety device intended to stop people or pets getting hurt - I would suggest calling in the professionals. Luckily it does seem to be failing safe at the moment - detecting an obstruction when there is none. However, this could change to not detecting an obstruction when there is one... DIY repairs to safety equipment is not only risky - it can also leave you exposed to compensation claims, if there is an injury. It can also lead to a great deal of heart-ache, for a very long time...
---------------------- Is there a backup system based on the usage in in older garage door openers?. Measurement of motor current or some mechanical switch set to operate at a given force detects higher than normal loads and treats them as blockages. I have an older system (without sensors) which effectively (and adjustably) limits the closing force and reverses the motor if this is exceeded. This is set so that the force is not dangerous to someone and manually holding the door causes re-opening. Check the door rollers and tracks for binding or some object that may have somehow been lodged in the track.
Steve, Not to tag on, but I have an occasional problem in the morning with our garage door opener which is usually seasonal as when the temperature drops in the fall and winter. I usually begin by clearing any dust or leaves in front of the sensor lenses. If that fails to fix the problem then the door must be manually closed. It usually works when we return from work. I'm beginning to think based on Sue's comments below that there may be some condensation within the sensor due to the temperature drop but I'm not an electrician.