I need to operate from 5V.
When I use an op amp when in ambient light the output led goes dim not giving 5V or 0V. I used a hysteresis too but still the problem is there.
Without looking at the Op Amp's data sheet, I suspect that the Op Amp does not switch to a low enough voltage to switch the transistor off. That's why I suggested you use an N channel MOSFET in a previous post.
Here is the circuit i replaced LM358 instead of 741.
http://www.uoguelph.ca/~antoon/circ/sensor2.htm There is no hystersis in this circuit. You need a resistor from the output of the Op Amp to the + input. But it won't operate at 5 Volt.
But this 555 circuit the led wont dim its giving 5V or 0V.