Electronic – arduino – Need help with use of LM358, microcontroller and +/- power supply

arduinooperational-amplifierpower supply

I have signal in 0-5V range and would like to amplify it to 0-10V. For that I am using LM358, but I have a bit of trouble with that.
I have naively designed the circuit like so:

enter image description here

I tried to supply this amplifier with 9V battery and with +/- 12V source (not stabilised), but none of them worked. Also, I'm not so sure when yo use which ground – where should be the output 'grounded' to? To op amp or the orginal ground? And the resistor on inverting input?


Other question is regarding to powering of the whole circuit from +/- 12V supply. Here is the whole scheme:

enter image description here

I would love to power up the whole thing just from that one source, but there is weird noise at the end of it (without opamp), probably because of missing ground (?). Is there way how to fix that or I must use symmetrical supply with ground?

Thank you very much! I am kind of desperate.

Best Answer

This question appears to have most (most :-) ) of the information required to solve it provided in a clear and well understandable format. This is very welcome and very unusual.

The system is a "sequencer" which sequentially connects a number of potentiometer settings to the output using CD4066 transmission gates. (CD4066 data sheet here )

It has a number of minor but fatal flaws that should be easily fixed. Knowing what it is to be used for, what the stepping rate is and whether at least one output is always enabled would help the solution quality.

Summarised solution - the following may well make all the difference:

  • Super summary

    • "D1-D8" are peak holding the output signal.
      LED1-LE8 are clamping the CD4066 drive signals.
      Actual supply and drive signals need to be checked for relative correctness.

    • Remove output diodes

    • Small cap to ground from IC3A pin 3

    • Arduino Vcc = CD4066 Vdd.

    • If Vcc = Vdd = 3V3 then Vpot_all <= 4V.

    • If Vcc = Vdd = 5V then Vpot_all <= 5V is OK.

    • Remove LED1-LED8 or add 10K series resistors.

    • Operate IC3 from +12V/ 0V supplies.

    • Consider limiting Vpotmax to say 4V to give IC3 headroom.

    • It goes ! :-)

More detail, still summary ...

  • Remove D1-D11 at outputs of CD4066 transmission gates (replace with short circuit.)

  • Place a small capacitor and/or a large resistor on pin 3 of IC3A = input to amplifier. This provides a sample and hold capacitor and a negative reference respectively. Size of cap depends on multiplex rate. May be about 1 nF if rate slowish. Resistor is 1 megohm or higher.

  • If LED1 - LED8 do not have series resistors then provide them or remove LEDs for now while checking this solution. Resistors must be large enough that LEDs only lightly load Arduino D0-D7 outputs. These MUST rise to at least 3.5V during whole of CD4066 on time.

  • CD4066 Vdd is not specified. Please specify. Should be same as Arduino Vcc and not greater.

  • Arduino Vcc and CD4066 Vdd must be the same.
    Pot input voltages must not be > CD4066 Vdd.


DETAILS:

Consider IC1a B C D IC2A B C D to form a multiplexer with 8 inputs and one output Call this mux or separate gates transmission gates 1-8 = TG1-TG8.

LEDS 1 2 3 4 5 6 7 8 are shown with NO series drive resistor and they are clamping the drive lines to the 4066 transmission gates. The 4066 needs a high enable signal of at least 70% of its VCC.

D1 2 3 ? ? ? ? 11 along the bottom (4066 outputs) should not be necessary and are causing problems. The 4th to 7th diodes have multiple symbol assigned and overtyped on the diagram. IF this is on a PCB that has been made there may be connection problems but it's probably just typos.

I'll call the output diodes D1-8 generically.
Short out D1-8 !!!
These act as a peak hold circuit to pin 3 of IC3A with no load so the highest value is stored in stray capacitance and there is no variation at pin 3. A load could be placed on their outputs (IC3a pin 3 to ground) BUT as the transmission gates isolate the pots except when connected the diodes are simply adding an ill defined diode drop with no apparent use. Removal seems fine.

Arduino has "VCC" & 5V & 3V shown at edge connector. Processor MUST be operating from 5V Vcc for this circuit to work as shown, as CD4066 drive signals must be at least 3.5V when it has a 5V Vcc and to switch 5V signals it needs 5V Vcc.If Vcc = 3.3V say pots must not be set above say 4V. (CD4066 will operate on as little as Vdd=3V, fortunately). IF Arduino is operating from Vcc=3.3V you should operate CD4066 on 3V3 as well.

The pots feeding the transmission gates (call them VR1-Vr8) are larger than desirable but this is notchangeable now. This is because the mux samples them and connects them to the sample and hold. It would be "nice" for them to provide a stiff source to feed the mux. There will be some stray capacitance on mux output and this will limit the minimum time taken to assume the new mux value. eg if you have say 100 pF stray capacitance in mux output then with a 50k source input you have time constant t = RC = 50k x 100E-12 = 5 uS. This may be fine if mux switch time (unspecified). As you mention "weird noise" this is presumably meant to operate in audio range. so mux rate = kHz range? If mux rate is too slow input of IC3 MAY drop between mux samples but only if left off for any while (mode of operation is not stated). Adding a capacitor to ground on mux output serves as a sample and hold but with increased effects on loading during sampling.

More ideally pots VR1-8 would be say 10k but this depends on other factors such as mux rate and whether sapling is always immediate or if there are off periods.

Still more ideally [tm] the pots are all buffered with a opamp buffer each (no parts except opamp required - input to non inverting input, output connected to inverting input). With this arrangement the mux output is driven to selected input by opamp driving into output capacitance - very fast. Depends on mux rate. probably fine for this application.


Questions:

What is Arduino Vcc voltage?

What is CD4066 Vdd voltage?

What is multiplex switching rate (time per step)?

Are there really no series LED resistors?

What is this used for?