I built a circuit using RPR220 photo sensor to detect the surface displacement caused on a material when external force is applied. I could see the output on a CRO even when there are minute changes on the surface for little forces applied.

Now the issue is, the output of the sensor is very low (appr 0.20mA) and for a maximum surface displacement I could see the change in the output varies between .18mA till .22mA. (the changes in the voltage is also in the milivolts range).

I used a current amplifier circuit that boosted the signal upto 100mA but still the changes in the surface resulted in minute variations at the output (the output varied from 96mA to 102mA).

How can I light an LED whenever there is a change in the average current/voltage value? Is there any logic gate IC that I can use in such a way that even if the signal fluctuates 100mA the output logic is set to one and the LED lights up?

P.S. The sensor was placed at a distance of 6mm from the surface.


Since you only care about deviations from recent "average", what you want is a high pass filter. This also eliminates the large DC offset you have on your readings, and allows you to amplify the differences without amplifying this DC offset along with it.

You have to decide how long "average" takes. In less hand waving terms, this means you have to decide which frequencies you care about deviations in, versus the frequencies you consider the "average" to be. Once you decide that, you put a high pass filter in the signal path with a rolloff of frequency between the two ranges.

The rest is then deciding whether the variates are above some threshold or not. This can be done with analog electronics, but doing this digitally in a microcontroller will take less parts, be more accurate, and provide greater flexibility in trying different things. It also make it easier to produce a "changed" output that persists for some minimum time, perhaps some hysteresis, or whatever other non-linear manipulations might be useful for this particular instance. You could even do gross high pass filtering externally, then more accurate high pass filtering at a higher frequency digitally. Lot's of things are possible.

| improve this answer | |
  • \$\begingroup\$ oi60.tinypic.com/2hf3uh5.jpg this is a sample of the signal i receive for one particular force applied and the output from two sensors placed at different points. as you can see, the output frequency itself is in mHz. the maximum freq i get for the maximum displacement is around 1-2hz. this output (10 is taken at the photosensor (avg o/p current= 0.22amp o/p voltage varies from 1.704 - 1.915v). i used a current amplifier and the o/p at the emitter was 3.82-4.12 mamp \$\endgroup\$ – Raghu Apr 1 '14 at 7:53
  • \$\begingroup\$ the o/p(2) was connected to a HPF (r=820ohm, c=100uF) i observe some noise in the signal but the o/p(3) current and voltage values have fallen to a pretty low value.(o/p current =.16mamp, voltage=1.906v). For example, the max current req to light an LED is around 20mA, even though i increase the o/p current to a specific value lets say 15mA, when the sensor detects the change the current varies around maybe 14mA to 16mA. so i need the LED to light up when this change happens, not when the signal is constant. (sorry if my usage of words is not so clear but i hope you understand the problem) \$\endgroup\$ – Raghu Apr 1 '14 at 8:04

Why don't you try this circuit below?

Circuit to light up a LED using an opto-coupler

| improve this answer | |
  • \$\begingroup\$ The OP asked for a circuit that will turn the LED on or off based on small changes in a relatively larger current, and I don't see how your circuit will do that. The OP also stated that the current from the phototransistor was less than 0.25 mA. How do you expect to illuminate an LED with that current? \$\endgroup\$ – Joe Hass Mar 31 '14 at 14:09

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.