Trying to simulate a square wave. NOT WORKING

In summary: I actually used a pot that is 10 K, but you can use a pot as small as 0.1 K. Try changing R4 to 10K.In summary, the schematic for the square wave oscillator was different from the one provided in the Multism tutorial. The original schematics called for a capacitor to be placed between the inverting and non inverting inputs, but the circuit did not work when connected "lop sided." Two 9-volt batteries were needed in order to power the circuit, and it took a long time to charge the capacitor before the Multivibrator started. The circuit worked well in practice, but it depended on the output either being positive or negative. The LM124 op amp
  • #1
omonoid
18
0
For my extra credit project i am building a simple square wave osc i am trying to simulate the schematics in Multism, a program i just learned today.

Here are the original schematics:
square-wave-generator-_circuit-using-ua741.JPG


more info on the circuit is found http://www.circuitstoday.com/square-wave-generator-using-ua-741"


These are my schematics suppositly replicatinmg the ones above. The ocilliscope just shoots up then remains blank.
or8ntc.jpg


Thanks
 
Last edited by a moderator:
Engineering news on Phys.org
  • #2
You might try two 9-volt batteries, with the midpoint connected to the common ground.

Bob S
 
  • #3
now i just get a straight line
 
  • #4
It seems to me there is a jumper where C1 should be. Did you intend that. If you replace it with a capacitor, does it work?
 
  • #5
no that didnt work i aslo saw that as a possible problem. It is now a cap
 
  • #6
It takes a long time to charge C1 before the multivibrator starts. Wait at least 0.25 sec before starting plot. See thumbnail.

Bob S
 

Attachments

  • 012211.jpg
    012211.jpg
    40.6 KB · Views: 541
  • #7
It also looks to me like you have the inverting and non-inverting inputs reversed from the example.
 
  • #8
omonoid, I just created and ran your circuit and get a beautiful square wave with a frequency of about 210 Hz. I think if you reverse your inputs it will work.
 
  • #9
You build the circuit yet to proof it works? I agree with Bob S that you need to put two 9V battery and put the middle to ground. In your simulation, you don't have a ground reference anywhere. Even if you build the circuit as in the simulation, it won't work. It is different from you drawing with two battery.
 
  • #10
I meant to say I created it in SPICE and I did use two 9 V supplies. Afterward I changed the circuit as little as possible to work off of one supply. See attached.
 

Attachments

  • SquareWave.doc
    43 KB · Views: 249
  • #11
Took me a few, LOL. You DO need two batteries, give this a try.

Fish
 

Attachments

  • OSC.jpg
    OSC.jpg
    59.3 KB · Views: 567
  • #12
With respect, the initial diagram tells you that you need a + and - supply. The input biasing is taken to the Earth point, which is half way between the two supplies. How could anyone be surprised that the circuit didn't work when connected 'lop sided'? These devices have pretty good common mode rejection but give 'em a chance!
 
  • #13
This circuit works well in practice, but it does depend on the output either being positive or negative and a simulator can start up with the output being zero.

I tried this recently and had to deliberately unbalance the circuit by adding a large value resistor from one of the supply rails to the non inverting input.

[PLAIN]http://dl.dropbox.com/u/4222062/square%20wave%20oscillator.PNG
 
Last edited by a moderator:
  • #14
thanks for all the feed back. I would like my final product to have a pot to vary the frequency and one to vary the amplitude. Would i just preplace one of the resistors with a pot to make the freq vary? Also for amplitude would i just wire in a pot before the output?
 
  • #15
First try the extra resistor shown in the previous post to see if you get oscillation.

If you do, then R1 and C control the frequency so it is easiest to make R1 variable.

The voltage at the non inverting input sets the amplitude of the square wave, however adjusting it may cause loss of oscillation.

You could just put a pot (maybe 10 K) from the output of the opamp to ground and take the output from the moving contact and ground. Try simulating it.
 
  • #16
ugh i must suck at simulating. My result was a flat line on the oscillospope

I also noticed its a LM124 op amp. I only have a 741

here is my schemtaics for the simulation

fail.png
 
  • #17
I get delays of a second or so before it starts oscillating.

Can you set your time so that you watch it for 5 seconds?

The actual opamp probably doesn't matter for this simulation.
 
  • #18
Hmm i started at the oscope for like a minute and it was a flat line
 

Attachments

  • f.png
    f.png
    10.3 KB · Views: 515
  • #19
I tried those values and I get a flat line, too. Try 10 K for R2.
 
  • #20
omonoid,

