I am trying to read the thermocouple voltage of a Hakko T12 tip which has the heating element present in series with the thermocouple. The problem is that 24V DC will be present on T+/T- of the thermocouple when the heater is being powered. I have seen people get around this problem using OP amps that have overvoltage protection like the ADA4177. The problem with this is I want to have good temperature accuracy and that would mean that I would have to add an external ADC and also add cold junction compensation. Ideally I would like to use something like the MAX31855 which already does everything I want but I can't come up with a solution that would prevent 24V going to it and also maintain its accuracy. Would something like diode clamping work or should I be looking in another direction?
You won't likely be able to get a good reading with the heater on, so that means turning the heater off long enough to get a reading, then on again, which means you have to have a circuit that settles very fast and recovers from an overload very fast. If it's a K type thermocouple it will have maybe 10-15mV output at soldering temperature (and a tempco of +42uV/K roughly). If you ground the end of the heater that's connected to the thermocouple, you'll have a maximum signal of maybe +/-20mV wrt ground, and with the heater on it might go to a few hundred mV.
So, an op-amp circuit shouldn't be too difficult to deal with that, though it will have recover from overload fairly quickly. You could "blank" op-amp input by shunting it with an analog switch, which would make it settling time rather than overload recovery time. Use a low bias current op-amp and series resistance to protect the inputs.
The disadvantage of this is that the circuit will be sensitive to noise, because you won't be able to add an aggressive low-pass filter, but it should be do-able in a controlled situation like this one. Cold junction compensation requires you to know the temperature at the point where the thermocouple materials transition to copper.
Edit: If you have only two connections available you could do something like this:
In practice the half-bridge is going to need a bit more complex drive circuit to deal with 24V, but this is the concept. Getting accurate cold junction compensation will be almost impossible in this configuration unless the wires to the handset are actually dissimilar metals matching the thermocouple uV/K.
If your thermocouple really IS in series with a driven heater, the only way to get an accurate reading is to suppress the readout unless the heater drive is OFF (disconnected, hopefully). So, you'll want to sample the thermocouple voltage at special times, and either hold the analog value or latch the digital value.
Such all-in-one items as MAX31855 are not suitable, unless you use tricks like strobing the power supply, because they lack time-related cycle awareness. It is easier to use a microcontroller to control the sample/hold/convert and display functions, than to work around the timing problems. The 'linearization' and cold junction compensation features of the Maxim device, while useful for mass production, are easily implemented with some calibration work, using a forward-conducting diode (or B-C shorted transistor as a diode) to sense the temperature, and some easily calculated tables to translate to a number for the temperature display.
To keep the 24V away from your sensitive circuitry, simple diode clamps and resistors to current limit will be suitable; when power is OFF, a diode with less than 100mV applied is effectively infinite resistance, and a noninverting op amp amplifier can scale a thermocouple value (for something much hotter than room temperature) without much trouble.