Sensors and AI are finding their way into the barnyard