DIY – Oxygen Sensor Replacement


June 28, 2013 by quirkyuncle

Oxygen sensor replacement can be a fairly easy task that you can perform with a minimal number of tools. Aside from the oxygen sensor location, the replacement process is a fairly standard task; replacing your sensor should be very similar to the procedure shown in this posting (for a 2004 Mazda RX8, rear heated oxygen sensor).

Oxygen sensors, also called O2 sensors, are a part of the automotive engine controls that measures the composition of exhaust gasses. Data reported by the oxygen sensor allows the fuel mixture to be adjusted for optimal performance and minimal pollution. O2 sensors are a required component of automotive emission systems. Failure of an oxygen sensor is indicated by the check engine light and your car will not pass an emission test if an oxygen sensor failure is indicated.

Oxygen sensors are long-life components that can last over 100,000 miles, unless they are physically damaged or subjected to destructive contaminants caused by other problems within the engine.

You can read some interesting information about oxygen sensors at the Walker Products, inc. website. This link includes pictures that can help you diagnose engine problems based on the appearance of your oxygen sensor.

Depending on your vehicle model and type, there will be at least two and up to several oxygen sensors in your car. While some of these sensors are the same, for instance the sensors used on the left and right sides of an engine with a V-configuration, most of the sensors are not interchangeable. It is important to make sure exactly which sensor has failed, so you can purchase the correct replacement. The diagnostic code stored in your cars computer can tell you which sensor is having a problem.

Tools: Oxygen sensor wrench or socket (shown below). Other standard tools might be required, based on your application.
Time: 60 minutes
Difficulty: Easy

Oxygen sensor wrench
Most oxygen sensors are standardized at 22mm. While you could try to use a 22mm wrench to remove an oxygen sensor, doing so could damage the sensor, making it impossible to remove. Because they are installed in the exhaust system, oxygen sensors can be difficult to loosen. The socket shown below, with a slot cut in it for the wire, is specifically designed to loosen an oxygen sensor without damaging it. They are relatively cheap (mine cost $8) and well worth the investment.

Oxygen sensor socket

Reading the fault code
You’ll need to read the fault code that is triggering your check engine light to determine which oxygen sensor has failed. I discuss how to do that in DIY – Help! My “Check engine” light is on!. I read mine using a BlueDriver Scan Tool. You can identify which part has failed base on the fault code by checking your service manual, searching online, or by asking at your local auto parts store.

My scan showed a P0138 fault code. On the 2004 Mazda RX8, this code indicates a rear heated oxygen sensor failure.

Oxygen sensor fault code

Oxygen sensor location
Typical oxygen sensor locations are in the exhaust manifold and in the catalytic converter. Specific oxygen sensor locations for your car are listed in its service manual. You can also find oxygen sensor locations by searching online or asking at your local auto parts store.

The rear Mazda RX8 oxygen sensor is located in the side of the catalytic converter.

Rear oxygen sensor location - Mazda RX8

Cars are very heavy. A car on any jack is not stable and can easily fall. You can get hurt or die! If you need to go beneath a raised vehicle for any reason, use jack stands or ramps. Be careful! You are performing this procedure at your own risk!

Repair or replace?
The Mazda RX8 factory service manual indicates that an oxygen sensor failure code could also be caused by a dirty electrical connector. The same should be true for other vehicle applications. Cleaning a connector is the cheapest fix ever, so it’s worth a try. Find the connector, take it apart, squirt it with some electrical connector cleaner (available where automotive chemicals are sold), and put it back together.

I didn’t get this far. While locating the connector, I noticed that something had hit my oxygen sensor, bent it, and torn its wires. (The arrow shows the oxygen sensor electrical connector that is mounted on the side of the transmission.)

Damaged oxygen sensor

Purchase generic or vehicle-specific parts?
For most vehicles you can find oxygen sensors that are designed specifically for your application and generic oxygen sensors that can be used in a variety of vehicles. Generic sensors are typically less expensive, but might require you to assemble the connector so the wires can plug into your car (parts and instructions for connector assembly should be included with your oxygen sensor and are not covered in this posting).

I prefer the vehicle specific sensors, as there is no question regarding whether or not they will fit. I also know a lot of folks who have used generic sensors without any problems. The choice is yours. Consider the price and ask your parts dealer for recommendations.

Whatever you decide, make sure new oxygen sensor that you bought matches the one in your car before you start taking things apart. Make sure that they have the same electrical connector and that the wire is long enough.

Oxygen sensor installation