I mean no disrespect, but I downloaded multisim, leaned it and made it work in 2 hours using your OP schematic. I posted the screen shot. Exactly how are you having difficulty with the notion the 741 requires a dual polarity supply when it was part of your OP? Anyway, I hope you get your EC; I did my part for fun, LOL.

Fish
 
  • #21
Fish yours was helplful and worked fine...its the only success I've had. I was just trying to get the schematics vk6kro put up working.

Fish is there a way of reconfiguring yours to only have 1 9v? when i actually build it i don't want to have 2 batteries

Also i threw in a 10k pot in place of your R4 so i can adjust the frequency and it works.

Is there a way of calculating for the right size pot to use? i want it to be able to go from around 100 HZ to 2.5 MHz. The built in oscope doesn't show frequency

I think I am going to stick with Fish's schematic beacuse its the only one working. Thanks! everyone who offered advice
 
  • #22
omonoid,

The 741 REQUIRES a dual polarity supply the way you are using it. You could supply it from a voltage divider, but I would give that design a "zero". If you are looking for "extra credit", earn it, LOL, understand the chip. Take heart in this notion: I have a degree in English Literature, Electronics is just a hobby for me :-) I do thank you for introducing me to multisim, it is very cool!

Fish
 
  • #23
There is no reason any of the opamps should require a dual supply. In fact you should be able to accomplish this with an inverting Schmidt Trigger gate.

One reason your circuit may not be oscillating, or that it takes so long to begin oscillating, is that MultiSim likes to start the simulation with a quiescent voltage applied to the capacitor. Have you tried bringing up the capacitor and setting the initial condition (IC) to zero volts?

I tried your circuit of post #16 and it worked fine. However, in your schematic I don't see any power source for the opamp. If you can replace that opamp with the uA741 in the first post and connect pin 4 to ground and 7 to +9V, does it work?
 
Last edited:
  • #24
Of course that's true but, if you use a single power supply, your biasing has to be modified accordingly. The amplifier amplifies the Difference between - and + inputs so they need to be more or less equal, if the gain is 10,000X. Notice that the 'working' version (above) has its + input biased to half rail volts, which allows it to work with one power supply.

Edit. In the original circuit, if using a single PSU, when the -input goes up, the output will go down and the +input can remain below -input, even when the capacitor has stabilised - you're relying on the op amp functioning properly with inputs right next to the ground and -in can still be higher than +in (not being properly defined). The idea is to operate an op amp with its inputs around half rail so that either can be made higher or lower than the other, in a well defined way.
 
Last edited:
  • #25
I tried incorperating a voltage divider on a 9v so i would have a + and - 4.5v going to the opamp. For some reason the oscope displayed a odd shaped non square wave. What am i doing wrong?
 

Attachments

  • Volt div.png
    Volt div.png
    20.2 KB · Views: 540

1. Why is my square wave simulation not working?

There could be several reasons why your square wave simulation is not working. Some common causes include errors in the code, incorrect input values, or improper implementation of the simulation algorithm. It is important to carefully review your code and check for any potential mistakes.

2. How can I improve the accuracy of my square wave simulation?

To improve the accuracy of your square wave simulation, you can try using a higher sampling rate and increasing the number of iterations in your simulation algorithm. It is also important to make sure that your input values are within the expected range for a square wave signal.

3. Can I use any programming language to simulate a square wave?

Yes, you can use any programming language to simulate a square wave as long as it has the necessary functions and capabilities to handle mathematical operations and generate a signal. Some languages may have built-in libraries or functions specifically for simulating signals, making the task easier.

4. What is the best approach for simulating a square wave?

The best approach for simulating a square wave will depend on your specific goals and the tools available to you. Some common methods include using mathematical equations, digital signal processing techniques, or simulating the circuitry of a square wave generator. It is important to carefully consider your approach and make sure it aligns with your project requirements.

5. How can I troubleshoot my square wave simulation?

If your square wave simulation is not working as expected, there are a few steps you can take to troubleshoot the issue. These include checking for errors in your code, reviewing your input values, and testing different parameters in your simulation. It can also be helpful to consult with other experts in the field or reference resources such as online forums or textbooks.

Similar threads

Replies
16
Views
1K
Replies
9
Views
4K
Replies
1
Views
930
  • Electrical Engineering
Replies
8
Views
5K
  • Electrical Engineering
Replies
4
Views
3K
Replies
5
Views
3K
  • Electrical Engineering
Replies
9
Views
3K
  • Electrical Engineering
Replies
9
Views
4K
Replies
12
Views
2K
  • Electrical Engineering
Replies
5
Views
3K
Back
Top