I have been building a traffic light over the past year as a GCSE project. Initially, what was unique about it was that, the pedestrian interface would light up when it was dark outside. Subsequently, I added a qualitative counting system for drivers so they would know how long was left but couldn't jump the lights at 1 or 2 seconds.

Now to my current dilemma. Apparently, all of the above doesn't differentiate my project enough from the current model. So I thought, what if you no longer needed to press the light button. What if you could just walk up, and an input would register the movement and start the process. I thought about having a laser pointing at an LDR and when the laser point was obstructed by a person for example, the ldr would register this and start the cycle. Unfortunately, my chip only has 1 ADC pin, so i can't use the LDR. I was wondering if there was an input that could register this obstruction of light and then transmit to the chip.

Side Questions: Can a non ADC pin register an ldr Are there such things as infra red lasers e.g. a laser point which can't be seen to the human eye Can an optoisolator replace a normal PTM switch

EDIT: I have done some research and found something called a photo transistor which by my understanding could replace a switch. Is this a viable option?

  • 2
    \$\begingroup\$ A digital input can work as a crude comparitor. If the signal level is high enough it will turn on, etc. You don't need laser. A beam of light will do. A passive infra-red sensor has the advantage that it senses from one point (and doesn't need a transmitter) but may be swamped by bright sunlight. Your car drivers aren't going to be too impressed if the lights go red every time someone strolls past your sensors. And yes, infra red lasers exist and are used in CD-players and high-powered versions to cut plastics, timber and metals. \$\endgroup\$
    – Transistor
    Commented Feb 18, 2016 at 23:04
  • \$\begingroup\$ Yes, a phototransistor is much more common in sensing applications these days. \$\endgroup\$
    – Daniel
    Commented Feb 18, 2016 at 23:08
  • \$\begingroup\$ @transistor What is a crude comparator? I was going to introduce a procedure that the laser had to be blocked for around 10s before the sequence could start. I was wanting to use a laser as it is concentrated. \$\endgroup\$ Commented Feb 18, 2016 at 23:10
  • \$\begingroup\$ @Daniel Would a phototransistor easily replace a slot created for a push to make switch? \$\endgroup\$ Commented Feb 18, 2016 at 23:11
  • \$\begingroup\$ Which would be the better option. rapidonline.com/electronic-components/… \$\endgroup\$ Commented Feb 18, 2016 at 23:14

1 Answer 1


The LDR connected to a comparator (or opamp in comparator mode) can provide a simple make or break signal. On/Off. The below circuit is a IR Led and Photodiode Proximity sensor, and the LM358 compares the analog voltage at R2 with a Potentiometer RV1.

enter image description here

You could go with a better method, a digital ultrasonic sensor. It will provide a pulsed digital signal, and be much less susceptible to light reflections or anything, while having a greater distance. Bonus, it will give you a definitive distance.

enter image description here

  • \$\begingroup\$ Could you draw a schematic of the first idea? \$\endgroup\$ Commented Feb 18, 2016 at 23:35
  • \$\begingroup\$ i'm looking for a cheap and simple fix. I don't mind how well it works. Will a photodiode on its own work? \$\endgroup\$ Commented Feb 18, 2016 at 23:37
  • \$\begingroup\$ @HasanImtiaz without a source of IR, like an IR LED, no, a photodiode will not. It can't be turned on without a source. \$\endgroup\$
    – Passerby
    Commented Feb 18, 2016 at 23:39
  • \$\begingroup\$ What about a laser? \$\endgroup\$ Commented Feb 18, 2016 at 23:40
  • \$\begingroup\$ @HasanImtiaz depends on how sensitive the photodiode is to the wavelength/spectrum the laser produces, and how likely the laser reflects onto the photodiode. \$\endgroup\$
    – Passerby
    Commented Feb 19, 2016 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.