As a final safety measure regarding some high wattage motors, I want to measure their temperature (either internal or surface) in live time so that I can automatically kill the power if it crosses a threshold. Temperature modules I am finding appear to be mainly for air or liquids; I don't know if there's anything out there to measure the surface of metals (surrounded by air). A couple examples I don't think would work are the DS18B20 and DHT22 modules.
Measuring motor temperature and either forcing a stop or limiting performance when it gets too hot is common practice. I have always used a simple thermistor. You should make it have intimate contact with the motor's metal either by using thermal paste or epoxy. Sometimes, you can put it in a small hole drilled in the motor mount.
The danger with motors getting too hot is the insulation melting off the very thin wires. So putting the thermistor as close as possible to the winding is important. With brushless motors you can sometimes get the thermistor inside and mounted right on the coils which is ideal. Although I think this must usually be done in the factory.
The thermistor datasheet should give you the resistance vs temperature curve. Being just a resistor, some external support circuitry will be needed.
First, you would need to know:
- which are the parts of the motor that heat most;
- which are the parts of the motor (or surrounding components) that can get damaged by the heat;
- which are the maximum temperatures involved;
- the cause of the heating: friction, EM effects, surrounding components...
This might require some serious skills and work. Ideally, the manufacturer of the motor provides you with some information.
Once you have that information, you can choose the strategy and components to alleviate the issue.
Otherwise, you risk cooling the already "cool" areas, while the heat still does damage to your project.
Temperature modules I am finding appear to be mainly for air or liquids
Well, that is for a good reason. To measure the temperature inside a solid, you need to drill a hole in that solid, to reach the desired "point". Or use some technologies (similar to X-rays, MRI, CAT scanners) which can see inside the solid without material damage.