Sampling a non-linear sensor voltage with an Arduino - Page 1
Forum section: electronics / projects

author: Roo
author_rank: Contributor
timestamp: May 02, 2018, 11:52:08 am
content: I am trying to use a pressure sensor by digitising the signal with an Arduino. The output is non-linear/exponential (like in the attached chart). The part of the curve I am interested in is right near the top. The problem is that if I sample this straight then the resolution for the area of interest is too low to be useful. Is there an input circuit that I could use to make the top 20% of this curve linear about the 0-5v sample range so I can get better resolution? I have read about exponential and logarithmic op-amp circuits but not sure what I actually need...I have looked for many hours on the internet and just think my search words are not right, as this must be a common problem.Could anyone help?

author: Rerouter
author_rank: Super Contributor
timestamp: May 02, 2018, 11:56:07 am
content: Logramatic amplifier springs to mind, however i am guessing based on that curve that it is a half bridge sensor, as such its a varying resistance that is causing the swing, you may have higher granularity with a current source.Or if you literally dont care about anywhere but that range of interest, op amp, sum in a voltage to set your zero point then play with the gain to cover the rest of the range your interested in.

author: Marco
author_rank: Super Contributor
timestamp: May 02, 2018, 01:10:47 pm
content: Do you just want to level shift and amplify, or do you really need the nonlinear response?If you use a 5x inverting opamp amplifier with the positive input connected to 4V, then 4-5V gets mapped to 4-0V, then multiply by 5/4 with a non inverting opamp. This will get you a linear level shifted mapping (could probably do it with a single opamp with an approach where you feed the signal to both inputs, but that might have CMRR issues, and you can easily do it with one opamp if you have a negative rails).

author: Kalvin
author_rank: Super Contributor
timestamp: May 02, 2018, 01:45:55 pm
content: Instrumentation amplifier or a op amp differential amplifier comes to my mind. The op amp / instrumentation amplifier needs to be able to tolerate positive rail input. Adjusting the gain you can extract the upper part of the signal as needed.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 02, 2018, 06:54:27 pm
content: The is also a brute force way, by using an external higher resolution ADC and accept that only a small fraction of the range is actually used. Something like MCP3421 or MCP3550 are surprisingly cheap. There are plenty of high resolution (e.g. 20-24 bit) sigma delta ADCs to choose from. When using integration over a full power line period or a multiple, they can be rather unsensitive to mains hum.

author: Roo
author_rank: Contributor
timestamp: May 03, 2018, 09:07:11 am
content: Many thanks guys for your thoughts on this. I will look into bridges and also might have a go with a 22bit A/D. Either way I now have something to work on. I will hopefully let you know what the solution is once I have some results.

author: Roo
author_rank: Contributor
timestamp: May 03, 2018, 09:35:03 am
content: I have found a chip HX711 that contains a weightstone bridge and 24bit A/D in one package! Perfect.They are also available from Mao's poundland for less than 50p each! There is already a library for the arduino so I should be in for an easy time.Thanks again guys.

author: JS
author_rank: Frequent Contributor
timestamp: May 03, 2018, 12:01:02 pm
content: That converter doesn't have a bridge, it is designed to meassure a loadcell bridge's output, if your loadcell is a full bridge this is your chip to go, it does have a differential PGA, but gains are high even in the lowest range, so if your sensor has a 0-5V output it might not be your best option. You'd need an attenuator and an reference or offset to compare the output to.JS

author: Rerouter
author_rank: Super Contributor
timestamp: May 03, 2018, 12:21:30 pm
content: To simplify things, these sensors generally dont have any defined polarity, flip positive and negative and you flip your sensor reading to one that is more convienient to interface to your bridge ADC.

author: Roo
author_rank: Contributor
timestamp: May 03, 2018, 12:23:07 pm
content: OK - Thanks for the heads-up. The output is not actually 0-5v - I just said that as an example, it was the curve that was more important. I have since read the datasheet and can see I will require a bridge for the sensor I have...which is actually a material called Velostat. Inexpensive break-out boards for the HX711s have the bridge built in usually....so I will start with one of those.

author: Kalvin
author_rank: Super Contributor
timestamp: May 03, 2018, 12:46:38 pm
content: The HX711 will probably give you around 12 - 14 bits of resolution using its internal reference and I found it is quite sensitive to temperature changes. Probably a better external reference and/or better filtering will give you some more bits, though. Anyway, it is a fun chip to play with.

author: NiHaoMike
author_rank: Super Contributor
timestamp: May 03, 2018, 02:57:14 pm
content: Do you have the datasheet for the sensor? I'm getting the impression it will have rather poor accuracy up where you're trying to use it.