How to detect a bad O2 sensor
How do I know if my O2 sensor may be bad?
If your car has lost several miles per gallon of fuel economy and the usual tune up steps do not improve it - this *is not* a pointer to O2 failure, it just brings up the possibility. Vacuum leaks and ignition problems are common fuel economy destroyers. As mentioned by others, the on board computer may also set one of several failure "codes". If the computer has issued a code pertaining to the O2 sensor, the sensor and it's wiring should be tested. Usually when the sensor is bad, the engine will show some loss of power, and will not seem to respond quickly.
Testing O2 sensors on the workbench.
Use a high impedence DC voltmeter . Clamp the sensor in a vice, or use a plier or vice-grip to hold it. Clamp your negative voltmeter lead to the case, and the positive to the output wire. Use a propane torch set to high and the inner blue flame tip to heat the fluted or perforated area of the sensor. You should see a DC voltage of at least 0.6 within 20 seconds. If not, most likely cause is open circuit internally or lead fouling. If OK so far, remove from flame. You should see a drop to under 0.1 volt within 4 seconds. If not likely silicone fouled. If still OK, heat for two full minutes and watch for drops in voltage. Sometimes, the internal connections will open up under heat. This is the same a loose wire and is a failure. If the sensor is OK at this point, and will switch from high to low quickly as you move the flame, the sensor is good. Bear in mind that good or bad is relative, with port fuel injection needing faster information than carbureted systems. ANY O2 sensor that will generate 0.9 volts or more when heated, show 0.1 volts or less within one second of flame removal, AND pass the two minute heat test is good regardless of age. When replacing a sensor, don't miss the opportunity to use the test above on the replacement. This will calibrate your evaluation skills and save you money in the future. There is almost always *no* benefit in replacing an oxygen sensor that will pass the test in the first line of this paragraph.