Yes. it's called a Freezestat. It's a temperature sensor with a long wire element that gets strung across the indoor coil. Normally they are used to lock out the compressor but you could use one as a sensor as well.
Coil freezing is caused by low Freon charge or leaks, dirty filters, dirty/clogged condensor (outside unit) coils, or system undersizing / excessively long run times. Basically anything that reduces the efficiency of the system causing it to run too long and keep the indoor coil too cold for too long. Also, if the condensate drain is clogged and water sits in the pan under the coil, that's generally where freezing starts.
Outdoor coils need to be maintained. Both the inside and outside of the assembly should be power-washed if clogging is suspected. I had a site with lots of trees that would generate pollen that would clog the coils in the spring. Clogged coils = no airflow = no heat transfer. The indoor coils will clog up if the filters don't get changed regularly. That's worse because it's harder to clean an indoor coil... they get blown out with nitrogen from a tank instead.