Multiplexing analog signals - Page 1
Forum section: electronics / beginners

author: lukasz.kostka
author_rank: Contributor
timestamp: May 05, 2020, 09:26:59 pm
content: Hi.I am working on a digital controled dummy load. I have single channel 12bit DAC and ADC and a 4095 mV vref. My plan is to use 1mV = 1mA up to 4 V. After that I'd like to gain ADC / DAC x2 to be able to use it in steps of 10 mA. I am thinking of some multiplexer to which I can connect outputs of opamps and select gain in MCU. Will simple 74HC4053 be enough ?

author: Vovk_Z
author_rank: Super Contributor
timestamp: May 06, 2020, 11:06:15 pm
content: It depends. Why not?If a load has to be very dummy then may be there is no need in ADC at all.

author: lukasz.kostka
author_rank: Contributor
timestamp: May 06, 2020, 11:19:24 pm
content: I need ADC and DAC. DAC output is fed into opamp. ADC input goes through opamp as well. I never used any analog multiplexers before. That's why I am asking.

author: Vovk_Z
author_rank: Super Contributor
timestamp: May 06, 2020, 11:37:02 pm
content: Mey be you can even use a simple Mosfer switch instead of?It is hard to talk without a circuit.

author: lukasz.kostka
author_rank: Contributor
timestamp: May 06, 2020, 11:48:05 pm
content: At page 3 you can see how I do current sensing and loading of mosfet.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 07, 2020, 12:59:10 am
content: The problem with a mux to the ADC is that you really do not want a high voltage over your current shunt.High voltage over the power shunt defines the minimum voltage needed for that current.Instead of putting a mux to the ADC, consider using a 2nd power MOSfet and a much lower value shunt resistor in parallel.If accuracy is not so important for higher currents, you can simply assume a fixed current ratio between the shunts.For better accuracy you can characterize and calibrate for different currents and compensate in software.For better accuracy than that you need to measure the current through (voltage over) each shunt individually.You can either use simple mux or analog switches such as 4066, or use a multi channel ADC such as the MCP3204 (I think that's the number).There is also no need for buffering the voltage to the ADC.The output resistance of your shunt resistor is 0.1 Ohm.The LM358 also has a pretty high offset voltage. Instead of the Opamp buffer I'm thinking more along the line of a 100Ohm or so series resistor with a capacitor for a low pass filter and protection against "weird" spikes and "stuff" happening.A capacitor on the input of the ADC also reduces the dynamic input impedance, especially for successive approximation ADC's.Also, do not put the negative input of the MCP3201 directly to GND at the chip. Use it on the GND lead of your shunt resistance. You are likely to have a significant voltage drop over your PCB tracks, and copper has a high temperature coefficient, which is hard to compensate for in firmware.Another thing:You have a pretty high and symmetrical input voltage from your bridge rectum fire and a LM337L with a significant voltage drop. A TO-92 gets hot pretty easily. It may be good enough, but you have to test for this.

author: WattsThat
author_rank: Frequent Contributor
timestamp: May 07, 2020, 02:31:37 am
content: Auto spell correction run amok. You might need to see a doctor after that eventQuote

author: Vovk_Z
author_rank: Super Contributor
timestamp: May 07, 2020, 08:50:02 am
content: Quote from: lukasz.kostka on May 06, 2020, 11:48:05 pmBut current is quite definitely defined by CC circuit (we only can't know exact LM358 input voltage drift). So I would prefer to use ADC to measure something we don't know - input voltage, for example. The current control circuit can be calibrated without ADC.And for low supply voltages there is still cheap but more precision opamps (can't remember now).

author: lukasz.kostka
author_rank: Contributor
timestamp: May 07, 2020, 05:44:05 pm
content: Quote from: Doctorandus_P on May 07, 2020, 12:59:10 amMOSFET that I want to use is pretty expensive so I'd rather use only one. Voltage across shunt won't exceed that I've set.Quote from: Doctorandus_P on May 07, 2020, 12:59:10 amI am thinking of getting a 16 bit ADC/DAC for better accuracy. It will help a lot in software compensation. Single channel ADC/DAC are cheaper than multi channel ones so I'd prefer to use a analog switch.Quote from: Doctorandus_P on May 07, 2020, 12:59:10 amOffset voltage is voltage from a given rail that lm358 can go close to ?I use lm358 because I have bunch of them but I'd appreciate if you can suggest better (precise and preferably rail to rail) opamp. I am a newbie and don't quite understand some opamp params such as CMMR, input offset etc.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 09, 2020, 08:22:40 pm
content: About your expensive MOSfet...The extra MOSfet is just used as a switch to turn it on/off parallel to the other shunt resistor, so it can be a cheap one as long as it can handle your maximum voltage, when open, and maximum current when closed.Instead of your "expensive" MOSfet you can also consider to make a driver from a (few) power transistor(s) an drivers.I once built a simple analog current source/sink with just 2 external connections and no batteries.It could regulate from a minimum of about 10mA because that was what the electronics needed and it starts working with a power supply of around 3 Volts, which is less then the Gate voltage for most MOSfets.

author: lukasz.kostka
author_rank: Contributor
timestamp: May 09, 2020, 08:47:41 pm
content: Quote from: Doctorandus_P on May 09, 2020, 08:22:40 pmWell that is a good question why most designs use mosfets instead of transistors.As for extra mosfet. You mean to have one "main" mosfet and 2 other which will select a path to ground through a shunt and I can select desired gain based on thaht ?