The oxygen sensors measure the oxygen content in the exhaust, then, they send that data to the PCM (Powertrain Control Module). The PCM uses the information provided by the sensors and regulates the fuel injector pulse.
The diagnostic code P0156 OBD2 refers to the Oxygen Sensor number 2 which is located in bank number 2. This sensor has four wires. The PCM provides a ground circuit plus a voltage circuit with a 0.5-volt reference. The other two wires are for the oxygen sensor heating element, one for the battery voltage, and the other for the ground circuit. The heating element helps the oxygen sensor heat up faster, and thus a closed loop can be made in less time than is usually required by the exhaust to heat the sensor to operating temperature.
The reference voltage of the Oxygen Sensor (O2) varies according to the oxygen content. This variation can range from 0.1 to 0.9 volts, when there are 0.1 volts, it indicates a poor leakage, and when there are 0.9 volts, it indicates a rich leakage.
When the DTC code is set, it means that the O2 is stuck for a certain time, it may even be inactive