# Properly source varying negative voltage using Arduino

How can I properly source a varying negative voltage using an Arduino? I would like to use the 5V supply pin on the Arduino, scale it down (dynamically) to an appropriate voltage, and convert it to a negative voltage to be used as a negative supply source.

I've seen posts that use the ICL7660 negative voltage converter to supply a negative voltage. I also would like to get as close to 0 volts (a very high negative voltage, ex: -0.1V) as possible.

From my knowledge, there are two ways of doing this:

First Method:

1. Scale 5V input voltage using digital potentiometer
2. Use some IC to convert output voltage of digital potentiometer to a negative voltage

Second Method:

1. Convert 5V input voltage to a -5V using some IC
2. Scale -5V using a digital potentiometer

Are there any downsides of sourcing the FSR with either of these two methods? What specific components would you recommend? I have a MCP4231 digital pot (but won't work for second method since it doesn't take negative voltage).

The end goal is to be able to source a varying negative voltage (controlled by a digital pot that I can alter using software) without any extra batteries. I would also like to get a good amount of variation between -0.1V and -5V.

I am trying to use the negative voltage to source the Flexiforce force sensitive resistor here (the Vt in the picture below):

Also any advice for a different electronic frontend circuit that provides similar control of the dynamic force range would be helpful!

EDIT

Per @DrFriedParts advice, I have used his circuit to eliminate using a negative voltage source altogether. However, when simulating the circuit and implementing it, I don't seem to get an output different than 5V.

Here is a snapshot of the circuit:

The output is always 5V, no matter what values I change for Rs (the sensor) and Rf (feedback resistor). Am I doing something wrong? Shouldn't I apply a bias voltage much lower than 5V (like 0.5V) so the output will be from 0.5V to 5V?

• This all seems very heath-robinson if you just want to read the FSR's resistance (which can be done with a variety of ADC methods) - or do you need it for something else as well? – pjc50 Nov 19 '15 at 20:45
• Hmm. Well the circuit above allows me to vary the force range dynamically (by varying Vt and Rf). I need to alter the force range for my application. Is there an alternate easier way to do this? I am currently varying Rf through a digital pot, but for the negative voltage supply of the FSR (Vt) I need some help identifying the best way to vary this voltage. – tabchas Nov 19 '15 at 20:49
• A wheatstone bridge is usually ideal for reading a variation in resistance as a voltage. See if that will match your needs. The force range is usually defined by the sensor mechanics, not the voltage, unless I am missing something. – Jarrod Christman Nov 19 '15 at 20:50
• I don't believe a wheatstone bridge is required. Here is the datasheet for the sensor I have: tekscan.com/sites/default/files/resources/FLX-A301-A.pdf. The force range can be adjusted (as mentioned in the datasheet) by varying the voltage and feedback resistor. I just need to identify a way to properly vary negative voltage with my Arduino – tabchas Nov 19 '15 at 21:02
• Alternative proposal if you don't need super-high bandwidth: drive the thing with dynamically-controlled current source to a constant target voltage. Driven by a "1-bit DAC" you can achieve high resolution and dynamic range, certainly higher than a 10-bit ADC. (What are the noise specs and precision of your digital pot BTW? That will also limit your effective resolution). – pjc50 Nov 19 '15 at 21:26

## This is likely unnecessary architecture.

You don't really need (and probably don't want) negative voltages in your application.

• Your op-amp can only generate positive voltages.
• The transducer will only generate positive voltages.

The piezo element is a large resistor at no pressure and decreases in resistance as pressure is applied.

(Note: I don't know what your ADC's input dynamic range is, so I will assume 0-5V here. Scale accordingly if your range is smaller)

To fit the element into your ADC's dynamic range, you need to convert change in resistance of the transducer (the Flexiforce) to change in voltage... and then scale the resulting output.

## I propose...