Once you’ve determined that a specific oxygen sensor has failed, and obtained the correct replacement part, it’s time to install it.


  • If you need to raise your car to reach the oxygen sensor, use jack stands or ramps. You are performing this procedure at your own risk!
  • Exhaust system components, particularly catalytic converters, are very hot. Allow them to cool sufficiently before touching them so you don’t get burned. (This can take a while.)

  1. Soak the area where the oxygen sensor is threaded into the exhaust system with penetrating lubricant (I used WD-40) and tap the area lightly with a small hammer to help the lubricant get deeper into the threads. Also spray, soak, and tap any other bolts threaded into the exhaust system that you will need to remove. Wait several minutes. Exhaust system components are exposed to the weather and subjected to extreme temperatures. As a result, they tend to rust together making them difficult to remove. Allowing them to get saturated with a penetrating lubricant makes them easier to disassemble.
  2. If your oxygen sensor has a protective shield, remove it. The shield on a Mazda RX8 is shown in the photo with the mounting bolts identified. One of my bolts broke during removal. Luckily, the just one bolt was sufficient to securely remount the shield.

    Remove shield

  3. Disconnect the oxygen sensor wire from its connector on the car. Most oxygen sensor connectors require that you press a tab (identified in photo) to release the connector. Not how the wire is routed before you disconnect it, so you can replicate the path it takes when you install the new sensor.

    Disconnect connector

    The rear Mazda RX8 oxygen sensor connector is mounted on the side of the transmission.
    Connector location

  4. Slide the oxygen sensor socket over the sensor so that the wire hangs out of the slot in the socket.

    Disconnect connector

  5. Turn the oxygen sensor counter-clockwise (like unscrewing a light bulb) to remove it. The sensor might be very tight and take considerable force to loosen. If you are not having any luck, try re-soaking the sensor with penetrating lubricant, as described in step 1. You might need to do this several times. Using a longer ratchet or breaker bar can help. Apply even force.

    It's out!
    It is possible that the sensor might be stuck in place. If this happens, reconnect the electrical connector and contact your mechanic. There are things a professional mechanic can do to take the sensor out without damaging your exhaust system. Discretion is the better part of valor! Exhaust system repairs can be very expensive.

  6. Visually inspect the old oxygen sensor. The Walker Products website provides some good photos of what to look for. If any serious problems are indicated, consult your mechanic.

    Old and new sensors

    My old oxygen sensor (at the top) looks healthy. If not for the physical damage, it would probably still be working fine.

  7. Install the new oxygen sensor. Make sure the threads are correctly aligned; if they are, you should be able to spin it in part way by hand. Tighten the sensor using the oxygen sensor socket. Optionally, you can apply anti-seize compound (available where automotive chemicals are sold) to the oxygen sensor threads before installing it to make future removal easier.

    Old and new sensors

  8. If your oxygen sensor has a protective shield, install it.

    Shield installed

  9. Guide the wires from the oxygen sensor to the connector; then, connect it, pressing the connector halves together until the release tab clicks or engages.

    Connecting the wires

  10. Route the wires neatly and secure them with zip-ties. Make sure that the wires do not touch any hot parts of the exhaust system, are not hanging where they can be damaged, and are not in a position where they might be pinched by any components that move. The wire should be routed tightly enough to not sag, but not so tight as to stress the points where it comes out of the sensor and the electrical connector.

    Neatly routed wires

Installation is complete!

Clearing the fault code
After the new oxygen sensor is installed, it is highly unlikely that the check engine light will go off immediately. Most vehicles need to be driven several times and for at least a certain number of miles before the fault code automatically clears. Some vehicles require that the code be manually reset using a code reader, such as the BlueDriver Scan Tool.

Even if you clear the code using a scan tool, you must drive a certain distance to re-calibrate the system before you can pass an emissions test. For our Mazda RX8, you need to start the car at least twice and drive it for at least 50 miles. The good thing is that if you check the codes with a scan tool before this time, it will tell you if there is a code pending that has not yet triggered the check engine light, allowing you to see if the problem is solved.

Before purchasing parts at a local parts retailer, ask what their policy is regarding resetting of fault codes. Some will do a reset for you if you purchase the replacement part from them; most won’t if you purchase the part elsewhere. In some locations, parts stores are prohibited from resetting fault codes. You parts dealer should also be able to tell you if the check engine light will extinguish automatically after correcting the problem and how long this will take.


Subscribe to this blog, this post, or enter comments below. I'd like to hear from you!

Search for a topic

Like what you see?

Please consider helping us out!

Visit us on YouTube!


  • Facebook
  • Twitter
  • Pinterest

Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 82 other subscribers

Translate this site to your language!




Get every new post delivered to your Inbox

Join other followers:

%d bloggers like this: