Measure a resistance, then send it a few meters for an ADC - Page 1
Forum section: electronics / projects

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 16, 2014, 02:49:28 pm
content: Hi guys..Firstly:Currently I am measuring the reistance (and thefore tank level) of a fuel tank sender (which swings ~10-180 ohms) by using a 3v3 biased potneital divider pulled up via a 560 ohm reistor.This circuit is in the controller, around 5 meters from the sender, and as such the voltage drop is so low that I am losing resolution/noise etc and having a naff signal.so, and correct me here if there is a better way, is to have a second board next to the sender (analogue only at this end) and read it, opamp it, etc etc and send back a decent 'ranged' signal...Supply is 12 or 24v DCI was thinking an opamp and a second resistor (as a current measure type setup) but what about the heat etc, is there a 'good' way of doing this?For the other end just a simple opamp to drop it by 6x will bring it into the right domain.For transmisison, I was thinking also about a differential 'sending' strategy to increase noise immunity.As always, I am at the mercy of the technical excellence of the EEVbloggers!!MattPS Another thing to 'work around' is the supply voltage may wobble about (its on a car/van afterall) and so would it be better to send a clean 10v supply out from the controller at the front (in the cab) and down to the level sender?

author: tszaboo
author_rank: Super Contributor
timestamp: July 16, 2014, 05:02:58 pm
content: If the wire resistance becomes a problem when measuring an resistor, the first thing you should try is a four wire measurement. With the 4w, two wire is where the current goes called "force", and two is connected to your measurement circuit (opamp buffer, INA) so the current on these wires are almost nothing, these are called sense wires. One-one force and sense is connected together at the measured resistor.

author: Alexei.Polkhanov
author_rank: Frequent Contributor
timestamp: July 16, 2014, 05:29:23 pm
content: 4 wire is very good solution for resistance measurement indeed. I think it is only practical to use if sensor is 1-2 meters away from controller, for transmitting measurement over longer distances in industrial control systems 4-20 mA current loops usually used. 4-20 mA / 24v is an industry standard so you can find plenty of other components like PLC etc. that will work with it. Here is an example:http://electronicdesign.com/components/4-20-ma-loop-powers-temperature-sensor

author: f5r5e5d
author_rank: Frequent Contributor
timestamp: July 16, 2014, 08:10:31 pm
content: more info would help - what accuracy, do you have offset, gain trims in the controller/meter?for instance 1% is likely greater accuracy than any float + potentiometer/rheostat mechanics - so even a Ohm of wire and connector resistance wouldn't be a real problemwhat is the ADC/meter range - its good to make your signal fit over a large fraction of the rangeratiometric measurement can help with noisy reference, cheap uC integrated ADC using its own supply rail for Vref or a low precision internal Vfrefcreating a current source from the ADC Vref, that ran thru the sensor R gives a output Vrange of 80-90% of the ADC/meter range would be my 1st try if the power rating is OKless current may be recommended by the sensor manufacturer - then use the max, amplify the signalshielded twisted pair is the default wiring for rejecting environmental noise at low frequency

author: Rerouter
author_rank: Super Contributor
timestamp: July 16, 2014, 08:42:58 pm
content: Its odd to hear that only 5m of wire is altering your reading that much, (yes and the return path through chassis) as i am an automotive instrumentation tech, and just about every bus under the sun uses that length or more (though VDO gauges tend to use a 275 Ohm pullup)The differential approach is a decent one, as normally the shared return path can mean the reading increases / decreases depending on other currents flowing (grab a multimeter and measure with the vehicle off vs the vehicle running, its not uncommon for this to swamp most of your reading)However with your differential circuit, be aware these chassis voltage drops can cause your return sense line to be a few volts below your measuring circuits ground, and some protection will need to be planned, (Cranking and load dump are the key offenders, but there is also the chassis ground strap that can loosen over time)And finally on sending a regulated 10V to the sender, to stabilise it, i would caution it, as i have commonly seen devices cooked when an auto-electrician grabbed his favorite 10W test light and started poking wires, be it 12V or 24V your regulator will not be happy with it,

author: Jeroen3
author_rank: Super Contributor
timestamp: July 16, 2014, 11:16:03 pm
content: Isn't this an examplary case of why vehicles use CAN bus?

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 17, 2014, 08:18:52 am
content: Cheers for the feedback chaps...I was thinking have a lowcost ADC at the sensor end.The accuracy need not be very much, it is for reporting tank level in a more comppex system but it is only for driver information, and thus, not a requirement of the system per se.I think using a 100ohm pullup to line level may be the best option (at the controller end) and then sinking through the sensor to ground, then take that centre signal through a unity gain opamp to create something for a potential divider to drop it down into the correct realm for the ADC.However:Currently, using a 3v3 pullup through approx 200ohm we were seeing around 1v change from full to empty, so noise was making the tank level switch about (ground offset stuff) - If I send 2 lines for the sensor, out and return, and use a higher voltage pullup but with 100ohms worst case current is ~240mA so power dissipated by the pullup is going to be 5 Watts?? Is there not a 'better' way - over this massive heat loss in a pullup? Yes use a lower voltage, but then I get more noise right?I am sure I am missing something - why could they use a 10k pot in this tank rather than a 180ohm wire resistor!Look forward to some light on this....Matt

