# How to shift analog signal to different ground

#### Rossosaurus

Joined Aug 23, 2019
24
I designed this muscle amplifier that runs on +/-5V. I'm powering this with a standard 3.7V lipo stepped up to 10V and then using a potential divider to split the power into 2 rails (+5V and -5V). However, I then want to pass this signal into an Arduino powered by the whole 10V and am wondering how I would go about doing this as the muscle signal is rectified to be completely positive but is technically oscillating between 10V and 5V in reference to the ground being used on the Arduino. I don't know if this is hard to imagine so I've drawn out the basic diagram: The signal would be going into one of the analog pins on the Arduino to be read by a script but at the moment it would fry the Arduino as it's over 5V, how would I go about translating the signal down by 5V so that it can be safely read by an Arduino while still powering the whole thing off a single battery? I hope this makes sense

#### crutschow

Joined Mar 14, 2008
25,269
Why not design the amplifier to give the desired signal?

#### crutschow

Joined Mar 14, 2008
25,269
I assume the IN-AMP and electrode REF terminals are connected to the PWR voltage divider GND, not circuit ground as you show.

#### Rossosaurus

Joined Aug 23, 2019
24
Ah, yes they are. Sorry i put that diagram together back before i changed over to a potential divider power supply.

#### Rossosaurus

Joined Aug 23, 2019
24
Yeah, all grounds on the circuit diagram I put together are using the potential divider ground. The max output I see can be at the point of saturation for the op-amp which I believe is about +/- 4.1V. Would you mind explaining how the MOSFET translates the signal down 5V?

#### crutschow

