Infrared sensor for online thickness gauge