its 89C52 and doesnt have an ADC
ouch! your doing IR without ADC?!? why?!?!?!
looking at the pic, the ambient light isnt that
bad. ive done line following robots that follow a white line on a light grey background outside on a bright cloudless sunny day - and without any modulation. its doable.
the trick is to use more than one LDR, so that when placed on your bot, it is only possible for one of them to be on the white line at a time. if neither are on a white line, they should read about the same. but if one goes on the white line, the voltage will change on just one - a difference that can be detected with a comparator IC
if you are still concerned, there are other basic tricks, like cover your sensor area with garbage bags or other IR absorbing material so less IR light gets in.