About six weeks ago, the 'check engine' light and the VSC lights came on (2007 Camry 6 cyl.) I checked the engine code and it was throwing a P0031 - Heater Circut not functioning for O2 sensor Bank 1 Sensor 1. OK, I ordered up a new Denso sensor but before I could install it the lights went out (and stayed out for a week). The lights came back on so I installed the new sensor, cleared the codes but am still getting the P0031.
For giggles, I checked the resistance on the old sensor and they were well within spec. (didn't need to spend the $140 for the new sensor.)

So now I am trying to determine what is causing the problem. Could it be the ECM and is there some way to test it? What else could causing the problem. Any thoughts about purchasing an ECM from a junk yard as new ones cost almost $1,000?
Suggestions are much appreciated.