# lm358 square wave oscillator but 100khz

Discussion in 'General Electronics Chat' started by witman, Mar 31, 2014.

1. ### witman Thread Starter New Member

Mar 27, 2014
19
0
Hi all,

I have some questions regarding Bob Beck's zapper as described in paper Take back your health. The circuit is as follows:

http://i57.tinypic.com/30svq6v.jpg

Circuit is based on lm358 chip which can act as square wave generator up to 1khz without voltage drop. I need chip that can act as square wave generator up to 100khz with minor voltage drop and two outputs being 180 degrees out of phase . Without going into further details I would like to clarify:
1) output of lm358 - changes polarity with each cycle as it charges capacitor C1 through resistor R1 ?
2) if so, do all op-ams which are set as square wave oscillator change polarity with each cycle ?
3) if so, can two mono op-ams like lm318 be combined to achieve same effect as with lm358 ie. having two outputs being 180 degrees out of phase ?
4) would two comparators like lm311 also be used in this way ?

many tks

2. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,139
1,490
1) It doesn't change polarity, since the 27V opamp supply is a single polarity: rather, it switches alternately above and below the mid-rail voltage (13.5V).
2) If you had a dual polarity supply (say +9V, -9V) then the opamp output would change polarity.
3) You could use two individual opamps instead of a dual.
4) Comparators require pull-up resistors on their outputs and may not have enough current drive capability for this application.

3. ### wayneh Expert

Sep 9, 2010
13,632
4,426
Comparators cannot normally source current, only sink it, so no.

You need a 100kHz square wave generator. What voltage and current do you need?

4. ### AnalogKid AAC Fanatic!

Aug 1, 2013
5,658
1,606
A couple of things. First, this circuit runs at approx. 4 Hz, like Beck's original relay circuit, not 1 KHz. Second, at 1 KHz with a 25 Vp-p output, there will be a noticeable slope to the output wavefore. In other words, it will be less square. This directly affects the number and amplitudes of the harmonics in the output wave.

Yes, most opamps will function as a square wave oscillator in this circuit. And yes, two LM318's can replace the dual 358, but... The LM358 has a unique output stage that lets it swing very close to the negative supply pin. The LM318 is a more traditional opamp and will only get down to around Vee + 2V. So your output wave will be about 2V shorter.

The LM311 is much faster than the 358, and has a similar output stage. An oscillator is shown on page 9 of the attached datasheet. But its output is open-collector, which would change the way the circuit behaves. The 311 is way faster than a 358, so at 1 KHz the output would be much more square. But at 100KHz it has speed problems. The graphs on page 4 indicate that the rise and fall times would combine for about 0.25 us, or 5% of each half-cycle at 100 KHz. Not very square.

What is your final application for this circuit? Is it your intent for the 100KHz to be at 25Vp-p? That is a very different output in terms of its total power and harmonic content.

ak

• ###### LM311-DS005704.pdf
File size:
412.5 KB
Views:
62
Last edited: Mar 31, 2014
5. ### AnalogKid AAC Fanatic!

Aug 1, 2013
5,658
1,606
Alec, this circuit replaces one that used a DPDT relay to reverse the polarity of the 27VDC. Note that the 2nd 358 stage is a simple inverter, and the circuit output is taken from the two 350 outputs (through a resistor for current limiting) so the effective p-p output is approx 50V, sorta.

ak

6. ### witman Thread Starter New Member

Mar 27, 2014
19
0
You guys are GREAT !

Yes I know beck used 4hz. What I am trying to do now is from another study to halt cancer melanoma. It says that melanoma cells can't replicate if placed between alternating electric field, strength 1v/cm and cca. 100 khz frequency as mitosis phase of cells fails.
So what I am trying to do is put 2 light plates on someones chest and back to carry around and hook that up to electronic circuit that meets specification.

Since plates are insulated from body I guess I don't need much current for E field, but getting this 100khz alternatic field is pain in the ass. I used 555 to get nice 100k but it is not alternating field. 318 and 311 as square generators also give nice results (I have oscilloscope) but problem with them is that they are mono and if they are placed in pair (either 318 or 311) output frequency of second chip doesn't match frequency of first chip so I guess signal is not inverted properly and I don't get proper alternating E field.

Can I inverse 100khz output of 555/318/311 to get proper alternating electric field via 2 electrodes. It's quite and important research obviously and I will make sure to inform you about results

7. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,139
1,490
How about this? It uses a CMOS oscillator rather than opamps. Q1 and Q2 act as level shifters. Gates are parallelled to increase current handling (but not really necessary). D1, D2 speed up discharge of transistor base capacitance. D3 gives a 5V supply for the IC. Output voltage is ~100kHz, 50V pk-pk for 100k Rload. Average current consumption is ~4mA. Rload current = 250uA for 100k Rload, 3mA for shorted Rload. Unused gates should have their inputs grounded.

• ###### BiPhaseOsc.gif
File size:
22.6 KB
Views:
118
Last edited: Mar 31, 2014
8. ### witman Thread Starter New Member

Mar 27, 2014
19
0
Tks very much!
Will try that, however I didn't work with CMOS oscillator so far. I found datasheat on CD4016BC here http://www.fairchildsemi.com/ds/CD/CD4016BC.pdf.

Regarding your circuit - if possible I would like clarification:
1) to which pins do Q1, Q2, D1, D2 and D3 exactly refer to ?
2) to which pins do u1a,u1b,u1c and u1d exactly refer to ?

muchos gracias

9. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,139
1,490
Hola,
Here's the circuit with pin numbers shown.
The bar shown on each diode symbol is the cathode and is usually indicated by a coloured band on one end of the actual diode.
The CMOS IC (CD40106) is static-sensitive, so take due precautions when handling it.

CAUTION
As you are probably aware, if you use this circuit for human body experiments you must ensure that any electrodes/pads are constructed and placed such that any electric/electromagnetic field applied to, or current passing through the body is below the relevant recognised maximum safety limit. Do not use this circuit on any person with a heart pace-maker fitted.
You may also need to provide electrical screening to prevent interference between this circuit and others (e.g. patient-monitoring equipment).

File size:
19.8 KB
Views:
74
10. ### wayneh Expert

Sep 9, 2010
13,632
4,426
You might use a 1MHz crystal oscillator for your clock and then divide it down with a counter. I like the 4017 for many things but I'm not sure how it would do at 1MHz. The output of the counter goes from source to sink, so it can provide an alternating polarity. I've used just that feature for a biomedical device. Again, no where near that frequency.

11. ### witman Thread Starter New Member

Mar 27, 2014
19
0
Tks.
I am aware of human safety issues. Allowed voltages and DC/AC current miliamperes are known. Allowed strength of electromagnetic fields also - although they differ from country to country for as much as value of 100 ! For all intends and purposes lets say I am building it for myself.

I apologize for not being professional electrician here (doing it as a hobby), so few additional notes if possible:
1 - output electrodes are ... a and b ?
2 - what 100 kiloohms load mean ?
3 - D3 is diode BZX79C5V1 ?
4 - can't seem to find diode BZX79C5V1 in local shop, would any 5V zener diode work ?
5 - C2 is 22uF (seems little big) ?

Maybe noob questions but just to make sure.

12. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,139
1,490
1) Yes. Points a and b are where you would connect electrodes.
2) 100k is just a dummy value used for simulation purposes. It represents (inaccurately) the impedance that might be presented by the body between the electrodes.
3) Yes, but any zener diode with a voltage rating of 5V-10V would be ok.
4) See 3.
5) Any 10uF-100uF electrolytic cap with a voltage rating > the zener voltage will do.

witman likes this.
13. ### witman Thread Starter New Member

Mar 27, 2014
19
0
Ok, thank you all very, very much.
Will keep you posted how it goes.

14. ### witman Thread Starter New Member

Mar 27, 2014
19
0
Hooked it up yesterday, can't get voltage on any pin beside pin 14.
Tripple checked everything (diode bars, cap +/-, tranzistor BCE orientation, ground...).

Are you sure pin layout is correct ?

According to
http://www.fairchildsemi.com/ds/CD/CD4016BC.pdf

Switch 1: pin 1,2 - control 13
Switch 2: pin 3,4 - control 5
Switch 3: pin 8,9 - control 6
Switch 4: pin 10,11 - control 12

15. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,139
1,490
Oops! My apologies. There's a typo on the schematic. The IC should be CD40106 (not CD4016).

16. ### witman Thread Starter New Member

Mar 27, 2014
19
0
Ok, works !

Although, it seems square wave is not 100% "square" - more like 90% "square" and 10% "saw tooth". When I hook it up to tin plates (chest and back; 0.5mm thick) it looses it's square powers and becomes totally saw tooth. Probably due to inductance of copper wires and plates themselves.

If possible, 2 questions for Sir Alec
1) Is there something I can do to beef up it's square properties ?
2) Frequency of 40106 is determined by resistor and capacitor on pin 12 ?

tks

17. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,139
1,490
1) The lack of squareness of the waveform is due to the capacitance of the probes. Halving the values of R4 and R5 would help to square things up, but would reduce the safety margin. You MUST ensure that hazardous current, e.g. through inadvertent skin penetration by a probe, cannot pass through a person's body. Why is the squareness important?
2) Yes. You could make R1 a 25k variable resistor if required.

witman likes this.
18. ### AnalogKid AAC Fanatic!

Aug 1, 2013
5,658
1,606
The LM358 design had a very low output impedance stage (the two LM358s) followed by a 100K pot in series with the output. This is very similar to Beck's original DPDT relay output stage. The later circuit in this thread has an asymmetrical output impedance, approx. 0 ohms for down edges and 10K ohms for up edges, and no 100K adjustable pot in series with the output. This is why you are seeing a sawtooth wave instead of a trapazoid wave.

Beck doesn't talk about harmonics as much as the Zapper folks do, but his original circuit did have symmetrical rise and fall times that got longer and longer as the output resistance was increased. Of course, nowhere did he say if this was good, bad, or Tuesday.

ak

19. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,139
1,490
That's true for one transistor output; but the probes are being driven as a push-pull pair so there is always effectively 10k in series with them.

20. ### witman Thread Starter New Member

Mar 27, 2014
19
0
Studies in question regarding effect of alternating electric fields are here:
http://www.pnas.org/content/104/24/10152.full
and
http://cancerres.aacrjournals.org/content/64/9/3288.full

Hmm, you are right ! According to study square wave is not mentioned as such. Because of biological and physical processes taking place here (formation of micro tubule being disrupted during mitosis stage of cell) I assumed push-pull effect of square wave would produce better tearing effect than easy-in easy-out effect of saw tooth or sinusoidal.
And yes, I know study was done on mice, but glioma part was on done on humans also and even FDA approved a device. Beck must be turning in his grave by now

Question. Why did you use 2 parallel pairs of inverters 1-2,13-12 and 3-4,11-10 ?

Last edited: Apr 8, 2014