The sensor that measures the boost pressure is called the MAP (Manifold Absolute Pressure) sensor - it is usually located between the intercooler and the inlet manifold, or the turbo compressor outlet and the inlet manifold in turbo cars without an intercooler
When you turn the ignition on, the ECU (engine control unit, the engines' digital "brain") reads the MAP sensor to measure the parometric pressure (this can change with air temp and altitude) to get a "base line" pressure reading. After the car is started, the MAP sensor reads the pressure in the section of boost hose the sensor is in, the turbo compressor produces this boost.
It gets a bit more technical here - the sensor itself is analog, and it changes its resistance depending on the pressure (so is a pressure- dependant variable resistor) a voltage is fed to the input of the sensor, and changes depending on the electrical resistance/ pressure
these changes in voltage cannot be read directly by the (Digital) ECU, and must be converted from analog to digital with an AD (Analog-Digital) converter, the AD convertor may require the voltage to be stepped-up, or stepped down this is done with a signal conditioner
The ECU omly "reads" the data fed to it so it cannot tell if there is a fault in the sensor, the wiring, the connectors, even a fault in the charging circut (battery/ alternator) can effect it as this can change the output voltage of the sensor
Conversly the sensor, connectors, wires, AD converter ECU etc, may be working perfectly, and correctly reading the "too high" boost pressure which may be caused by another fault - the most likely is the VNT mech getting jammed due to the build up of carbon
Ie - the VNT is getting jammed, causing the turbo to produce too much pressure - the sensor is reading this "too high" pressure correctly, if this is the case, replacing the sensor with a new one will produce exactly the same results (ive read this happening so meany times on forums- ive never actually explained why before)
Moral :- The fault code P0238 means "turbocharger boost sensor A circuit high" - it does not (nessesarily) mean the sensor is faulty, the sensor being faulty is one of the least likely reasons, of many.