Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

light sensor

Status
Not open for further replies.
Hi everyone,
I wanted to make a parking system.The system will count the number of vacancies left in the parking.I want to sense the entry or exit of cars with an LDR and LED shining on it.
I've made the circuit as shown in the attached image,one for the entrance side and the other for exit side.The outputs goes to the microcontroller.The system is working fine(still on breadboard).
The problem I am facing is that I have to change the 100k resistor as per the ambient light.Is there a way to overcome this difficulty.
Thanks
 

Attachments

  • 03122010496[1].jpg
    03122010496[1].jpg
    956.7 KB · Views: 262
Hi everyone,
I wanted to make a parking system.The system will count the number of vacancies left in the parking.I want to sense the entry or exit of cars with an LDR and LED shining on it.
I've made the circuit as shown in the attached image,one for the entrance side and the other for exit side.The outputs goes to the microcontroller.The system is working fine(still on breadboard).
The problem I am facing is that I have to change the 100k resistor as per the ambient light.Is there a way to overcome this difficulty.
Thanks

The usual way is to rapidly switch the light source, so that the receiver gets an 'AC' type signal, the OPA needs to be AC coupled.
 
You can also enclose the detector in a tube aimed at the LED to limit the ambient light it sees, and use a dark red color filter in front of the detector (assuming you are using an IR LED) to block additional ambient light.
 
Thanks everyone for replying.
Actually I thought of using a laser as birdman said,the intensity of which will outweigh the ambient light,but as I am not an expert in electronics I want to experiment with new circuits and learn something new.
I like crutschow's idea of enclosin the detector in a tube,but I want to do it by using some electronic circuits(the "electronics way".):)

@crutschow. I dont understand what kind of filter you mean to say,can you plz explain

As eric said,i need to apply AC type signal,and at the detector I allow only AC signal to pass through.I can generate the pulse type of signal using 555,the problem is how to make a detector.
Can anyone plz help me in that direction.:)
 
Thanks everyone for replying.
Actually I thought of using a laser as birdman said,the intensity of which will outweigh the ambient light,but as I am not an expert in electronics I want to experiment with new circuits and learn something new.
I like crutschow's idea of enclosin the detector in a tube,but I want to do it by using some electronic circuits(the "electronics way".):)

@crutschow. I dont understand what kind of filter you mean to say,can you plz explain

As eric said,i need to apply AC type signal,and at the detector I allow only AC signal to pass through.I can generate the pulse type of signal using 555,the problem is how to make a detector.
Can anyone plz help me in that direction.:)

hi,
The output of the pulse receiver would drive a re-triggerable monostable, which would always be set while the beam is not broken, by varying the set period of the mono you have some reduction in beam break errors due to birds etc.
 
So I keep the circuit which I have made as it is and conect its output to trigger a monostable multivibrator?
Suppose the frequency of light falling on LDR is 1k.So I keep the pulse width from monostable multivibrator as say 1.2ms.So the 1k pulses will keep the monostable in the unstable state,and when the beam is broken(for some time),the output will return to stable state,and when this happens the controller is instructed to do the needful.
 
Light sensors can be tricky and require custom mounting/cleaning etc. Also they can easily be compromised by rain /snow, casual spiderwebs....bird droppings...u name it. It requires maintenance.

I'd suggest a Colpitts oscillator driving a flat coil placed on the ground where the vehicle will park. Thus ONLY large metal objects will vary the signal (metal detector style). In a proper parking garage, u can slightly bury the coil in the ground. Being of copper wire construction it can be driven upon and flexed. This will work indoors or outdoors.

Colpitts Oscillator

Metal Detector Circuit

Detection of Bicycles at Demand-Actuated Traffic Signals

In order to respond to the metal proximity....use a freq. tuned OPamp bandpass....so that the Opamp output goes up when the correct freq. is achieved to switch your indicator etc.
 
@crutschow. I dont understand what kind of filter you mean to say,can you plz explain

As eric said,i need to apply AC type signal,and at the detector I allow only AC signal to pass through.I can generate the pulse type of signal using 555,the problem is how to make a detector.
The filter is a piece of dark red plastic that transmits IR but blocks most visible light. They are often built in front of the detectors on IR remote receivers in TVs, DVD players, etc. Some remote controls also have them in front of the emitter, but that's just for aesthetic reasons.

Detectors for 38kHz IR are common such as this since that is a typical frequency for IR remotes.
 
So I keep the circuit which I have made as it is and conect its output to trigger a monostable multivibrator?
Suppose the frequency of light falling on LDR is 1k.So I keep the pulse width from monostable multivibrator as say 1.2ms.So the 1k pulses will keep the monostable in the unstable state,and when the beam is broken(for some time),the output will return to stable state,and when this happens the controller is instructed to do the needful.

