A smart way to measure infrared