Author Topic: Multiplexing analog signals  (Read 942 times)

0 Members and 1 Guest are viewing this topic.

Offline lukasz.kostkaTopic starter

  • Contributor
  • Posts: 37
  • Country: pl
Multiplexing analog signals
« on: May 05, 2020, 09:26:59 pm »
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 ?
« Last Edit: May 05, 2020, 10:12:59 pm by lukasz.kostka »
 

Offline Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1419
  • Country: ua
Re: Multiplexing analog signals
« Reply #1 on: May 06, 2020, 11:06:15 pm »
It depends. Why not?
If a load has to be very dummy then may be there is no need in ADC at all.
 

Offline lukasz.kostkaTopic starter

  • Contributor
  • Posts: 37
  • Country: pl
Re: Multiplexing analog signals
« Reply #2 on: May 06, 2020, 11:19:24 pm »
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.
 

Offline Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1419
  • Country: ua
Re: Multiplexing analog signals
« Reply #3 on: May 06, 2020, 11:37:02 pm »
Mey be you can even use a simple Mosfer switch instead of?
It is hard to talk without a circuit.
 

Offline lukasz.kostkaTopic starter

  • Contributor
  • Posts: 37
  • Country: pl
Re: Multiplexing analog signals
« Reply #4 on: May 06, 2020, 11:48:05 pm »
At page 3 you can see how I do current sensing and loading of mosfet.
 
The following users thanked this post: Doctorandus_P

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3368
  • Country: nl
Re: Multiplexing analog signals
« Reply #5 on: May 07, 2020, 12:59:10 am »
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.
« Last Edit: May 07, 2020, 01:03:55 am by Doctorandus_P »
 
The following users thanked this post: lukasz.kostka

Offline WattsThat

  • Frequent Contributor
  • **
  • Posts: 767
  • Country: us
Re: Multiplexing analog signals
« Reply #6 on: May 07, 2020, 02:31:37 am »
Auto spell correction run amok. You might need to see a doctor after that event  :-DD

Quote
...  from your bridge rectum fire and a LM337L ... [ /quote]
 

Offline Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1419
  • Country: ua
Re: Multiplexing analog signals
« Reply #7 on: May 07, 2020, 08:50:02 am »
At page 3 you can see how I do current sensing and loading of mosfet.
But 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).
 

Offline lukasz.kostkaTopic starter

  • Contributor
  • Posts: 37
  • Country: pl
Re: Multiplexing analog signals
« Reply #8 on: May 07, 2020, 05:44:05 pm »
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.

MOSFET 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. 

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).

I 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.

The LM358 also has a pretty high offset voltage.

Offset 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.
« Last Edit: May 07, 2020, 05:52:00 pm by lukasz.kostka »
 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3368
  • Country: nl
Re: Multiplexing analog signals
« Reply #9 on: May 09, 2020, 08:22:40 pm »
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.
 

Offline lukasz.kostkaTopic starter

  • Contributor
  • Posts: 37
  • Country: pl
Re: Multiplexing analog signals
« Reply #10 on: May 09, 2020, 08:47:41 pm »
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.
Well 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 ?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf