see these links and circuits….
now i think you got the idea how to get automation for street lights….
now you need to program 8051 like this….
Monitor Photo diode out put if it is high then turn off the light (that is connected to any bit of any port you just have to set that bit low)
if Photo Diode’s out put is low that means it dark out now…. now turn that bit high which you set low in previous case it will turn ON the street light!!
it is simple write code for it and share here if you face any problem!!
Best of Luck!!!