How to detect the duty cycle of a laser pointer

duty cyclelaser

Our assignment is to design an analog parking lot access system. A laser pointer will represent the car, and an ID detector will check if the laser's duty cycle is 20%. I designed the circuit that will give the laser an input voltage in the square waveform with a duty cycle of 20%, and I was planning to design a detector that will detect the average energy of the laser, but since the laser will be a vehicle (which means it will be moving) the light energy that it will send to the detector will change with time, so the detector MUST check its duty cycle, not the average energy. This is the circuit that will generate a square wave with a duty cycle of 20%

This is the circuit that will generate a square wave with a duty cycle of 20%

The components we are allowed to use are:
+/-25 V output of DC power supply, any types of resistors,
capacitors, inductors, diodes, LEDs, LDRs, op-amps, transistors

So, any ideas on how to make a circuit that will be activated with an input that has a duty cycle of 20%?

Update:

Just wanted to let you know, thanks to your answers I managed to design something that works perfectly!

enter image description here

The LDR detects the laser and causes the first Op-Amp into positive saturation with the same duty cycle as the incoming laser, then it's low-pass filtered (thanks to @transistor and @helloworld922) and since the duty cycle I'm looking for is 20% I compared this value to see if it's lower than 3 Volts and greater than 2 Volts, and then summed the outputs of the comparators to see if both comparators are in positive saturation. I think this one should do quite well.

Best Answer

The first component you're going to need is some way to receive the laser signal. You say you have LDR's, so design a circuit which uses one of these and outputs some voltage level corresponding to the input light.

As you've stated, variable input signal strength is a problem. That seems to imply that you want something digital, where signals above a certain level are registered as "on", and signals below a certain level are registered as "off". Something like a 1-bit analog to digital converter would do this, so think of how you would design something like this. This will give you a consistent level for "on" and "off".

Once you have received the PWM signal from the laser into your circuit as a digital signal with a known level, just low-pass filter it until you get close enough to a DC level. The DC value gives a direct indication of the duty cycle because you've already removed the variable signal strength problem.

The last step is to detect if the correct DC value (a.k.a. duty cycle) has been received. Something like a window comparator should do the trick.

I'll leave the details of how to design each of these components to you. Feel free to ask questions if you get stuck on any of these.