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.
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.
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.
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.
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.
Can you please tell us your electronics, programming, arduino, hardware experience?
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 = 510^-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.
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..
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.