inductive proximity sensor speed of detection issue

Thread Starter

Pushkar Nigam

Joined Jun 14, 2016
9
Hi guys i am a hobbyist electronic engineer trying to make an inductive sensor.
i have used the attached schematic and am successful in getting the change in the voltage on the output of the transistor but the soeed of detection is an issue for me.
At the moment the speed of detection about 3 seconds before the voltage settles.
Any help would be much appreciated on the topic

i am attaching the schematic for you guys in here
Thanks very much
 

Attachments

Thread Starter

Pushkar Nigam

Joined Jun 14, 2016
9
hi Albert.

The PIC is just providing the square wave and reading that ADC value. If you want to even eliminate the PIC for now you can . Just think that frequency is being sent by a function generator. The change in the voltage on the ADC pin is still very slow. I think it points towards the hardware. But still if you are suspicious i will be happy to share the the PIC firmware as well.
 

AlbertHall

Joined Jun 4, 2014
12,396
OK - If I understand this correctly then the ADC voltage falls when something is detected. On the output there is a 2M2 and 0u1 which has a time constant of 0.22S. For that to settle might take 10 time constants -> 2.2S and we are close to your 3 seconds. As an experiment try making the resistor lower, say 220K and see what happens.
 

Thread Starter

Pushkar Nigam

Joined Jun 14, 2016
9
yes you are correct the voltage output falls when something is detected. The resistor and the cap are a peak detector circuit actually as you can see.
I was measuring the change in the voltage on the output of the diode. It changes but slowly.
So i am inclined to think that the peak detector circuit is not the problem. but something else is.
Do i explain myself well?

I would be happy to answer more questions. Thanks for all the help
 

AlbertHall

Joined Jun 4, 2014
12,396
Let's assume that instantaneously the signal at the anode of the diode goes from some peak value, say 2.5V, down to zero and stays there. The ADC voltage will still be high and the diode is reverse biased. Then the capacitor will discharge slowly through the 2M2 resistor. When the opposite happens and the signal is restored the capacitor charges through the diode from the transistor - much lower effective resistance and hence much quicker.

Change the resistor and see what happens.
 

RichardO

Joined May 4, 2013
2,270
The resistor size is limited by the input current of the PIC. If you use too large a value, the input current flowing through the resistor will create voltage that is far from being zero volts. For example, the maximum input of your PIC is 1 ua. Ohms law says that 1 ua flowing through a 2 Meg resistor will cause the resistor to drop 2 volts. :eek: Note that the current is typically "only" 0.1 ua -- but that would still be 200 mv across a 2 Meg resistor. :(

Microchip recomends that the source impedance be 10 K ohm or less for an A/D input:

7.9 A/D Acquisition Requirements

For the ADC to meet its specified accuracy, the charge
holding capacitor (CHOLD) must be allowed to fully
charge to the input channel voltage level. The Analog
Input model is shown in Figure 7-1. The source
impedance (RS) and the internal sampling switch (RSS)
impedance directly affect the time required to charge the
capacitor CHOLD. The sampling switch (RSS) impedance
varies over the device voltage (VDD), see Figure 7-1.
The maximum recommended impedance for analog
sources is 10 kΩ. As the source impedance is
decreased, the acquisition time may be decreased.
 

AlbertHall

Joined Jun 4, 2014
12,396
For example, the maximum input of your PIC is 1 ua. Ohms law says that 1 ua flowing through a 2 Meg resistor will cause the resistor to drop 2 volts
The PIC input current doesn't flow in the 2M2, the resistor is in parallel with the PIC input. The input current will change the time constant but that is all.
 

Thread Starter

Pushkar Nigam

Joined Jun 14, 2016
9
i think i agree with Albert here. the resistor is parallel to the PIC as ADC input is going back to the PIC pin.

Albert,
I am going to try out the resistor today and let you know how i get along

Thanks guys! :D
 

RichardO

Joined May 4, 2013
2,270
The PIC input current doesn't flow in the 2M2, the resistor is in parallel with the PIC input. The input current will change the time constant but that is all.
I respectfully disagree. If the input leakage current of the ADC does not flow through the 2.2 Meg resistor then where does it go?
 

kubeek

Joined Sep 20, 2005
5,796
Also with such a high impedance as 2M2 the leakage of that diode might start to be significant, especially if it is a schottky. A larger cap, say 1uF and a lower resistor, say 220K would mitigate these issues.
 

AlbertHall

Joined Jun 4, 2014
12,396
Also with such a high impedance as 2M2 the leakage of that diode might start to be significant, especially if it is a schottky. A larger cap, say 1uF and a lower resistor, say 220K would mitigate these issues.
This will leave the time constant the same, which is the original problem.
 

Thread Starter

Pushkar Nigam

Joined Jun 14, 2016
9
hi richard,

if you think it is the problem then can i request you to explain it in some way once again. I think me and Albert are not following it.
 

Thread Starter

Pushkar Nigam

Joined Jun 14, 2016
9
guys i am more concerned with the output on the transistor into the diode

detection - 2.7 volts
no detection - 2.9 volts
and this takes a lot of time to settle . I think the problem her can be the capacitor (c2) on the input of the transistor. will the change in value of this affect the circuit in a better way in terms of setting time
 

AlbertHall

Joined Jun 4, 2014
12,396
The LC circuit L1/C3 is resonant at about 230kHz. The PIC is supplying the square wave input. Are you relying on the FOSC4 signal or do you have code to generate the signal. Have you checked what frequency that is?
 

Thread Starter

Pushkar Nigam

Joined Jun 14, 2016
9
hi Albert ,

Yes i have checked the frequency on the PIC itself i am giving it the right frequency. I had first written the code depending on the FOSC 4 signal as i had used capacitor and inductor values that provide the near frequency to the resonance frequency.
I then moved to freq generator because i thought that might be the problem in this case.

Also i might have a question on that. What do you think might be the implication of using a different resonance components? Do you think it would change range and speed of detection? I am putting it out as a question first and then i would like to share my findings.
Let me know your thoughts on that.

Thanks a million Guys !
 
Top