author: mikerj
author_rank: Super Contributor
timestamp: July 17, 2014, 09:29:26 am
content: You could simply drive the sensor with a constant current. This will improve your resolution, noise and power dissipation.e.g. With a constant 18mA drive:Tank full = 10 Ohms, 10*0.018 = 0.18vTank Empty = 180 Ohms, 180*0.018 = 3.24vIf the current is derived from a 12v supply then worst case dissipation = (12-0.18) * 0.018 = 0.212 Watts

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 17, 2014, 10:07:19 am
content: Quote from: mikerj on July 17, 2014, 09:29:26 amMike thats a good idea - something I completley overlooked...Where I find such a device? Looking at CC drivers on farnell does not yeild much - wil lkeep looking though

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 17, 2014, 10:12:26 am
content: This looks the kiddyhttp://uk.farnell.com/linear-technology/lt3092est-pbf/programmable-current-source-0-2a/dp/2295469I will set it to 10mA to also suit 24v as required, then use an opamp to transmit an approx 5-20v swing single...lots of range which can then be divided down for the 0-3v3 ADCWhat do you guys think?

author: mikerj
author_rank: Super Contributor
timestamp: July 17, 2014, 01:17:02 pm
content: I don't really see why you need to use the op-amp to increase the voltage swing? The current source would be used at the end where the ADC is, and you would set the current to maximise your resolution over the range of the sensor. The optimal current setting would be different between a 12v and 24v system provided the same sensor is used, but you do need to consider power dissipation in the current source.You will also need to provide protection in case of an open circuit sensor at the tank end, in which case the output of the constant current source would be close to the supply voltage. A simple zener or bunch of silicon diodes in series might be adequate, otherwise consider an active clamp.It's pretty simple to roll your own current source, using either discretes, an op-amp or an integrated voltage regulator (look in the apps notes of an LM317 datasheet). The device you found is a fairly high precision current source, probably overkill for the application but would work providing the temperature rise isn't too high for the power dissipation.

author: JonnyBoats
author_rank: Regular Contributor
timestamp: July 17, 2014, 03:12:57 pm
content: TI has a chip for this. You might like to take a look atAutomotive Resistive Pressure Sensor Interface Reference Designhttp://www.ti.com/tool/TIDA-00150?sp_rid_pod4=OTY5NjMzOTMyMDIS1&sp_mid_pod4=46478015Of course this may be overkill if you are only doing a one-off.

author: Alexei.Polkhanov
author_rank: Frequent Contributor
timestamp: July 17, 2014, 06:06:21 pm
content: Quote from: mtechmatt on July 17, 2014, 10:12:26 amI see there is a strong desire to reinvent the wheel here...In my opinion it always makes sense to stick with standard4-20 mAstandard unless there is a good reason not to do so - this way you can take any off-the shelf display, plotter or controller and simply hook it up without worrying about the signal incompatibility.Example:http://www.ebay.com/itm/Dual-Channel-4-20mA-Current-Signal-Generator-0-10V-Voltage-Generator-Transmitter-/251289292443?pt=BI_Control_Systems_PLCs&hash=item3a82024e9bAnd here is ADC for you:http://www.ebay.com/itm/PHOENIX-CONTACT-MCR-ADC-8-I-4-MSTB-2786416-CONVERTER4-20MA-8BIT-24V-DC-D205904-/290923577086?pt=BI_Control_Systems_PLCs&hash=item43bc657efeThere are 10-50 mA current loops as well but they are less common.Wiki:http://en.wikipedia.org/wiki/Current_loopI have attached a doc for some info.

