sensor scale is half  of ADC scale - Page 1
Forum section: electronics / projects

author: HugoPT
author_rank: Contributor
timestamp: November 06, 2014, 11:15:49 pm
content: Hello friends.I have a current sensor ACS712 that gives me an output voltage from 2.5 to 5V.This means that @ 2.5V there is 0 amps and @ 5V 30 amps.Since my adc goes from 0 to 5V if I connect it directly I will loose half of the scale from my adc which will result in loss of precision.My idea was using an opamp with a gain of 2 to double the voltage.My question is, can I offset those 2.5V if I create a ref voltage in the non-inverting input?If yes how?Thanks for your time

author: nuno
author_rank: Frequent Contributor
timestamp: November 06, 2014, 11:40:57 pm
content: I think there's an unidirectional version of that chip (check Allegro), that's what you want.

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: November 06, 2014, 11:46:53 pm
content: i think if you put 2.5V in your µC VREF- if you have such option , you can get full scale ADCOr put 5V in your ADC input channel and the output sensor to VREF-, that way you don't have to add any voltage reference to your circuit, and your reading will be fullscale-adc_reading

author: Rick Law
author_rank: Super Contributor
timestamp: November 07, 2014, 04:56:32 am
content: Quote from: hamdi.tn on November 06, 2014, 11:46:53 pmThe OP needs to measure 2.5V to 5V, not 0 to 2.5V. So circuitry will have to be added to offset the 2.5V to shift the 2.5v to 5v down to 0V to 2.5V.The question is whether one willadd more error(with having to offset) than to accept the 1/2 scale of your ADC. Unless you design the offset and 2x multiplication (or 2.5V reference) carefully, you would introduce far larger error than 1/2 resolution lost.Say you are using an Arduino UNO (10 bit ADC), each count is 4mV for 5V scale. Double the resolution would mean each count is 2mV. Your x2 or -2.5V shift circuitry will need to be better than 2mV to keep your 2mV accuracy gain. 2mV accuracy circuit is no easy task. Typical 1% components will get you +-25mV for 2.5V. 25mV error is 12X the resolution gain you would get if you are using 10bit ADC. So, to decrease the ADC error from 4mV to 2mV, you added circuitry (1% components) that introduce a 25mV error?!I suspect you are probably better off using the upper half of the ADC. Think about it and see if what I just describe make sense to you. Perhaps there are other factors I failed to include.Rick

author: mikerj
author_rank: Super Contributor
timestamp: November 07, 2014, 04:47:15 pm
content: Quote from: nuno on November 06, 2014, 11:40:57 pmACS715 is a 30A unidirectional sensor, I have one on my desk in front of meA simple inverting op-amp with a gain of -1 and the non-inverting input tied to 2.5v will do what the OP wants, but it will invert the slope i.e. zero current will be 2.5v, maximum scale will give 0v. Obviously you need to think about the performance of the op-amp, input offset voltage and rail-rail output etc.

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: November 07, 2014, 08:19:49 pm
content: Am pretty much sure that you can have a full scale ADC without adding any thing or reducing precision just by using VREF- of you µC , i will test it as soon as i can, anyway , you can use a differential opamp and with a single amp you can add a x2 gain and subtract 2.5V offset. Use precision R-R amp

author: dannyf
author_rank: Super Contributor
timestamp: November 07, 2014, 08:24:46 pm
content: QuoteNo. It will result in loss of resolution, however.Those things are not terribly accurate so I don't know why you even want to go through the trouble of debiasing it in hardware.If I am concerned about errors caused by supply fluctuations, I would use a 2:1 divider on Vcc and use either two adc channels or a differential channel to null the bias.

author: Seekonk
author_rank: Super Contributor
timestamp: November 08, 2014, 11:23:50 am
content: Assume this is a hobby app. If this is not time dependent,take a couple readings and add them together to get bigger numbers. Least bit is just noise anyway. A couple samples will give you a useful number. Order emerges out of chaos. If you are set on doing this look at 715 data sheet, circuit #3. The note says tested with a 712.

author: Psi
author_rank: Super Contributor
timestamp: November 08, 2014, 11:38:37 am
content: Even the unidiretional version doesn't start at 0V. At zero amps its around 0.6V.

author: kxenos
author_rank: Frequent Contributor
timestamp: November 08, 2014, 12:29:24 pm
content: You need a difference amplifier:V2 is your positive and V1 is your negative.http://en.wikipedia.org/wiki/Operational_amplifier_applicationsBut you have to choose carefully for op-amp and resistors. As I believe you are not familiar with op-amps allow me to give you some hints:The output of general purpose op-amps doesn't swing up to power supply voltage. If you need to get 5V output from a general purpose op-amp you will have to supply it from a greater voltage. Else you need a rail-to-rail op-amp which will swing to almost it's supply voltage minus 1-2mV. A way around this is to set Vref to 2.5V and make your signal swing 0 to 2.5V. Then you can use any op-amp you like.Your total error should be less than half an LSB. For example if you have Vref=5V and 10 bits of resolution then it is 5/1024=4.88mV per LSB so your total error should be less than 2.44mV. That should include input voltage and current offset, bias current etc. To minimize these errors you should match resistors R1 with R2 and Rf with Rg. Try to run a simulation first.Good luck

author: mboich
author_rank: Contributor
timestamp: November 08, 2014, 03:14:31 pm
content: The inverting op amp, as suggested above works great, but keep in mind that the input impedance is then R1, rather than the impedance of whatever ADC you're using. I ended up using a second opamp channel to buffer my sensor in a similar situation.

author: Jeroen3
author_rank: Super Contributor
timestamp: November 08, 2014, 03:27:18 pm
content: Reverse the current sensor to set the range of the ACS from 2.5 V for 0A to 0 V for maximum current.Then connect Vref to 2.5 V.Please be aware of any limitation regargding Vref. Some chips do not allow Vref+ to be much lower than Vdd. And they will tell you not to connect Vref- to something 0.x volts above Vss.

author: nctnico
author_rank: Super Contributor
timestamp: November 08, 2014, 03:54:42 pm
content: Quote from: mboich on November 08, 2014, 03:14:31 pmFortunately the Allegro current sensors usually require a minimum load of 4700 Ohm. Still I think it is easier to just use half the ADC scale and oversample 4 or 16 times to shape the noise into the extra bits. The current sensors are noisy enough for that. There are also versions which output the reference voltage. If that gets sampled as well with the same ADC you can take care of the offset in software.

author: ejeffrey
author_rank: Super Contributor
timestamp: November 08, 2014, 05:03:49 pm
content: If you want to keep the signal non-inverted, make a standard gain-2 non-inverting amplifier, but connect the ground resistor of the feedback network to +5V instead of to ground. That will give you a gain of 2, but centered around 5V. The standard caveats apply: offset and gain errors in the amplifier add to your error, and a 'rail-to-rail' opamp can't actually go to zero volts so you may have problems near zero signal.

author: dannyf
author_rank: Super Contributor
timestamp: November 08, 2014, 05:05:41 pm
content: All this complexity is trying to solve a problem that doesn't exist.

author: Seekonk
author_rank: Super Contributor
timestamp: November 08, 2014, 08:23:26 pm
content: DUH....The app note gives all the components to do exactly what he wants.