Correct way to turn on and off a sine wave

GopherT

Joined Nov 23, 2012
8,009
Where is the Q2 gate attached relative to your newly added 10k resistor. That is, post an updated version of your schematic.
 

GopherT

Joined Nov 23, 2012
8,009
I have uploaded an updated version of circuit
Thanks!
Are you bit-banging the arduino on/off or using built in PWM? (I am assuming you are talking about Pwm in your previous posts, not PWN as you wrote.

If you are but-banging, you can do what you need with two resistors.
When the output weinbridge wave is desired, set arduino pin to INPUT and no current will flow to that pin and full output signal will appear at the J4 output.
When you don't want signal at the J4 output, set the Arduino pin to Output and value Pin = 0.

You will see an 80 mV version of your signal when "off" but that shouldn't be broadcast. If it is a problem, increase the value of the other 15k resistor.

image.png
 

Thread Starter

Horacio Dos

Joined Dec 28, 2016
14
Yes, you are right. It is PWM. My mistake! (Pulse Modulation) As english is not my mother language, a big part of my mind was trying to write correctly. Good to know! I didn't know I was doing bit-banging with pyserial in python.
I'll try your solution.
Thanks!
 

Thread Starter

Horacio Dos

Joined Dec 28, 2016
14
Hello:

After trying to turn on and off the op-amp ground with a relative success (the wave was distorted. Image attached) I went back to the original design but I've made a few changes. (Image attached)

a) The op-amp is a LM358 instead of a LM741.
b) R1, R2 are now 2kΩ trimpots, now I can adjust the wave's amplitude and fix distorsions.
c) Now arduino's pin is always high so the wave is always turned off. To turn it on, the pin is set to low.
d) I added a speaker and removed useless jumpers.

Now I can turn on and off the op-amp output without modifing the sine wave. There's an image attached. but there are two issues I would like to fix.

1) There is always a small current flowing in Q2 of about 140mV (I'm sure it's obvious for many people, I starting to understand how different transistors work) How can it be suppresed? (Image attached)

2) I can't hear the wave through the speaker.

Thank you all for your help.
 

Attachments

GopherT

Joined Nov 23, 2012
8,009
You cannot hear it because you have a 1 or 2V peak to peak voltage from the op amp and a 15k ohm speaker in series with your signal and another 180 ohms from the 1uF cap at your operating frequency. Calculate how many watts you are getting from an 8 ohm speaker (or what ever speaker resistance you do have).
 
Top