Before we go further, it should be noted that this transducer's datasheet is not sufficiently helpful. It lacks the curves or parameters that would actually allow you to predict the performance of this circuit. They even go so far as to tell you to calibrate each unit individually (implying high variability among units).

That said we can make some inferences from notes in the datasheet. Namely:

• They specify the unloaded resistance as being greater than 5 MegaOhm.
• The feedback resistance must be lower than the transducer's or the output will saturate.
• They specify a minimum feedback resistance of 1k.

I propose, connecting Vref to +5V, using a 256-tap 1-MegaOhm digitally-controlled potentiometer for Rf (ex. ANALOG DEVICES AD5241BRZ1M), and grounding the other terminal of the transducer.

This is the resulting transfer function:

$$V_{output}=\frac{R_s-R_f}{R_s}V_{ref}$$

where Rs is the resistance of the Flexiforce, Rf is the feedback resistance, and Vref is the voltage applied at the positive terminal of the OpAmp.

### How it works

At higher pressure, the resistance of the transducer is lower. If your ADC has 10 effective bits, we can resolve 5mV from a 5V range.

Setting the gain to 1 MegaOhm (1e6 Ohms), we can resolve a 0.5% change in the sensors resistance! The output voltage will change from 4.000V to 3.995V.

As the resistance continues to decrease (more pressure applied) we can continue to resolve pressure with very high precision until the transducer's resistance approaches 1 MegaOhm (the same as the feedback resistance).

At this point, you should reduce the feedback resistance to increase dynamic range (the ability to measure a wider range of pressures) at the expense of resolution (the ability to measure tiny changes in pressure). DON'T WORRY. Your resolution performance will still be very good (likely better than the noise floor of the transducer or OpAmp).

At the high-end of the pressures the transducer could be exposed to, you will be at minimum feedback resistance. In the case of my proposed Analog Devices part, that's about Rf = 3.9k. In this situation you can resolve (theoretically) a 0.1% change in the transducers' resistance.

Awesome! Wide dynamic range and no messy variable negative voltage power supply!

## YMMV

It should be noted that the purpose of the negative bias is to increase your sensitivity at low pressures (where the transducer will be near 5 million Ohms). Such a system will not necessarily outperform my proposal as the inverting power supply introduces many additional noise pathways and must be designed extremely carefully for such a high-impedance sensing circuit. It will also cost substantially more to build as it uses more components and more expensive components.

The exact tuning and design parameters of this circuit will depend on how much (and how little) force you really need to be able to resolve and how the transducer actually behaves (the datasheet is only giving us bounds, not intermediate characteristics).

• Hmm, here is the datasheet for the sensor: tekscan.com/sites/default/files/resources/FLX-A301-A.pdf. The circuit I showed is the recommended electronic frontend for this FSR. This is not a flex sensor but a pressure sensor. You mentioned biasing the op amp with 2.5V. This would effectively remove half of my measurement room (in a 10-bit ADC, I would only be able to read between 512 and above). Isn't that a bad thing for getting the most accuracy for a given force range? – tabchas Nov 19 '15 at 21:00
• I'll revise the answer... – DrFriedParts Nov 19 '15 at 21:15
• I've revised the answer to deal with this transducer explicitly. Good luck with your project! – DrFriedParts Nov 19 '15 at 22:17
• Thanks so much! I currently have the negative voltage circuit setup, and I only need a 100k Ohm digital pot to control the full force range. Why do I need a 1 Megaohm pot? Also, in the beginning of your answer, you defined a transfer function. Isn't the transfer function Vout = -Vt * (Rf/ Rs) as it says in the picture I posted – tabchas Nov 20 '15 at 1:44
• My design and your design are very different. Your design's transfer function is the one in the figure. My design's transfer function is as I described. Your design needs a negative voltage power supply and a positive voltage power supply. Mine only needs the positive one = less noise, fewer parts, lower cost. Both approaches will work. – DrFriedParts Nov 20 '15 at 3:52