Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to invert an analog signal?

Status
Not open for further replies.

toodles

New Member
I'm working on a project using the potentiometers in the pedals for a racing gaming setup.

The two pedals are just potentiometers, with four lines going to them: high, low, gas position, and brake position. The thing is, when the pedals are fully at rest allt he way up, the gas position is a low voltage, and the brake position is a high voltage. Press on both, and the gas position is high voltage, and the brake position is low voltage. They're backwards from each other.

I need to send these lines to the PCB from a microsoft xbox360 wheel. The xbox pcb is expecting the pedals to be a low voltage when at rest, and a high voltage when pressed; same for both pedals.

I cannot rewire the pedals because of other systems they will be used on, so please do not suggest that.

It seems that what I need to do is find a way to invert the voltage on that line. Accuracy and resolution is not that big of a deal (minimum of 4 bits please. anything over 7 bits is just overkill), nor is a high sample rate needed (60 samples per sec minimum, 120 samples per sec would be great, anything more is good but really overkill). The voltage range seems to be 3.3v levels, and it looks like I could power whatever chips are needed from the high and low lines (I just tested, and it provide enough amperage for an LED to light, so I think a couple of logic chips would be fine.)

So, any recommendation for an easy way to invert the voltage coming from a potentiometer? I'm thinking of looking into a i2c DAC and a small uC . I could definitely use recommendations on easy to use DACs. If anyone has any recommendations on standard logics that could do the job without using a uC, that'd be prefered. And if there is some easy analog electronics that can be used for the same effect, that'd be even better.

Let me know if anything in my description is unclear, and I'll be happy to explain.

Edit: Needless to say, analog circuits are not my strong point. By invert, I don't mean I need negative voltage. If the vref is 3.3v, and the output from the pot is 1v, then I need to change it to 2.3v. If the pot output is 3.0v, I need to change it to 0.3v, etc. There has got to be a single chip or way to use an opamp or something, but I dont know crap about analog circuits and could use some advice.
 
Last edited:
hi,
You require a simple opa invertor with a gain of -1.
A single power supply to the opa will be OK, the opa needs to able to swing close to 0V and +3.3v. If you power it from +3.3V.
You can derive the +3v offset from a pot.

Is this clear.
EDIT:
Look at the attached drawing, something like this would work.
Note the +5V requirement for the opa psu. The TS358 requires a +V supply of at least +4V, if the input signal is as high as +3V.

It would be possible to locate a opa that would work at +3.3V, with an input of upto +3v, have a look thru

The voltages in Red and Blue represent the input/output voltages.... The values in brackets are when you include the 1.25V offset.
OK?
Eric
 
Last edited:
toodles said:
By invert, I don't mean I need negative voltage. If the vref is 3.3v, and the output from the pot is 1v, then I need to change it to 2.3v. If the pot output is 3.0v, I need to change it to 0.3v, etc.

The easiest is to fix the voltage on one end(+) of the opamp at 3.3V and configure a gain= -1 amplifier as output.

Because the (+) reference point is now fixed 3.3V, an input voltage of 1V would appear to the opamp as -2.3V, w.r.t the (+) terminal. Therefore after the -1 amplification, one would get 2.3V as the result.

@ericgibbs: In your circuit, I don't see how a reference of 1.25V or 2.5V will work to produce the correct voltage if the gain of the opamp is -1. Remember, the output needs to be 0V with an input of 3.3V.
 
Last edited:
eblc1388 said:
The easiest is to fix the voltage on one end(+) of the opamp at 3.3V and configure a gain= -1 amplifier as output.

Because the (+) reference point is now fixed 3.3V, an input voltage of 1V would appear to the opamp as -2.3V, w.r.t the (+) terminal. Therefore after the -1 amplification, one would get 2.3V as the result.

@ericgibbs: In your circuit, I don't see how a reference of 1.25V or 2.5V will work to produce the correct voltage if the gain of the opamp is -1. Remember, the output needs to be 0V with an input of 3.3V.

hi,
The Vref is +1.5V,,, the gain of a non inverting input is G= 1+ Rf/Ri=2.
ie; 2 * 1.5 = 3V

So the output voltage, with no analog input, will be at +3V.

Eric
 
ericgibbs:

Is the first part of the opamp needed? Or are you just to use it up?
 
Last edited:
I see. The circuit works with a variable gain. G=0 when Vin=3V, G=1 when Vin=1.5V, G= very large when Vin=0V.

Edited: I realised that the gain of the amplifier is not a constant w.r.t. input voltage.
 
Last edited:
mramos1 said:
ericgibbs:

Is the first part of the opamp needed? Or are you just to using it up?

Hi,
As I am not sure about the resistance of gamer potentiometers I thought it would be best to use one half of the OPA ic as a high impedance buffer.
As the TS358 is a dual 8 DIL pin opa its not a problem to do it this way.

Eric
 
eblc1388 said:
I see. The circuit works with a variable gain. G=0 when Vin=3V, G=1 when Vin=1.5V, G= very large when Vin=0V.

Edited: I realised that the gain of the amplifier is not a constant w.r.t. input voltage.

Hi,
No its a 'linear' amplifier, not variable gain.

From the -inp aspect the gain is -1, from the +inp aspect the gain is +2.

Build one the bench and try a variable pot as a 0 to +3v voltage source.

Eric
 
ericgibbs said:
Hi,
As I am not sure about the resistance of gamer potentiometers I thought it would be best to use one half of the OPA ic as a high impedance buffer.
As the TS358 is a dual 8 DIL pin opa its not a problem to do it this way.

