Connecting a thermocouple to an analog input

Basic Information:

MCU / Printerboard: SKR 1.4 Pro
Host / SBC Raspberry pi 3b+

Hello. I am trying to connect a K-type thermocouple to a 0.25 analog input using the lm358 module. Since printer.cfg cannot handle dynamic data, I created a script in the /home/pi/klipper/klippy/extras folder in python, but when initializing it in [extruder] an error appears “Unknown temperature sensor ‘CustomThermocouple’ Once the underlying issue is corrected, use the “RESTART”
command to reload the config and restart the host software.
Printer is halted”. I would like to know how to properly handle such situations and understand whether such an implementation is possible at all. Thanks in advance for your answer.
custom_thermocouple.txt (2.1 KB)

I cannot speak about your Klipper issue, but technically this approach will surely deliver something that somewhat resembles a temperature value:

  • Type K thermocouples are around 0.04 mV/°C.
  • Cold junction compensation?
  • Line noise compensation?
  • Offset drift of the op-amp?

If you just want a rough idea of the chamber temperature, that might work as long as you keep the junction thermally stable.
I wouldn’t call this a temperature measurement, though.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.