author: Kevin.D
author_rank: Frequent Contributor
timestamp: July 17, 2014, 07:23:34 pm
content: Quote from: mtechmatt on July 16, 2014, 02:49:28 pmHi there . Maybe I am missing something but I can't see why your needing any extra hardware .The voltage drop on cable run is proportional to the current flowing through it ,so if your measurment input impedance is very high compared to cable resistance which can't be more than a few ohms then your signal loss is tiny.So let me see if I read this right , there is power supplied locally at your sensor via some resistor then to a 10-180 Ohm variable resistor (sensor)which goes to gnd .So if top resistor is 1k and Vsupply is 12V then output from this divider will be ~ 120mV -2.1V .Then you would just run a single 5m wire from this to input of your adc with a LP filter on the input ,which say has an input impedance of 100K ,where is the signal loss your reffering to .?Quote from: mtechmatt on July 16, 2014, 02:49:28 pmThere shouldn't be any noise problem , the bandwidth of a fuel tank is measured in hours/days so you dont need any fast sampling ,so If you put a large RC lowpass filter on your adc input with a Break Frequency =>1 second or so (100k+2u2) then any HF noise will be dealt with ,that's the only extra hardware you need to add to your adc.As for the V supply variation affecting your reading then if your adc is already sampling your battery Voltage locally . then you would just include that in your software Rsense value calculation to get rid of error . So rearanging standard resistor divider formula to give RSense=Rtop*Vout/Vsupply-Vout .Regards

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 17, 2014, 08:37:38 pm
content: Quote from: Kevin.D on July 17, 2014, 07:23:34 pmCheers for the detialed reply (and to others above)The issue is with only a 560ohm bias we are getting a swing of only 1v at the ADC end, with fluctuations, with the engine running. turn the engine off and the voltage may just change to 0.7v (so 0.3v of 'noise'. This is with the sensor being powered by the 3v3 reg on board the controller.I think in retrospect the local earthing of the tank sensor (then back through the chassis) rather than an earth return, is what gives the noise we see...However... whats the power dissapation of the tank or our 1k resistor going to be at 12 or 24 volts P=I2R or am I applying things incorrectly?V=24vie P= I^2 * 1010 worst case (sensor at 10 ohms) on the 1K resistor is going to be ~600 mWStill seems like a lot of wasted energy - as I said completly open to the idea I am missing something here?Cheersmatt

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 17, 2014, 08:44:11 pm
content: Quote from: mikerj on July 17, 2014, 01:17:02 pmMike,Interesting, and it relies on the consistency of a current loop essentially, which cant be bad...If I were to use say a 3v4 zener reverse biased to ground before the ADC input, that would then shield the inout and load the current source enough to keep its voltage down, if I am not mistaken?

author: max_torque
author_rank: Super Contributor
timestamp: July 17, 2014, 10:37:09 pm
content: Something smells here!I can't see that you current wiring layout is a particular issue tbh! If you're getting different grounds or different Vccs then you are still going to get those regardless of your signalling system! The short wire to the sender isn't long enough to be an issue, and even with just say a 10b ADC, a 1v swing (with a 3.3v ref) is 310 "counts" between full and empty. So for say a 65litre tank, that's a resolution of 0.21 litres! And of course, because you want a VERY slow low pass filter (hardware first then a software filter) on the result (to avoid "slosh" readings, you can easily oversample a couple of times to more than double your resolution easily.I'd be getting the multimeter out to understand the issue before i completely re-engineered the level sender!

author: Kevin.D
author_rank: Frequent Contributor
timestamp: July 18, 2014, 12:27:57 pm
content: Quote from: mtechmatt on July 17, 2014, 08:37:38 pmThen size the top resistor according to your supply voltage ,increase it for 24 V supply ,and make it as Large as you can depending on what the lower limits of the input range to your adc is acceptable Vs power dissipation . I only gave 1k as an example ( max dissipation at 12V would then be ~140mW) .Alternatively If you really want the bigger output range but you keep the power dissipation low moving from 12V to 24V without changing any values ,then use somthing like a 7805 reg on the Vsupply to the sensor . Then use say 470R top resistor for your sense divider ,which would give you a max total power dissipation of (including regulator dissipation ) of ~ 120mW at 12Vsupply or 240 mW at 24V ,and an output range swing of ~ 100mV -to 1.3 V .One advantage of this is that you now no longer have to factor in any Vsupply variation .

author: mikerj
author_rank: Super Contributor
timestamp: July 18, 2014, 02:02:18 pm
content: Quote from: Kevin.D on July 18, 2014, 12:27:57 pmA constant current wouldn't use any more components and also gives supply insensitivity but with the advantage of improved resolution.

author: Rerouter
author_rank: Super Contributor
timestamp: July 19, 2014, 09:05:27 am
content: Here is your solution, The op amp can be at either end, and will not care at all about ground noise, the only requirement is to send out a nice low impedance voltage reference slightly above the amplitude of the noise (1V is a number i pulled out of the air, but this also lets you avoid the inaccuracies of your adc / op amp towards ground)I'm going to guess most of the people on this thread have not ever seen this tweak for a differential op amp setup.

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 20, 2014, 11:17:34 am
content: Nice thanks...Just thought of another one...OPAMP to make a Sq.wave osc with freq based on level... send it down and average it...Thoughts?