Eric
Do you really need the 10k resistor at the + input to the buffer section?
 
Hardwire said:
Do you really need the 10k resistor at the + input to the buffer section?

hi,
Reason I have added the 10K in this instance is cover the possibilty of the non inverting input being dis-connected
while the OP is experimenting with the connection to the OPA.

It will provide some minimal ESD protection, on a fixed design I wouldn't need to.

Eric
 
ericgibbs said:
hi,
Reason I have added the 10K in this instance is cover the possibilty of the non inverting input being dis-connected
while the OP is experimenting with the connection to the OPA.

It will provide some minimal ESD protection, on a fixed design I wouldn't need to.

Eric
That's a darn good idea.
 
ericgibbs said:
No its a 'linear' amplifier, not variable gain.
From the -inp aspect the gain is -1, from the +inp aspect the gain is +2.
Build one the bench and try a variable pot as a 0 to +3v voltage source.
Eric
As the amplifier has only one input and one output, if you blackboxed the amplifier circuit, how would you describe its gain as?
 
eblc1388 said:
As the amplifier has only one input and one output, if you blackboxed the amplifier circuit, how would you describe its gain as?

hi,
I wouldn't agree that the amp has only one input.
Usually the two inputs are a long tailed pair fed from a constant current source.

The design of the amp dictates that
the Gain with reference to the -input is G = -1 * [ Rf/Ri] and with reference to the +input G = 1+ Rf/Ri.

Eric
 
Im about to place an order for parts, but digikey doesnt carry the TS358. Do you have any recommendations for any other part numbers that I could use to take the place of the TS358? LM2904? 741C? Anything?
 
toodles said:
Im about to place an order for parts, but digikey doesnt carry the TS358. Do you have any recommendations for any other part numbers that I could use to take the place of the TS358? LM2904? 741C? Anything?
hi,
You require a opa thats designed to work from a single supply and is able to swing close to 0V [gnd] and close to +Vsupply. [dual opa]

If you look thru Digikey's opa stock list [to see what they have available that meets that criteria], let me know and will recommend an opa.

Eric
 
toodles said:
Im about to place an order for parts, but digikey doesnt carry the TS358. Do you have any recommendations for any other part numbers that I could use to take the place of the TS358? LM2904? 741C? Anything?
LM6142 is a good single supply, rail-to-rail op amp and Digikey or Newark will have them in stock. I think they are a bit pricey. Probably are some cheaper alternatives. Be sure to specify DIP package if you don't want to work with surface mount components (which I'm guessing you don't).
 
I went ahead and placed and order from mouser which does carry the TS358, and the rest of miscellaneous parts needed.

In the diagram, amd I correct in assuming that the part supplying the marked 1.5volts, right of the ceramic capacitor, is a potentiometer? Part P2, going to the + input of the second opamp. Based on where it is and what its doing and the name given, Im assuming it is a 2K ohm pot, but the drawing of the part is different from the other pot in the diagram and just wanted to make sure.

I also couldnt find a 4.3k ohm 1% resistor. From what I'm understanding, the 1k pot P1 is supposed to be used with the 4.3k ohm resistor so the total resistance of P1 + the 4.3k ohm equals the resistance of the 1% 4.7k ohm resistor before it. I did grab a 4.0K ohm 1% resistor, under the assumption that the 4.0K ohm + 1k pot could be used to do the same thing. Is this correct?

I know these are stupid simple questions, but I just want to make sure. Like I said, analog circuits aren't a strong point of mine. :)
 
Last edited:
Mouser is a great choice.

Also, you really do not need the first part of the op-amp. Right into the 4.7K should be fine. But either way it will do what you need.

And you could go larger on the pot as you can always bring it down to the level you need.
 
toodles said:
I went ahead and placed and order from mouser which does carry the TS358, and the rest of miscellaneous parts needed.

In the diagram, amd I correct in assuming that the part supplying the marked 1.5volts,YES right of the ceramic capacitor, is a potentiometer? YES Part P2, going to the + input of the second opamp. Based on where it is and what its doing and the name given, Im assuming it is a 2K ohm pot, YES but the drawing of the part is different from the other pot in the diagram and just wanted to make sure.

I also couldnt find a 4.3k ohm 1% resistor. From what I'm understanding, the 1k pot P1 is supposed to be used with the 4.3k ohm resistor so the total resistance of P1 + the 4.3k ohm equals the resistance of the 1% 4.7k ohm resistor before it. I did grab a 4.0K ohm 1% resistor, under the assumption that the 4.0K ohm + 1k pot could be used to do the same thing. Is this correct? CLOSE enough

I know these are stupid simple questions, but I just want to make sure. Like I said, analog circuits aren't a strong point of mine.
No Problemo! :)

hi,
The purpose of the 1K pot and the 4K3 in series was to enable you to set the gain at 1. As the Rinp resistor is 4K7 and the Gain is equal to Rf/Rinp you could set the Gain limits for the inverting input as, 4K3/4K7 =0.9 thru 5K3/4K7 = 1.1

A 4K0 should just do the job.

With regard to dropping the buffer half of the OPA [the leftside half], before you do that can you tell me the resistance value of the Gamer control pot, the OPA will be connected to?

If its a high resistance value, taking it directly into the -inp of the OPA could load it too much.

Eric
 
They are 10K pots. There are two of them, one for gas and one for brake. I'm not worried about removing the first opamp; its no problem to build, and since its a dual opamp chip, its not like it requires too many extra parts :)
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top