Current sensor output modification. PIC or opamp or something else?
I have a hall effect current sensor with a 0-5V output. Zero current flow is 2.5V out.
It is monitoring a 20khz motor drive signal.
I want to pass thru signals from 0-2.5V unmolested but want to reduce signals over 2.5V by an amount lets call it 20%.
What could we do to do that?
I was thinking OP amps, but I can't think of way to only reduce the signal once it is over 2.5V
I also thought about a PIC with adc in and then a pwm out with low pass filter.
But I don't think it will do 20khz.
Any brilliant ideas? Thanks Peter
Re: Current sensor output modification. PIC or opamp or something else?
Hi, peter
why not use a TL431 or similar " zener effect diode " that will draw some current past 2.5v https://www.ti.com/lit/ds/symlink/tl...lsrc%253Daw.ds
the idea is a resistor paralled by the "zener" and a second resistor in series ... as the lower part of a voltage divider.
Now that's the raw answer to the question ...
IF your signal doesn't exceed the input range of the converter, it will be much much much simpler to apply a simple " IF conversion_result is > 2.5 THEN result = (result-2.5)/2 + 2.5 ...
the "2" divider being just an example ( might be /3*2 ... for / 1.5 )
Alain
Re: Current sensor output modification. PIC or opamp or something else?
Thanks for that.
Alain. When you say 'If conversion' do you mean using a PIC?
I didn't think that would be quick enough
Or some sort of analog circuit like the TL431
Re: Current sensor output modification. PIC or opamp or something else?
Quote:
Originally Posted by
retepsnikrep
Thanks for that.
Alain. When you say 'If conversion' do you mean using a PIC?
I didn't think that would be quick enough
Or some sort of analog circuit like the TL431
Hi, Peter
I wrote
Quote:
IF Conversion_RESULT
= the number the ADC returns ...
Whatever processor you use ( of course, a PIC is much better :rolleyes: )
Have a nice day
Alain
Re: Current sensor output modification. PIC or opamp or something else?
If you use your signal for regulation of something, ADC/DAC solution act like first order hold
https://en.wikipedia.org/wiki/First-order_hold
And it can cause instability in regulation.
So my advice would be OPAMP.
Circuit is not hard to make. You basically need 2 buffers and 1 compactor, few resistor, and that is it.
I can draw basic schematic, if you want...
1 Attachment(s)
Re: Current sensor output modification. PIC or opamp or something else?
An example schematic of your idea would be kind Pedja.
Thanks for responding.
I basically have this so far.
A potential divider activated by the MOSFET turning on and an non inverting unity gain opamp buffer.
When the mosfet is on output is reduced by the PD ratio R2 and R3.
R1 & R2 are out of my control in the equipment I am trying to modify.
Attachment 8967
1 Attachment(s)
Re: Current sensor output modification. PIC or opamp or something else?
You got most of circuit. I added one more buffer, so input to rest of circuit is low impedance. If you know your sensor output, you can omit first buffer.
Second OPAMP create comparator with hysteresis.
If input voltage excide trip point, output will be hi, so mosfet is turned on, and output voltage is reduced...
Attachment 8968
Re: Current sensor output modification. PIC or opamp or something else?
Hi, Pedja ...
you just redraw the TL431 !!!
http://www.bristolwatch.com/ccs/img2/TL431p.jpg
just have a look to its " OFF " state current ... : Off-State Cathode Current IK(off) VKA = 40V, VREF = 0 typ 0.26 max 0.9 µA
;)
Alain
Re: Current sensor output modification. PIC or opamp or something else?
Re: Current sensor output modification. PIC or opamp or something else?
Back to the original challenge, I'd do it in software:
Code:
IF ADC > 127 THEN ;Assuming 8-bit ADC
ADC_VAL = (ADC * 4) / 5 ;Yields 80% of value
ENDIF
The above snippet will deliver <128 results as soon as ADC > 128. I don't think that's what you want. So we have to add a filter:
Code:
IF ADC > 127 THEN ;Assuming 8-bit ADC
B0 = ADC - 127 ;Use a temporary variable to determine how much above 128 our result is
B1 = (B0 * 4) / 5 ;Get 80% of only the amount > 128
ADC_VAL = B1 + 128 ;Yields mid-point + 80% of overage
ENDIF