# 2 values 1 ADC channel

Greetings,

I was trying to meassure current thrugh a shunt resistor. This resistor has very low resistance(5mΩ) so I decided to use op amps to amplify this signal.

The circuit first compares Vin and Vref. If Vref is greater than Vin it activates the pnp transistor. After activating the transistor second op amp starts amplifying the signal.

I have to measure current with a 10 bit ADC. I can only use 1 ADC channel but I have to measure both Vin and Vout. How can I switch those signals. For example with a mosfet.

Edit: I wrote my problem wrong. My real probem is: I have 1 ADC channel and I have to measure 2 analog values. How can I do that?

Firstly Q1 is an emitter follower, not a switch (you need a PNP device in common-emitter configuration for a switch). The problem with what you have is the LM358 won't be getting 5V, possibly about 3.5 to 4V only.

Secondly the device driving Q1 cannot output anything like 5V in the first place, the LM358 is not rail-to-rail and will probably only raise its output to 3.5V or so. So the second opamp will not get enough voltage to function.

Thirdly there is no decoupling on the second opamp - some opamps require this.

The opamp gain stage current has only x2 gain, which presumably is not the intention, more like x10 to x100 is usually needed for a 5mΩ shunt.

And lastly the shunt amplifier should be a differential amplifier circuit connected to both sides of the shunt (in a 4-terminal or "Kelvin" connection). Otherwise the stray resistance of the wiring in the high current circuit will throw out you measurement significantly.
https://en.wikipedia.org/wiki/Differential_amplifier#Operational_amplifier_as_differential_amplifier

Why are you using one LM358 to switch on and off another? You still have to power at least one opamp all the time, you haven't gained anything!

The first device should be a comparator anyway, not an opamp, comparators compare voltages, opamps amplify.

I suggest first off forget the flawed power-saving stuff and concentrate on getting the differential amplifier working. The if you need to reduce the power consumption have a look at the "high side transistor switch" section here: https://www.baldengineer.com/low-side-vs-high-side-transistor-switch.html

Given that you actually did need to measure two voltages, which you clearly do not in the situation described, you would use an analog multiplexer such as a 74HC4052.

1 Like

I2C DC 16 bit with 4 input, of the shelve? Use I2C connection to Arduino?
Could this be a viable alternative? Let the chip take care of the multiplexing and the gain problem.

I changed the pnp transistors with p channel mosfets.

This was a short part of my circuit. In my original design I measured with differential amplifier.

So I should buy a comparator. Right?

There will be more than 4 inputs.

I2C is a bus where you can attach up to 128 device to.
So that makes in theory 4 x 128 Inputs.

74HC4051

No, use the correct circuit.

That would be a good start, depending on what you are actually attempting to do. Unfortunately, you are by no means giving adequate detail, so the XY problem is quite evident.

Have another try at describing your endeavour.

In conclusion,

I have to buy analog multiplexers for my low number of analog channel problem.

What do you mean by saying "correct circuit"?

Here it is.

Edit: I connected differential amplifiers V+ and V- to wrong supply. V+ should be connected to +12V V- should be connected to ground.

Hi;
Can you tell us the complete scope of your project?
What are you trying to do and from what?

Can you explain why you need the circuit in the red circle.
If you use multiplexers and read the analog out of your differential amplifier, why do you need to switch another amp in.
Why not leave it ON all the time, switching it ON and OFF makes no sense.

Thanks... Tom...
PS, For your differential amplifier you need an INSTRUMENTATION AMPLIFIER, google it .

I was trying to do an electronic load controlled by a microcontroller.

I want to amplify the measured voltage from the shunt resistor.

I have to switch op amps. Why?
First Condition
Gain = 100
Vout=i_shunt * R_shunt
? = 20 * 0.005
V=0.1
If I set the gain of the amplifier to 100 I can easily destroy my analog input.

Second Condition
I can't use low gains.
Gain = 1
Vout=i_shunt * R_shunt
? = 0.001 * 0.005
V = 510^-6
Vout = 5
10^-6 (Gain)1 = 510^-6
To low for my ADC input.

I will read the analog value after every amplification so i need to control them. For example

Vin=5*10^-3
Vref=0.2

1-Is Vin > Vref?
YES- No need for amplification ADC can easily measure the voltage.
NO- You need to amplify the signal for the ADC.
2-Amplify the signal 100 times
3-Read the voltage of the op amp output.
4-Start again.

I have been making projects for 3 years. I can make simple circuits. I am not a beginner in programming nor an experienced programmer. I am not an engineer I am just a hobbyist.

It says it is well suited for test equipments. That is what I am doing.

Two opamp circuits, one for each signal. Then a cmos switch to toggle between either (amplified) signal as desired. It does take an additional digital signal to toggle the switch of course.

Hi,
What is the maximum current that you will be measuring?
What will be the maximum current shunt voltage?

AC or DC?

Thanks.. Tom...

Get one (or more) 3-channel 16-bit bi-directional INA3221 current sense breakout boards.
I2C, so you can add more boards to the same two pins.
Digital, so no ADC channel used.
Leo..

I will be an electrical engineering student so I want to learn new components and their usage. for example op amps, analog multiplexers , comparators.

Max:10 Amps
Min:0.001 Amps

I think 0.05V.

Only DC.

Good luck with that. That's around 11 bits resolution to begin with, let's say 12 bit to allow for inevitable system imperfections and that will still limit useful resolution to about 1 mA if you manage to make this absolutely and entirely noise free.

Wishful thinking.
That's 1:10000, and requires special low offset/drift opamps (not an LM358), and a 14+ bit A/D.
Leo..

Can you reccomend me a low offset op amp?

That will not be a problem. I have a 16 bit ADC module.