I want to convert a lamp condition to TTL level using LDR. When the lamp is on the logic from circuit is high (+5V) and when it is off the logic is low (0v). How can I build this circuit ?
Use a transistor.
Bias the transistor using Potential-Divider bias and use LDR as one of the arm of potential divider network. Use Vcc = 5V. Collector resistor = 10k. The output should be taken from collector.