Thermocouples
Most Arduino learning kits start with this or similar.
But, it’s another situation of “don’t bother” for real applications.
I’ve had multiple modules act flaky due to bad board solder joints
I’ve had signals change value excessively with wire length
I’ve had noise issues that are tough to debug.
I’ve had thermocouples (even expensive ones) fail when mounted on a vibrating engine
Thermistors
These are an improvement over thermocouples, definitely more reliable, but still subject to noise and wire length sensitivities, as the analog signals are so small. A few good resources for selecting and measuring thermistors, if you must go this way, are:
https://www.vishay.com/en/thermistors/ntc-rt-calculator/
https://www.vishay.com/docs/33001/seltherm.pdf
https://www.electro-tech-online.com/tools/ThermPlotV2.php
Digital Temperature Sensors
These style are the preferred choice, for temperatures less than 175C. At ~$1 each, the accuracy is more than adequate, with a typical error of 1 or 2 degrees. My favorite is here. Other than the relatively low max temperature limit, other potential downsides are the limited packaging options, and the extra use of microcontroller resources. For packaging, someone on CruisersForum suggested to simply glue the TO-92 package into a (copper) electrical ring terminal. This looks the same way thermistors are made, and I will be testing soon, don’t see why it wouldn’t work as a convenient way to fasten to a machine. The temperature measured will not be the exact same as the machine, but this is a potential issue for most technologies, and correlations can easily be generated using a handheld IR sensor or any other preferred method.
IR Sensors
Speaking of IR sensors, I did experiment with an IR sensor board, which would have been a contact-free (no vibration), universal, cheap, and easy way of measuring Alternator case temperature. In theory.
But didn’t work out, with the usual issues of wire length (the i2c interface is not developed for long lengths), and more seriously, these are sensitive to ambient temperature. Thermal gradients across the device cause unacceptable errors, and in a engine bay, no way to avoid.
That being said, a handheld IR gun is essential for troubleshooting. Just use it at a stable temperature, or hope the compensation electronics are good.
Finally, a thermal camera is another good investment. I have the Compact Pro for Iphone, and it’s great for general use in engines and electronics debugging. One gripe is that it will not “zoom out” with a clear image as much as I would like, but for the money, I think it’s as good as it gets, and has paid for itself a few times.
Here’s an example looking at an OrangePi heatsink: