The Oxygen Sensor (O2) has four wires. Two of these are connected to the sensor heating element and the other two are connected to the sensor. One of the heating element wires provides a voltage that must be high or equal to the battery voltage, while the other wire is grounded.
The Powertrain Control Module (PCM) gives a 0.5 volts reference signal to the Oxygen (O2) Sensor, although this voltage may vary depending on the oxygen content of the exhaust. The PCM also provides a ground to the O2 sensor. It should be noted that changes in oxygen content cause resistance to vary. As the resistance changes, the voltage supplied by the PCM is affected, so it can also change between 0.1 and 0.9 volts.
When reading of 0.1 volts is obtained, it means that the mixture is poor, and when this value is around 0.9 volts, it means that the mixture is rich. This voltage variation is monitored by the PCM and when the voltage is higher than normal, the code P0158 OBD2 is set.