5
\$\begingroup\$

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.

\$\endgroup\$
4
  • 2
    \$\begingroup\$ Can you clarify what you mean by "none of them worked"? How did you test the circuit? What happened? Your first circuit, as drawn, looks like it should work OK with +/-12V supplies. \$\endgroup\$
    – MattyZ
    Commented Jan 17, 2012 at 20:35
  • 2
    \$\begingroup\$ "None of them worked" is pretty useless information, as you should have been able to tell for yourself. \$\endgroup\$ Commented Jan 17, 2012 at 20:40
  • \$\begingroup\$ Sorry, by none of them worked I mean I didn't get any amplification - just the same signal on the output as on the input. \$\endgroup\$
    – mrkva
    Commented Jan 17, 2012 at 20:57
  • 1
    \$\begingroup\$ You are asking questions about the power supply, but your schematic shows no power supply at all? \$\endgroup\$
    – markrages
    Commented Jan 17, 2012 at 21:32

4 Answers 4

4
\$\begingroup\$

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?

\$\endgroup\$
8
  • \$\begingroup\$ Well the part before opamp is working quite well. I measured the voltages and they seem stable and in good range (0 - 4.5V). Are you sure I should modify it? \$\endgroup\$
    – mrkva
    Commented Jan 17, 2012 at 22:49
  • \$\begingroup\$ 4066 is powered by the same power as arduino is. \$\endgroup\$
    – mrkva
    Commented Jan 17, 2012 at 22:50
  • \$\begingroup\$ But thank you very much, anyway :) \$\endgroup\$
    – mrkva
    Commented Jan 17, 2012 at 22:52
  • \$\begingroup\$ To your questions: Vcc of Arduino is now 9V (battery), because it gives me most 'stable' results so far. CD4066 is powered from Arduino itself (as the whole part before opamp), so therefore 5V. Switching rate - I am not sure, but for my use it is fast enough. I don't know what you mean byt series LED resistors :( I am beginner in this field. And the whole circuit is used as step-sequencer for modular synthesizer. These synthesizers are using 0-10V range for control. For example you can create melody when you connect output to frequency control of oscilator. \$\endgroup\$
    – mrkva
    Commented Jan 17, 2012 at 23:07
  • \$\begingroup\$ @Russell McMahon Nice answer! The only thing I wonder about in removing the diodes is this: if the pot going into one 4066 is set turned up all the way to Vcc, and the pot of a neighboring 4066 is down at ground, if the switching between two adjacent 4066s is not completely break before make there will be essentially a short between power and ground. Some series resistance on each side of every pot would also address that issue. \$\endgroup\$
    – MattyZ
    Commented Jan 17, 2012 at 23:26
2
\$\begingroup\$

Since your signal is only above ground, and the LM358's common mode input range includes ground, you don't need a negative supply. Connect the opamp's negative supply pin to ground and the positive supply to +12V. (You need at least 12V because the LM358's output won't swing all the way to the positive rail.)

\$\endgroup\$
2
\$\begingroup\$

EDIT - you say the gain of the opamp is okay. Looking at the rest of the circuit, I agree with Russell completely - it needs fixing, follow his instructions and it will work (if there are no other hidden problems)

Also, you need to get your power supply right - as you don't actually show a power supply it's impossible to know what you are doing currently (for the components not connected to the arduino 5V line)
There is nothing connected to the ground ports on the Arduino apart from the top pots. You have a ground symbol (marked "GND") connected to e.g. the LEDs, etc but where is the common connection to the Arduino?
Updating your schematic to show everything exactly as is regarding power supply connections would be very useful (i.e. add Arduino power source, opamp and 4066 power pins/connections, etc)

I'll leave the below opamp gain section here anyway. It would be worth fixing the schematic to include junction dot to indicate things clearly.

You say you want to change 0V-5V to 0V-10V, so you need a gain of 2.

Now the opamp circuit you have shown should give a gain of 2, but it doesn't. Why?

My suspicion is that the junction dot between R1, R2 and opamp inverting input was missed out on the schematic, so there is no connection on the final board.
I checked the large version and looked at another junction. You can clearly see the junction dot between the 100K pot and S1, but none at R1-R2:

No Junction

The lack of a dot may mean that R1 is not connected (only R2) which will give the opamp a gain of 1, not 2.

This is just a guess as I don't know eagle well enough to tell whether it should be like that if the nodes of a component are directly together.
Anyway, it's worth checking to see if you have connectivity between opamp inv and R1.

\$\endgroup\$
3
  • \$\begingroup\$ Oh, I am connecting it. It is my mistake in the scheme, sorry for confusion. \$\endgroup\$
    – mrkva
    Commented Jan 18, 2012 at 0:09
  • \$\begingroup\$ @Oli Glaser - his amplifier is fine enough if built as shown. The key isue which he seems resistant to acknowledging, so far, is the circuitry that drives it. As shown it is unable to meet his requirement. \$\endgroup\$
    – Russell McMahon
    Commented Jan 18, 2012 at 3:41
  • \$\begingroup\$ @Russell - I didn't look at the rest of the circuit before (rushing) Having a look now I agree that regardless of whether the opamp is wired for gain of 1 or 2 (apparently 2) the rest of the circuit needs fixing also. \$\endgroup\$
    – Oli Glaser
    Commented Jan 18, 2012 at 7:01
0
\$\begingroup\$

I can't read what those ICs are at the bottom of your second circuit, but I think the diodes coming into the opamp input will be a problem. The LM358 needs to sink a current out of its inputs to work - it doesn't look like with your current arrangement that current has anywhere to go.

\$\endgroup\$
6
  • \$\begingroup\$ The diodes at the bottom are 1N4148. They are supposed to 'isolate' the outputs of the previous inputs (it is a trick I found somewhere). \$\endgroup\$
    – mrkva
    Commented Jan 17, 2012 at 20:59
  • \$\begingroup\$ And the IC's are 4066 switches. \$\endgroup\$
    – mrkva
    Commented Jan 17, 2012 at 21:05
  • \$\begingroup\$ @mrkva Try putting a 100k resistor from the opamp non-inverting input to ground. That will give the opamp's input current a return path. \$\endgroup\$
    – MattyZ
    Commented Jan 17, 2012 at 21:22
  • \$\begingroup\$ And power it from 9V battery or 12 +/- ? Or two 9V batteries? \$\endgroup\$
    – mrkva
    Commented Jan 17, 2012 at 21:30
  • \$\begingroup\$ @mrkva As markrages has added, you don't need the negative supply. You can just power it from the positive 12V supply. \$\endgroup\$
    – MattyZ
    Commented Jan 17, 2012 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.