I have a circuit similar to the following:

schematic diagram

(Source: electronicsforu.com - Shadow Alarm: Light Sensitive Circuit)

In the circuit, the output from op-amp pin 6 goes low when a shadow falls or light is not present.

I am using this to find out if an obstacle is present or not and it can be done only this way, according to our constraints. The obstacle blocks the light and so the voltage from pin 6 goes low. These are moving obstacles with a certain width, so the light is blocked until the width passes and this width is constant. However we have smaller obstacles in the same line which we should ignore, based on the width.

In simpler terms, if the light is blocked (voltage is low) for only for 20 millseconds, then we have to ignore it. However if the light is blocked (voltage is low) for more than 40 milliseconds, then it is a valid obstacle. I have to do it only with hardware, not using functions similar to Arduino pulseIn() etc.

  • 1
    \$\begingroup\$ So you want a circuit that recognizes when a pulse is wider than 40ms but always ignores pulses narrower than 20ms? Is that the essence of your question? \$\endgroup\$ – Elliot Alderson Jul 7 at 19:24
  • 1
    \$\begingroup\$ @ElliotAlderson yes , a circuit that recognizes when the pulse is wider than a certain time and ignores if it is lower than that time \$\endgroup\$ – varchaswi gandham Jul 7 at 19:33
  • 2
    \$\begingroup\$ @JackCreasey these objects are pretty far from each other actually these are joints on a fabric that block the light to pass through , so can be 100 mts apart and i can choose the width of the joint to block, but on the fabric itself some tiny elements that can block the light which is a false trigger \$\endgroup\$ – varchaswi gandham Jul 7 at 20:06
  • 1
    \$\begingroup\$ @ChrisStratton Unfortunately, it's not that simple. You need logic to generate the output pulse from two timers. So conceptually possible (you could use two 555 timers) but much more complicated when you add together with the interface from the sensor. I'm not sure you will end up being very simple. Draw the schematic, if it does the job I'd certainly upvote it. \$\endgroup\$ – Jack Creasey Jul 11 at 14:27
  • 1
    \$\begingroup\$ @ChrisStratton If it's so simple then prop up the schematic. I'm certainly interested in your approach. The idea with the capacitor is intriguing, how will you stop it producing very narrow pulses that could be missed. At least in my solution you get a definite minimum pulse width out, which I viewed as essential. \$\endgroup\$ – Jack Creasey Jul 11 at 14:41

You only need one trigger point to be defined, you don't need upper and lower boundaries defined.
For your application any signal 40ms and longer creates an output and less than 40ms creates no output.

The circuit below is just an example of what you might do using conventional logic:

enter image description here

The logic is as follows:

  1. U1A provides a high or low signal to the shift register on its inputs A, B. If the photo transistor in illuminated, then the input to the shift register is low.

  2. U1B provides a clear signal to the shift register (U2) when powered up and sets all the shift register outputs to zero.

  3. With all the outputs zero the *Output of U3 is high.

  4. U4 is a 200Hz oscillator. (this could be a 555 astable if you like) The oscillator clocks the value of the A, B shift register inputs through the Q outputs.

  5. For any high (inputs A, B) input values below 40ms there will always be at least one zero bit in the shift register, so the *Output will always be high. If the input signal extends beyond 40ms then for at least one clock period the *Output will be low.

While this logic should work (I have neither simulated or built this), the task would be much better accomplished using a small single chip MCU.

  • \$\begingroup\$ I guess c1 acts as tank capacitor, i didn't get the purpose of d1 \$\endgroup\$ – varchaswi gandham Jul 11 at 5:38
  • \$\begingroup\$ C1 provides a power on delay on startup. D1 rapidly discharges C1 when the power is turned off. Any solution is built using standard 'blocks' of logic ….not sure what you expected. \$\endgroup\$ – Jack Creasey Jul 11 at 14:11
  • \$\begingroup\$ This is an absurdly overcomplicated way to address a very simple problem. \$\endgroup\$ – Chris Stratton Jul 11 at 14:12
  • \$\begingroup\$ @ChrisStratton If you think so ….then let's see your attempt NOT using an MCU. Put your knowledge where you mouth is. \$\endgroup\$ – Jack Creasey Jul 11 at 14:14
  • \$\begingroup\$ All they need is a 40 ms timeout timer with appropriate input/output sense, it gets reset before it can complete if the pulse is short, when the pulse is long it gets to run to completion and generate output \$\endgroup\$ – Chris Stratton Jul 11 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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