About Variable Gain Amplifier Controlled by Microcontroller - Page 1
Forum section: electronics / beginners

author: rneraslan
author_rank: Contributor
timestamp: March 27, 2017, 08:17:17 pm
content: 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 levelsThis must be controlled by MCUAs 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 pinThe 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

author: Kleinstein
author_rank: Super Contributor
timestamp: March 27, 2017, 08:39:50 pm
content: 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.

author: danadak
author_rank: Super Contributor
timestamp: March 27, 2017, 10:35:43 pm
content: For future reference PSOC has onboard PGAs, plus lots of other analog stuff.For me what stands out is -1) Routability2) Fast 12 bit SAR A/D and slow 20 bit DelSig3) DFB (Digital Filter Block) that is dual channel, handle FIR or IIR filters, or DFBcan be used as a GP fast processor block, similar to RISC block4) MSI logic elements GUI based and/or the UDB Verilog capability. Eg. the FPGAlike capability5) Onboard Vref6) 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, USB9) Custom components capability, create with schematic capture or Verilog10) DMA to offload processes like filters, COM, Display11) ARM M0 (PSOC 4) or M3 (PSOC 5LP) or 8051 core(PSOC 3)12) Extensive clock generation capabilities13) All components supported by extensive prewritten APIshttps://www.element14.com/community/thread/23736/l/100-projects-in-100-days?displayFullThread=truehttp://www.cypress.com/documentation/code-examples/psoc-345-code-examplesGreat video libraryAttached component list. A component is an on chip HW resource.Free GUI design tool with schematic capture, "Creator". Components have rich API library attachedto 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 wellhttps://www.elektormagazine.com/labs/robot-build-with-cypress-psochttp://www.cypress.com/products/32-bit-arm-cortex-m-psocRegards, Dana.

author: Zero999
author_rank: Super Contributor
timestamp: March 27, 2017, 10:50:33 pm
content: Quote from: rneraslan on March 27, 2017, 08:17:17 pm100R 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

author: mrkev
author_rank: Regular Contributor
timestamp: March 27, 2017, 11:26:07 pm
content: 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.

author: danadak
author_rank: Super Contributor
timestamp: March 28, 2017, 01:20:18 am
content: The 4051 can work, but keep in mind it has a number of errorissues that may/may not affect your design depending on accuracyyou are seeking.1) Channel to channel mismatch2) Rdson device to device effect on closed loop G of OpAmp3) Non linearity of Rdson vs input signal level4) Chanel to channel isolation5) Split supply needed to handle negative going signals, unless youoffset the input signalsTransconducatance amp can be a solution for a V controlled G voltage amplifier -http://www.futurlec.com/Linear/LM13600N.shtmlRegards, Dana.

author: BrianHG
author_rank: Super Contributor
timestamp: March 28, 2017, 02:51:19 am
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: March 28, 2017, 10:20:49 pm
content: Use a programmable gain amplifier.LTC6910-1/2/3http://docs-europe.electrocomponents.com/webdocs/14b7/0900766b814b7ee6.pdfMCP6G01http://docs-europe.electrocomponents.com/webdocs/0cee/0900766b80ceecc3.pdfMCP6S21http://docs-europe.electrocomponents.com/webdocs/1381/0900766b8138169a.pdf

author: bson
author_rank: Unknown
timestamp: March 30, 2017, 04:47:43 pm
content: 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...