Toyota Repair: Rav4 o2 sensor error P0038, oxygen sensor, sensor error


Question
I have bought recently Rav4 2004,by i have two errors displayed on

the screen, VSC trac & Check Engine, when we put it on scanner

the error displayed was P0037 (oxygen sensor heater control circuit

low Bank1 sensor 2) so after we plugged in the new oxygen sensor 2

beneath the passenger side,we get a new error code on the scanner

which is P0038, we cleared the error but it is appearing again..

Please it is highly appreciated if anyone could help me from the

experts, could it be from :
1)EFI Relay
2)EFI Fuse
3) the new oxygen sensor has two white wires, and the technician

connected them manually into the old connector coz i couldn;t find a

new o2 sensor with the same connector like the old one,so if the 2

white wires are swtiched

kindly note the following:
on the scanner the new oxygen sensor is reading numbers, its value

is changing
I know its complicated but you are the experts so please advise me

what it could be from and what to try to do ..
Thanks a lotttttt for your cooperation

Answer
Both codes are for the sensor that was replaced, the P0038 indicates a problem with the heater circuit of the sensor , my wiring diagram shows one black and one white wire for the heater circuit coming from the computer with the white being the negative side, the black wire is the signal voltage to the ECM and the black red wire is the B+ voltage and the red/black wire is the control voltage from the ecm for the O2 sensor heater, there is a possibility that the wires are not matched correctly.