hi,
I would look at this option, using a dual OPA, IR emitter/detector at a nominal 38kHz.

Use the IR filter and collimator tube as suggested.
A short length of PVC 25mm dia water pipe makes a good tube.

Set the mono period to suit you application.
 

Attachments

  • AAesp06.gif
    AAesp06.gif
    43.9 KB · Views: 150
Last edited:
Here's a prepackaged 38kHZ receiver module for $0.85:

IR DETECTOR MODULE | AllElectronics.com

That Sparkfun part is 8mm X 3mm, pins are 1mm apart. Not easy to hook up.

Use a 555 (with stable RC parts) to generate the 38kHZ transmitter pulses fed to some IR LEDs.

You'll be done for $10 tops.
 
hi,
I would look at this option, using a dual OPA, IR emitter/detector at a nominal 38kHz.

Use the IR filter and collimator tube as suggested.
A short length of PVC 25mm dia water pipe makes a good tube.

Set the mono period to suit you application.

Thanks Eric for making the whole circuit in a simulator,thereby giving me your time,but I have a little problem in understanding some part of the circuit.I have placed that part in the red box.Can you plz explain that part.
 

Attachments

  • AAesp06.gif
    AAesp06.gif
    243.3 KB · Views: 176
Thanks Eric for making the whole circuit in a simulator,thereby giving me your time,but I have a little problem in understanding some part of the circuit.I have placed that part in the red box.Can you plz explain that part.

hi,
As you can guess the output from the Photo diode will be affected by the ambient light.
That section of the circuit is called a 'slicer', what it does is R3 and C1 charge with a rough DC voltage proportional to the detected pulse signal and the ambient light level.
The action of the circuit is to keep the threshold of the 2nd stage [ comparator] automatically adjusted.
It would also be possible to AC couple the photo diode.

I would use a LM358 dual OPA, dont consider a 741.!!
.
 
Last edited:
The way I am getting is as follows,plz let me know if I am wrong.
1)The voltage from the potential divider of LDR and R7(=100k) is some DC level plus AC.The AC need not be squre wave.
2)The output from the opamp(U2) is an amplified version of that signal,again AC +DC.
3)The opamp U1 is openloop configured so that it will work as a comparator.We are getting some rough DC signal by using R3 and C1.The other signal to opamp is directly from the first opamp through 4k7 ohm resistor.Based on the signal level the opamp will switch states and give the desired frequency.
 
The way I am getting is as follows,plz let me know if I am wrong.
1)The voltage from the potential divider of LDR and R7(=100k) is some DC level plus AC.The AC need not be squre wave.
2)The output from the opamp(U2) is an amplified version of that signal,again AC +DC.
3)The opamp U1 is openloop configured so that it will work as a comparator.We are getting some rough DC signal by using R3 and C1.The other signal to opamp is directly from the first opamp through 4k7 ohm resistor.Based on the signal level the opamp will switch states and give the desired frequency.

Thats basically it, the continuous 38kHz pulse train from the output of U1 keeps the 555 retrig mono from timing out.

If the beam is broken then the pulses to the 555 retrig mono stop and after a delay the 555 output changes state, you have to use that 555 output state as the signal to drive an external alarm.
 
Again few questions:)
1)What is the use of R1 and R4?
2)Just for the sake of knowledge,what could be the maximum frequency which can sensed by LDR,because I think LDR needs some time to switch from one resistance to another.
3)Why do we use frequency of 38k?is it because of some sort of optimization or is it used so widely that it became a kind of standard?
4)LM358 is used just because it is dual opamp in a single chip or it has some other advantage?
 
Again few questions:)
1)What is the use of R1 and R4?
R4 sets the +inp of U1 at a quiescent +V threshold level.
R1 is in case you use a LM393 or other open collector type comparator.

2)Just for the sake of knowledge,what could be the maximum frequency which can sensed by LDR,because I think LDR needs some time to switch from one resistance to another.
The switching rate of an LDR could be a limitation.
I have suggested a photo diode/transistor.


3)Why do we use frequency of 38k?is it because of some sort of optimization or is it used so widely that it became a kind of standard?

The 38kHz is a 'standard' for remote controls.

4)LM358 is used just because it is dual opamp in a single chip or it has some other advantage?
Its a dual OPA so the pcb area usage is reduced also it can swing 'close' to 0V output.

hi,
Some answers,
 
So,right now I am having no difficulty except for two,about R6 and R4.So can u plz explain more about the two resistors

I have already explained the purpose of R4, it give a positive voltage bias to the non inverting input of U1, so that the quiescent state of the U1 output is high.

Regarding R6, as I have no idea which combination of U2 and U1 OPA/comparator types you plan to use, its there to limit any possible damage due to excess current input to the inverting input of U1.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top