Greetings all! I might be a late comer to this topic, but better late than never. I'm "IT" challenged and beg yours and the monitor's patience with my attempt to assist.
Back round...bought 07 Rav, v6 auto 4wd, 223,000k's with no codes / lights lit. Month later bought inexpensive code reader to try to enter the 21st century. One month later CEL, VSC, 4WD, lights appear. Reader indicated "P0031" heater control circuit low, bank1, sensor1".
Schooling...I ran out and bought the Haynes manual thinking I might get a look at the afflicted sensor to no avail. I suggest you save your money and spend it on a first aid kit of Bud, get comfortable (more on that later) and read everything connected to trouble lights and A/F sensors and how they work on this forum. Watch all the Utube you can tolerate but be selective as to what to take in. If you are not familiar with rust and corrosion watch how to work with it and penetrating oil. Always pull a wrench, don't push it. You will have a better chance to save your knuckles this way when the wrench / ratchet slips.
Tools / materials...Pics attached, I hope.
trouble light, flashlight
inspection mirror
1/4" ratchet, w/ 10mm socket
3/8" ratchet, w/ 10mm deep series socket , 10mm regular socket, 13 mm reg. socket, 5mm hex drive
3/8" (wobble optional) extension 3" long
3/8" extension 6" long
3/8" breaker bar (how strong are the pawls in your ratchet?)
length of 3/4" pipe for a cheater
3/8" x 22mm (7/8") sensor socket (Tekton #49290 Sensor) or equivalent
tack puller (use your imagination here and substitute if needed)
bent nosed needle nosed pliers (you can buy them pre bent!)
fine screw driver
can of aerosol penetrating oil of your choice
bottle / can of penetrating oil of your choice
anti-seize
dielectric grease
The sensor... A Denso #234 9022 air fuel ratio sensor. Etched on the side "Denso A-F 912, 04E08" When you search for this it is often described in suppliers catalogues as the "high sensor, right bank" "bank1, sensor1", and commonly referred to as an "O2 sensor above the cat.". When you open the packaging don't have a conniption when you find it doesn't match your original. The business end of the new one is tapered compared to the original. (Original in pics.)
My original had "Toyota 89467-42060, Denso, 02J23" etched on the side. I believe the long number is a serial, the other a catalogue number. By now they have likely gone through a number of revisions.
The fix...
The day before I ran the car till it was hot. Put it up on the ramps and attempted to apply penetrating oil to the sensor from the aerosol. Almost no access to it from below. Don't be shy with the oil as some will surely find its way. If nothing else it will help with rust prevention some where.
I ran the car up on the ramps to prepare for the repair. I suggest you leave it on the floor and reaching the back of the motor will be easier. You may want a low step / platform to ease the reach.
Battery ground off, engine cover off, oiled all the air duct clamps, and anything else I thought would need it.
I blew all the dust and dirt I could out of the engine compartment with an air line. Get your leaf blower if you don't have a compressor.
Disconnect the vacuum lines associated with, and remove the air filter cover, throttle body, air intake cover. There are 2 coolant lines attached to the throttle body. leave them in place it's drier that way. The biggest problem I had here was removing the 2 bolts (13mm) at the back of the air intake. It goes quicker if you begin with the proper size socket. This will be done by feel and with the mirror. With the manifold gone, stuff clean rags into the ports to keep things like ear rings from entering. We blew all the other refuse away previously right?
At this point I used some old bath towels to pad the top of the rad and engine so that I could lay on it with out being poked and bruised in the chest. Remember me mentioning comfort earlier? It makes a miserable job go easier if you can be comfortable while your doing it. Caution, we haven't got to the beer part yet.
Fumble around between the engine and the firewall and with the aid of the lights and mirror find the wire harness for the sensor. Disconnect it from the main harness using the screw driver to release it if needed. If the wires are clipped to a support ( there may be 2) detach them.
Use the harness to glide the sensor socket down onto the sensor. With the long extension fit it into the socket. The sensor is tilted to about the 11 o'clock position and needs to keep this in mind when wrenching on it. Put the breaker bar / ratchet on the extension. Now put the cheater bar /pipe on the handle of the breaker bar. This will increase the mechanical advantage and save a lot of grief. Left hand supports the exertion in the 11 o'clock position, right hand exerts the force in a counter clockwise direction (Righty tightie, lefty loosie). Slowly increase your effort. The extension may begin to twist with the effort but suddenly there will be a loud snap. This means the "stiction" in the threads has loosened and you likely got about 5 degrees of rotation out of the sensor.
Remove the extension from the socket leaving it in place. Take a piece of coat hanger wire or the like and poke it into the 3/8" hole, apply liberally the liquid penetration oil to the wire so the oil runs down and floods the interior of the socket and the sensor.
With extension and ratchet etc. in place turn the sensor back to the right. Now to the left again gently till resistance increases. keep working this way and you will feel it loosen up so that each movement increases in it's rotation. When you can rotate fully remember to keep the slack out of the wires so the plug does not get caught up on other obstacles and have the wire rotate in unison till the sensor is loose.
The new sensor comes with antisieze so coat the threads. Crawl into the engine compartment and start the threads of the sensor using your left hand. the right will feel for the bung and direct you. You won't see it so remember it is slanted to the left some what when you start to thread. Rotate the wire harness in step with the sensor. Once you get it started put the socket and extension on it and thread it in. With the ratchet snug it up. Torque value is to be around 30 ft lbf. I didn't bother.
Now put it all back together again. The wires from the sensor have a clip that is to attach to a bracket. It was too much hassle so I cut it off and used a cab-tie. All the electrical connections were dosed with dielectric grease. All the fittings had antisieze applied. Take your time and don't panic if you aren't sure where something goes. Hoses and wires all are bent in a way to systematically find there way home. remember to get the rag out...
Summary...This is a good time to clean the throttle body, be gentle with the butterfly when you open it. Work slow and deliberate. I use carb cleaner and some Seafoam, soft toothbrush (the wife's, she uses mine for the toilet) and a soft rag.
Once I gave everything a close inspection I started the vehicle up. It stalled immediately but I figured the computer had to talk things over. The next attempt was successful, with nothing out of the ordinary regarding revs. All lights were out and during a shake down the battery light flashed twice about 4 minutes apart. 3 days later all is well with the code reader indicating all clear.
I don't consider myself an auto mechanic, but including the throttle body cleaning I added up approximately 5 - 6 hours invested. The crowfoot wrench, and thread chaser I did not use. I bought them as insurance. My sensor cost $150.39 cdn., the socket $21.69 off Amazon. A local parts source here quoted $327.00 Cdn. If I could find a shop to work at $84 / hr the cost of the replacement would be $831 before taxes. I consider myself well paid.
Rav4World... I previously changed the bearing in the driveshaft coupling with the assistance from knowledge shared here by others who took the time and made the effort to share their experiences. I would like to thank all who contribute, and administer this site, and wish you well...AGH!