Maker Pro
Maker Pro

convertin an output current range into a non-linear voltage range using load resistor

I have zero electronics experience and I am looking to be pointed to a tutorial that might explain some relevant principles and concepts that would help me with my problem.

I have boards which use senors which provide a variable current to the board. The board converts this current to a variable voltage through a load resitor using a digital potentiometer (which I understand affects the range of the output voltage) and I have software which enables me to adjust the load resistor from 39ohms to 10k ohms and to read off the now output voltage in digital form. I am getting very little support from the people who sent the boards and the software.

So far my settings of the load resistor have produced a non-linear relationship between the input current to the board and the output digital voltage to the software ( I guess it may be right that this is non-linear (perhaps it's linear within a certain range?) ), but because I have no idea about the relationship in principle between input current load resistor ohms setting and (digital) voltage output, I have no way to know what best value of ohms to set for a given case/application and no way to derive from the now digital voltage what the input current must have been ad so to know the sensor reading.

Any help or advice greatly appreciated.
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Let's see if I understand you. You have a data acquisition board that connects to some sensors that convert some physical quantity to a variable current. This current is fed through a settable resistance (this is called a "shunt resistance") (a digital potentiometer in this case) that converts it into a proportional voltage, which is fed into an analogue-to-digital converter (ADC) which converts it into a digital representation, which is acquired by on-board firmware and reported elsewhere. Please correct me if any of that is wrong.

I'm going to answer based on the above description, and my understanding of how these functions are normally implemented. This may not exactly match your case, because there is always "more than one way to skin a cat". Your description is pretty clear and full, but you need to provide as much information as possible on your situation, so I can verify or correct my understanding of this case.

The variable current from each sensor is fed through a shunt resistance, and causes a proportional voltage drop across the shunt, according to Ohm's Law, which states V = I R (voltage equals current times resistance), where:
V is the voltage across the shunt resistance, in volts, which is then measured by the ADC and acquired by on-board firmware;
I is the current through the shunt, in amps, which is probably the same as the sensor current;
R is the shunt resistance, which you can set with software.

So you need to work out how to choose the appropriate shunt resistance.

The first issue that arises is this non-linearity between the sensor current and the value reported upstream by the on-board firmware. It's possible, but unlikely, that the non-linearity originates in the hardware. It's more likely that the on-board firmware is performing a translation, using a lookup table, to convert the digitised value from the ADC (which will be proportional to the sensor current) to a reported value in a non-linear way. Usually this will be to compensate for a non-linear characteristic in the sensor, so you need to get as much information as possible on the sensor(s) to see whether or not they respond linearly to the quantity they are measuring.

Assuming the non-linearity is due to software translation, the chosen value of the shunt resistance will also be a factor in this translation. The on-board firmware knows what resistance has been configured for the shunt, and will apply the appropriate translation to the raw value coming from the ADC accordingly.

So you need to know how to choose the best value for the shunt resistance. The shunt resistance converts the current from the sensor into a voltage, which is acquired by the ADC, which has a measurable input voltage range that is defined by the voltage on one or two pins, often called VHI and VLO. While the input voltage is between those setpoints, it is converted into a proportional digital representation and acquired by on-board firmware. The voltage on VHI, and possibly VLO, usually come from a voltage reference on the board. You need to find these voltages, and thus the input voltage range. You should be able to download the data sheet for the ADC device(s) and measure the voltages on the relevant pins. Can you make a list of the ICs on the board and post it here? We may be able to identify the ADC(s).

Alternatively, you can use the bottom-out and top-out behaviour of the ADC to find the lower and upper limits to the measured value. When the ADC's input goes outside the range VLO <= input <= VHI, it is clipped to the minimum or maximum reportable value (no damage should occur to the ADC). Assuming the translation between raw and processed values, when graphed, is a line that (while it will not be straight) is, at all points, between zero and 90 degrees, i.e. it doesn't double back on itself at any point, which is a reasonable assumption, as you vary the sensor current, you will see the value reported by on-board firmware bottom out and top out at these setpoints as well. Set the shunt resistance to the maximum resistance and vary the sensor current, while watching the value reported by on-board firmware. At the bottom and top ends, the reported value hit a limit and will stop changing, indicating that the ADC is bottoming out or topping out. Find the exact current where the value stops changing. You can then calculate VLO and VHI using Ohm's Law as above. If you know the current range the sensor will be operating under, you can then choose the most appropriate shunt resistance using a rearrangement of Ohm's Law: R = V / I.

I hope this gives you a bit of a heads-up and you can do some experiments based on this description. Please feel free to report your findings here and we can analyse them.

I want to reiterate that this description is based on my experience of how these things are normally done, and it may not match your case. If you find anything that makes you question my description, please explain it. It's quite possible that your board does things differently. I'm working from a good, but incomplete description.
 
Last edited:
Hi KrisBlueNZ,

Wow! What a response.

Thank you so much. You do have may problem pretty much right. There is loads in there to help me and I think I am well on the way to solving this now.

I intend to use the calculation (ohms law and the level of the secondary current etc) to set the resistor based on the expected current range for each particular sensor case.

I will try with 3 or 4 input current values and I will then look to see if the voltage output is as expected and adjust for any inaccuracy in the hardware. Hopefully the non-linear is just at the lower end because I have the resistence set too low. In fact using the calkculation I think I DO have it set too low.

Thank you again for your support it is really appreciated and I appologise for the late thank you response. I shall also re-read you message to see what else may be worth taking into account.

Thanks again,

Andrew
 
Top