Tag optical sensor