Joined Mar 14, 2008
25,269
how the MOSFET translates the signal down 5V?
The last stage uses a MOSFET to create a voltage to current converter.
The output is a positive current with current equal to the rectified input voltage divided by 20kΩ.
Since the current output is a very high-impedance node (as determined by the MOSFET's drain resistance along with the negative feedback) the current will be unchanged even if it goes to a different negative voltage (any voltage up to the MOSFET voltage rating).

Since the output is a current, the output voltage is determined by the output load resistance. referenced to the resistance negative voltage rail (in this case -5V).
The load is 20kΩ so the voltage gain from input to output is |Vin|/20K * 20k = |Vin|*1.

Last edited:

#### Rossosaurus

Joined Aug 23, 2019
24

#### crutschow

Joined Mar 14, 2008
25,269
How does the MOSFET flip the signal from this to this?:
It doesn't.
The net (sum of the) current going into the U2 second stage op amp input R3 and R4 resistors (green trace) is always positive going, not negative going (note the direction of the diodes).

Edit: I just realized that the feedback resistor for U2 is not needed, since the MOSFET basically replaces that function, so the simulation below is with it (formerly R5) removed.

U2 will always try to keep its minus input at virtual ground (0V, the plus input voltage), this means that positive current into the minus junction must also flow through the MOSFET to the output load.
(Note that the output current, I(R6) equals the sum of I(R3) and I(R4)).
U2 adjusts the P-MOSFET gate voltage (this is typically a few volts below the source voltage which is the summing junction zero volts here) to maintain this current, independent of the MOSFET drain voltage (as long as the drain load is negative enough to absorb the current).
Since the drain is a high impedance, and U2 will adjust the gate voltage to maintain its minus input at zero, the output current becomes independent of the load negative voltage source (within the circuit limits).
This means the output current (and thus the load voltage) will faithfully follow the rectified voltage, thus translating the voltage to the negative load source voltage (yellow trace).

Make sense?

And you are not stupid.
It took me awhile to understand the circuit when I first encountered it in a high-side current sense circuit. Last edited:

#### Rossosaurus

Joined Aug 23, 2019
24
@crutschow Thank you. I think I'm beginning to understand now but I still have a few questions:
U2 will always try to keep its minus input at virtual ground (0V, the plus input voltage), this means that positive current into the minus junction must also flow through the MOSFET to the output load.
Does this mean that current goes into the input terminals of the op amp? I get that a minuet amount has to go in them in reality as no op amp is ideal. Doesn't all the current ideally flow through the MOSFET?
U2 adjusts the P-MOSFET gate voltage (this is typically a few volts below the source voltage which is the summing junction zero volts here) to maintain this current, independent of the MOSFET drain voltage (as long as the drain load is negative enough to absorb the current).
Is there a physical connection between the Source and Gate of the MOSFET? I didn't think there was as the gate terminal is seperated from the Drain-Source channel by a dielectric meaning that there is no feedback to the minus input. Wouldn't this cause the output of U2 to saturate at the negative rail?
Since the drain is a high impedance, and U2 will adjust the gate voltage to maintain its minus input at zero, the output current becomes independent of the load negative voltage source (within the circuit limits).
I think this is the bit I don't understand the most. Why is the drain high impedance?

Kind of in relation to one of my previous questions. If U2 is mainting it's minus input at 0, which is technically 5V in relation to V-, doesn't that mean that 5V is output out of the MOSFET drain? But then the maths of V=IR doesn't add up over R6? I hope this helps in understanding where I'm getting confused.

Thanks again for your help. It's really appreciated #### crutschow

Joined Mar 14, 2008
25,269
Does this mean that current goes into the input terminals of the op amp? I get that a minuet amount has to go in them in reality as no op amp is ideal. Doesn't all the current ideally flow through the MOSFET?
Yes, ideally it all flows through the MOSFET.
The summing junction is not the op amp input terminal.
Is there a physical connection between the Source and Gate of the MOSFET? I didn't think there was as the gate terminal is seperated from the Drain-Source channel by a dielectric meaning that there is no feedback to the minus input. Wouldn't this cause the output of U2 to saturate at the negative rail?
No, there's no connection between the MOSFET source and drain.
U2 adjusts the gate-source voltage until the MOSFET is passing current equal to that flowing into the summing junction.
That keeps the summing junction at zero volts which keeps U2 happy.
Why is the drain high impedance?
If you look at the MOSFET characteristics (below) you will see that, for a fixed Vgs, the drain current changes very little with drain-source voltage in the saturation region, which is characteristic of a high impedance. If U2 is mainting it's minus input at 0, which is technically 5V in relation to V-, doesn't that mean that 5V is output out of the MOSFET drain?
No, the MOSFET output voltage is the load voltage plus the voltage drop due to the current through the load resistance.
The purpose of the MOSFET is so that its 5V source voltage can be constant while the drain voltage can vary as determined by the load resistor and the load resistor supply voltage.
The op amp adjusts the MOSFET Vgs so this is always true.

.

#### Bordodynov

Joined May 20, 2015
2,646

#### Rossosaurus

Joined Aug 23, 2019
24
@crutschow
Yes, ideally it all flows through the MOSFET.
The summing junction is not the op amp input terminal.
Ah right. I just misread junction as terminal. That's fine then.
No, there's no connection between the MOSFET source and drain.
Is drain supposed to be gate here?
U2 adjusts the gate-source voltage until the MOSFET is passing current equal to that flowing into the summing junction.
That keeps the summing junction at zero volts which keeps U2 happy.
So the MOSFET here is acting like a variable resistor controlled by the op-amp instead of acting like a switch? If the current going into the source of the MOSFET goes up the op-amp adjusts the gate voltage so that the MOSFET resistance adjusts to maintain the 0V at the summing junction?
If you look at the MOSFET characteristics (below) you will see that, for a fixed Vgs, the drain current changes very little with drain-source voltage in the saturation region, which is characteristic of a high impedance.
I'm afraid I still don't get this. If the voltage going into the source is a constant 5V then shouldn't the current going into the source also be constant where as it's not in the circuit because it's oscillating between 0 and 120uA?
No, the MOSFET output voltage is the load voltage plus the voltage drop due to the current through the load resistance.
The purpose of the MOSFET is so that its 5V source voltage can be constant while the drain voltage can vary as determined by the load resistor and the load resistor supply voltage.
The op amp adjusts the MOSFET Vgs so this is always true.
This is the bit I don't seem to be getting throughout. I'm guessing the drain above wasn't a typo. So if there is no connection between the source and drain what is producing the voltage coming out of the drain?

Thank you again and sorry for asking so many questions. I have no official qualifications in electronics so all my knowledge is self taught or from asking questions on the internet like this one.

#### crutschow

Joined Mar 14, 2008
25,269
Is drain supposed to be gate here?
Yes, I meant gate.
So the MOSFET here is acting like a variable resistor controlled by the op-amp instead of acting like a switch? If the current going into the source of the MOSFET goes up the op-amp adjusts the gate voltage so that the MOSFET resistance adjusts to maintain the 0V at the summing junction?
Yes and yes.
I'm afraid I still don't get this. If the voltage going into the source is a constant 5V then shouldn't the current going into the source also be constant where as it's not in the circuit because it's oscillating between 0 and 120uA?
No.
The summing junction/source voltage is always constant, independent of the current.
It's the gate voltage (controlled by the op amp) that varies to generate the varying current.
So if there is no connection between the source and drain what is producing the voltage coming out of the drain?
There is a connection between the source and drain to carry the current, but the drain voltage is entirely determined by the load resistance, the load current, and the load supply voltage (in this case -5V).

#### Rossosaurus

Joined Aug 23, 2019
24
Thank you. I'm definitely getting there now. Sorry I haven't replied quicker I've been busy fixing my grandparents car for like the millionth time. I think I actually understand it all now. So Vout is the sum of the current coming out of the MOSFET drain and the current drawn by the resistance of R6 (20K).?

Seeing as the current drawn by R6 is constant and is in the opposite direction to the current coming out of the drain, the total current at that node is: $I_{total} = \frac{-5V}{20000\Omega }+I_{M1_{d}}$ This means that the voltage at Vout is equal to: $I_{Total} * 20000\Omega$ I hope I've got this right this time. Thanks again

Joined Jan 15, 2015
5,618
Sorry I haven't replied quicker I've been busy fixing my grandparents car for like the millionth time.
Yeah but understand grandparents appreciate things like that and keep in mind we are not going to be here forever. We also tend to be proud of our grand kids and brag on you all the time. Actually I have a question. Based on your first drawing how are you deriving your (+) and (-) 5.0 volt supplies?
I designed this muscle amplifier that runs on +/-5V. I'm powering this with a standard 3.7V lipo stepped up to 10V and then using a potential divider to split the power into 2 rails (+5V and -5V).
If that potential divider is just a resistor divider you may want to rethink your supply scheme. They do make DC to DC converters which have a +/- output, was that what you planned to use?

Ron

#### MrAl

Joined Jun 17, 2014
7,762
Hello,

If that is a voltage to current converter i dont think i would like to use that because then the output voltage depends highly on the output impedance (the load).

A simple level shifter would handle this no problem. It's a simple circuit, simple analysis, no mosfet required just an op amp. It can be made high precision if needed too.

#### crutschow

Joined Mar 14, 2008
25,269
Seeing as the current drawn by R6 is constant and is in the opposite direction to the current coming out of the drain, the total current at that node is:
Itotal=−5V / 20000Ω + IM1d​
No, the R6 current is not constant, as its equal to IM1d.
All the -5V does is offset the voltage.
The R6 voltage is thus IM1d * R6 - 5V