Author Topic: About Variable Gain Amplifier Controlled by Microcontroller  (Read 3435 times)

0 Members and 1 Guest are viewing this topic.

Offline rneraslanTopic starter

  • Contributor
  • Posts: 13
  • Country: tr
About Variable Gain Amplifier Controlled by Microcontroller
« on: March 27, 2017, 08:17:17 pm »
I can properly amplify 40Khz ultrasonic signal using with mcp6022.
But later, I wanted to be able to amplify this signal with the gain in 4 different levels
This must be controlled by MCU
As the first picture, I thought I can switch the feedback resistors with MOSFETs. I fed the gate pin of BSS139 Mosfet with 1K on MCU pin
The idea of switching the MOSFET can change of Feedback resistor did not yield results.
1- Why is the solution in the picture not working properly when Mosfet is completely On ?



I will not use the digital potentiometer for cost reasons.I intend to implement the switching solution of resistors.
Here, I thought that analog switches or multiplexer , demultiplexers can be as a second method.
2- Can I use the 74h4051 IC as seen in the image for this question?



thanx

 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14172
  • Country: de
Re: About Variable Gain Amplifier Controlled by Microcontroller
« Reply #1 on: March 27, 2017, 08:39:50 pm »
Using the MOSFETs does not work well, as the MOSFETs also include a parasitic source to drain diode. So it might work with very small signal levels only (e.g. in the first stage). The second possible problem is getting sufficient gate voltage with an only 5 V supply.

The 74HC4051 or 74HC4052 should work as shown.
Remember that changing just the resistors will also change the frequency response a little.

An alternative would be using a transistor-amplifier instead of the OPs. A differential amplifier can be controlled via the standing current (gain is proportional to the current).  Similar a simple common emitter stage can be controlled by the DC bias current - however there will also be a shift in DC output level and thus would only work well with an inductive or LC collector load.
 
The following users thanked this post: rneraslan

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: About Variable Gain Amplifier Controlled by Microcontroller
« Reply #2 on: March 27, 2017, 10:35:43 pm »
For future reference PSOC has onboard PGAs, plus lots of other analog stuff.



For me what stands out is -

1) Routability
2) Fast 12 bit SAR A/D and slow 20 bit DelSig
3) DFB (Digital Filter Block) that is dual channel, handle FIR or IIR filters, or DFB
can be used as a GP fast processor block, similar to RISC block
4) MSI logic elements GUI based and/or the UDB Verilog capability. Eg. the FPGA
like capability
5) Onboard Vref
6) IDAC, VDAC, OpAmps (up to 4), comparator, mixer, switch cap, analog mux....
7) LCD,  COM, UART, I2C, I2S, One Wire, SPI, Parallel, LIN, CAN, BLE, USB
9) Custom components capability, create with schematic capture or Verilog
10) DMA to offload processes like filters, COM, Display
11) ARM M0 (PSOC 4) or M3 (PSOC  5LP) or 8051 core(PSOC 3)
12) Extensive clock generation capabilities
13) All components supported by extensive prewritten APIs

https://www.element14.com/community/thread/23736/l/100-projects-in-100-days?displayFullThread=true

http://www.cypress.com/documentation/code-examples/psoc-345-code-examples

Great video library

Attached component list.  A component is an on chip HW resource.

Free GUI design tool with schematic capture, "Creator". Components have rich API library attached
to each component. Compilers free as well.

PSOC 4 is low end of family, consider 5LP parts as well. PSOC 4 also has arduino footprint boards (pioneer) as well

https://www.elektormagazine.com/labs/robot-build-with-cypress-psoc

http://www.cypress.com/products/32-bit-arm-cortex-m-psoc



Regards, Dana.
« Last Edit: March 27, 2017, 10:39:28 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: evb149, rneraslan

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19491
  • Country: gb
  • 0999
Re: About Variable Gain Amplifier Controlled by Microcontroller
« Reply #3 on: March 27, 2017, 10:50:33 pm »
2- Can I use the 74h4051 IC as seen in the image for this question?
100R is far too low for the 74HC4051 which can have an on resistance greater than that. What's worse is the on resistance varies, depending on the amplitude, which will cause distortion. Go for 2k2 minimum, to minimise the effects of Ron variation.
http://assets.nexperia.com/documents/data-sheet/74HC_HCT4051.pdf
 

Offline mrkev

  • Regular Contributor
  • *
  • Posts: 225
  • Country: cz
Re: About Variable Gain Amplifier Controlled by Microcontroller
« Reply #4 on: March 27, 2017, 11:26:07 pm »
You could use transconductance amp (OTA), you could change bias current of discrete differential amp with two transistors or JFETs (those are really rare lately and you'd need negative supply).
I would personaly  use set of relays. They are fairly cheap (around 1 $ each) and if you use just two SPDT types, you can switch between four different stages.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: About Variable Gain Amplifier Controlled by Microcontroller
« Reply #5 on: March 28, 2017, 01:20:18 am »
The 4051 can work, but keep in mind it has a number of error
issues that may/may not affect your design depending on accuracy
you are seeking.

1) Channel to channel mismatch
2) Rdson device to device effect on closed loop G of OpAmp
3) Non linearity of Rdson vs input signal level
4) Chanel to channel isolation
5) Split supply needed to handle negative going signals, unless you
offset the input signals

Transconducatance amp can be a solution for a V controlled G voltage amplifier -

http://www.futurlec.com/Linear/LM13600N.shtml


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: rneraslan

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7725
  • Country: ca
Re: About Variable Gain Amplifier Controlled by Microcontroller
« Reply #6 on: March 28, 2017, 02:51:19 am »
Since you are dealing with 40Khz, you can just use 2 NPN transistors, ie 2N3904, emitters to GND, collectors to 2 different resistors & series capacitors tied to the opamp - input, with a feedback resistor from opamp output to - input.  This will create s 2 bit dac, 4 gain levels, with a series resistor between the base and you MCU output digital IO.  3 transistors would be a 3 bit dac gain setting with 8 gain levels.  Ect...

Switching on the transistor will load the - feedback with the series resistor to GND.  The series cap ensures when the transistor is off, if there is a negative voltage at the output, it wont be clamped down as the cap would charge.  When the transistor is on, once again, if your output has a positive DC bias, the cap will balance out to the center reference voltage even though the emitter of the transistor is at GND.

This is a clean sure way to do it with a low impedance feedback in the opamp circuit like a 1K.
« Last Edit: March 28, 2017, 03:14:04 am by BrianHG »
 
The following users thanked this post: rneraslan


Offline bson

  • Supporter
  • ****
  • Posts: 2269
  • Country: us
Re: About Variable Gain Amplifier Controlled by Microcontroller
« Reply #8 on: March 30, 2017, 04:47:43 pm »
The first stage is +20dB, the second +20dB or +40dB.  It seems to me there are solutions here that don't require complex feedback loops:
  • Make the stages fixed non-inverting +20dB and +40dB, then selectively bypass the first stage to switch between gains.  (A signal relay would work well here at your frequencies.)
  • Make the stages fixed +20dB and +40dB, and put a switchable -20dB attenuator between them.  The former option is better (why add +20dB gain only to instantly remove it) - but an attenuator can have more adjustment steps or use say a panel switch.
This is assuming you actually want to roll your own instead of using an off the shelf PGA...

 
The following users thanked this post: rneraslan


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf