Author Topic: Begginer exercises/challenges and DC to AC  (Read 27389 times)

0 Members and 1 Guest are viewing this topic.

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Begginer exercises/challenges and DC to AC
« on: July 02, 2010, 06:16:21 pm »
Hello everyone !

Even though I follow the EEVblog in Youtube for a while, I only registered in the forum today.
And to start, would like to post 2 questions at once if I may:

1st. : I Just finished my first semester in Electronics Engineering. But I'm not feeling very confident about what I've learned. So I decided to search for more exercises around the web. But, because of me or because of her (web :D), I can't find any.

I'm looking for the kind of challenging exercise, but something with a solution to finally see if I did it well.
  Something along the lines of: "Design a circuit that makes this..."
  Or something into Circuit Analysis.
(Note: I have a book which name is: "Introduction to Electric Circuits" written by Richard C. Dorf and James A. Svoboda.
But I've done most of the exercises there and I'm kind of tired of doing exercises only from it).


My current knowledge in electronics is fairly limited in terms of analysis (and understanding), I can only analyse:
 -Resistors
 -Capacitors
 -Coils
 -OpAmps
 - vDC / iDC  sources
 - VAC / IAC sources
 - current controlled DC voltage sources
 - voltage controlled DC voltage sources
 - current controlled DC current sources
 - voltage controlled DC current sources

(So this is where I can go right now to solve exercises)

If any one knows where I can see some nice exercises, please let me know! I still believe around somewhere in the net there is a site with some :D .

The second question is:

Because in practice I "know" a bit more than in theory, I tend to do experiences with components I don't really know much about in terms of calculations.
So the day I was playing around with an AC to DC adaptor, I was looking at the circuit seeing how it was done and saw some diodes in a "diode bridge" configuration, which "I know" cuts the AC wave into a "DC" wave (not a pure DC but at least is always positive or zero xD). Decided to hack it so I could get the 50 Hz wave in AC out of it. Was successful. So I know from AC to "DC" I "just" need a diode bridge and it's done. My problem is:

What if I have only a DC source available??
How will I get an oscillating wave if I need one?

Already tried to figure it out but can't. I can do an oscillation with a capacitor, a resistor and a coil, but it will fade with time if I don't "charge" the coil with DC again.
So with these components, is it possible in any way I'm not seeing, to make an oscillator for example to create the 50 Hz wave again?
(Note: I saw this article http://en.wikipedia.org/wiki/Wien_bridge_oscillator    but didn't quite understand it, which is making me a bit nervous xD ).


Well, let me finish this,sorry for the long post and thank you in advance for the space to place the newbie questions!

krd777
 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #1 on: July 02, 2010, 06:43:42 pm »
ask your lecturer or senior for previous exam questions, those will more likely to come out in your next exam. answer questions in the suggested books by your lecturer. if you can do around 7 questions of the same type, move on to the next type/topic. maybe off topic, but only my advice.... study smart, dont study hard. tired of answering questions is an indication of study hard. fun of answering and understanding is the study smart.

if you move quickly, you'll reach an op-amp topic which the wiki link you have provided. probably you'll learn that in your 3rd year. but well, i'm not EE certified, someone may answer your questions more correctly. Dave might have clue on how to quick learn things as he graduated earlier than should be.


Hey shafri!

Many thnks for the answer!
The previous exams I have already done them :D and the suggested book is the one I said in the previous post too. i get your idea on the smart studying and believe me, that's how i like to do it, but because I'm starting to lack new exercises, it is getting boring and entering the "study hard" field you say.
Still many thanks for the head up on the studying strategy! ;)
 

Offline cybergibbons

  • Frequent Contributor
  • **
  • Posts: 400
Re: Begginer exercises/challenges and DC to AC
« Reply #2 on: July 02, 2010, 08:24:10 pm »
DC->AC is performed by an inverter and is quite a bit more complex than a bridge rectifier.

A quick google will show how they work - making a square wave one is quite easy. Sine wave is much harder.
 

Offline DJPhil

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: 00
Re: Begginer exercises/challenges and DC to AC
« Reply #3 on: July 02, 2010, 11:47:47 pm »
(Note: I saw this article http://en.wikipedia.org/wiki/Wien_bridge_oscillator    but didn't quite understand it, which is making me a bit nervous xD ).

I'm working on an adjustable wien bridge myself for audio testing. These oscillators were the best way to make tunable, very low distortion sine wave for decades before digital synthesis. With good parts and good filtering it's possible to make a fixed frequency version with distortion too low to measure. This is, of course, overkill for my needs, but it sounded like a fun project. :)

Here's a few links that might help.
Bobsdata Build
ESP Sinewave Oscillator Article
ESP Wien Bridge Build

For general online resources, there's an older thread where we collected enough to keep you busy for a while. My advice is keep tinkering. Take stuff apart and make new stuff. It's great fun! :D
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20657
  • Country: gb
  • 0999
Re: Begginer exercises/challenges and DC to AC
« Reply #4 on: July 03, 2010, 12:21:11 am »
Does it need to be a sinewave or will square or modified sine wave do?

What's the input/output voltage?

How much current do you need?

Does the frequency need to be accurate?

Do you need the output to be isolated from the input?

If it's just a rough squarewave you need and accuracy and isolation aren't required and the input voltage is the same as the output, it's pretty straightforward, you can use a four transistors configured as an h-bridge which doubles as an astable multivirbator.
 

Offline Zad

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: gb
    • Digital Wizardry, Analogue Alchemy, Software Sorcery
Re: Begginer exercises/challenges and DC to AC
« Reply #5 on: July 03, 2010, 01:26:40 am »
Have patience young padwan! At the moment you have been given a couple of vowels and a handful of consonants and you are trying to write a book. Building oscillators will be much easier when you have covered more active components. Oscillator design is far from basic first semester electronics!

Offline KTP

  • Frequent Contributor
  • **
  • Posts: 512
Re: Begginer exercises/challenges and DC to AC
« Reply #6 on: July 03, 2010, 05:21:58 am »
He has had resistors, capacitors and op-amps.  That is enough to build and understand a simple relaxation oscillator.

OP:  Download LTspice and play with it a bit.  It is free and very cool.  Here, I have attached a simple op-amp relaxation oscillator you can build in 30 minutes using a simple 741 type op-amp and a few resistors and caps.  You can also simulate it in LTspice if you don't want to build it (but then you will miss the blinky LED  :D )

The extra diode is because the 741 will not pull low enough to completely turn off the led (there may have been a better way but this was quick and dirty).

 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20657
  • Country: gb
  • 0999
Re: Begginer exercises/challenges and DC to AC
« Reply #7 on: July 03, 2010, 04:14:53 pm »
The LM393 ir LM311 is a better choice than the 741 because it's designed to be a comparator.

Another option is the astable multivibrator with a couple of transistors.

http://en.wikipedia.org/wiki/Astable_multivibrator#Astable_multivibrator_circuit

Here's the h-bridge version I discussed in my previous post. In this case it's used to make a speaker go beep when run from a single AA cell but it can be modified to give a different frequency and run at higher voltages.


http://www.silicontronics.com/index.php?action=ezportal;sa=page;p=28

EDIT:
Image tags.
« Last Edit: July 03, 2010, 04:16:52 pm by Hero999 »
 

Offline KTP

  • Frequent Contributor
  • **
  • Posts: 512
Re: Begginer exercises/challenges and DC to AC
« Reply #8 on: July 03, 2010, 11:38:45 pm »
The LM393 ir LM311 is a better choice than the 741 because it's designed to be a comparator.

He mentioned op-amps as being in his knowledge bag of tools so I was trying to keep it using parts he was familiar with.  Anyway, the circuit I posted works with the 741 being slammed around like a comparator.

If he has not had an intro course on transistor analysis, he may not be able to analyze the other oscillator circuits, but the relaxation oscillator is pretty dang simple.  The thing I like about LTspice is you can view what is happening at each node....ie in the circuit you can view the charge/discharge of the capacitor connected to the inverting terminal of the op-amp.
« Last Edit: July 03, 2010, 11:43:48 pm by KTP »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20657
  • Country: gb
  • 0999
Re: Begginer exercises/challenges and DC to AC
« Reply #9 on: July 04, 2010, 12:52:11 am »
The 741 is obsolete, of  course it works but there are much better options available which are probably also cheaper too. I suppose the point I was making is that too many nubes get introduced to comparators with the 741 being given as an example which is bad in my opinion because it's not designed for it, yes it does work but it's poor.

I do admit that I have loads of 741s in my junk box, which I'll never use.

There's a very good explanation for the transistor astable I posted in the Wikipedia article I linked to.

Oh and by the way, R3 isn't needed in the circuit you posted, if you increase R2 to 82k and R5 to 27k.
 

Offline KTP

  • Frequent Contributor
  • **
  • Posts: 512
Re: Begginer exercises/challenges and DC to AC
« Reply #10 on: July 04, 2010, 01:02:06 am »
The 741 is obsolete, of  course it works but there are much better options available which are probably also cheaper too. I suppose the point I was making is that too many nubes get introduced to comparators with the 741 being given as an example which is bad in my opinion because it's not designed for it, yes it does work but it's poor.

I do admit that I have loads of 741s in my junk box, which I'll never use.

There's a very good explanation for the transistor astable I posted in the Wikipedia article I linked to.

Oh and by the way, R3 isn't needed in the circuit you posted, if you increase R2 to 82k and R5 to 27k.

I agree, the 741 is poor but it was what we were given in our intro circuits class lab and is what I designed the led flasher with at the time.  R2 and R5 were representing a potentiometer I had in the real circuit to somewhat adjust the duty cycle of the led (so it would be on for a shorter time than it was off).
 

Offline jh

  • Newbie
  • Posts: 5
Re: Begginer exercises/challenges and DC to AC
« Reply #11 on: July 04, 2010, 05:39:28 pm »
If you are using a Mac, there is an app called MacSpice for circuit design.
[tossing that in to add to the knowledge pool, not to start an OS flame]
 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #12 on: July 04, 2010, 08:54:58 pm »
Hi everyone and thank you very much for the attention and information on the subjects I mentioned in my first post!

Just to let you guys know I didn't answer because I was out for the weekend, but I'm back now and will read this as soon as possible! Already read those infos about LTSpice (I'm using Orcad 10 PSpice Demo right now, it's a student version) and the relaxation oscillator, but I'm intending to quote some of you and give proper answers.

So, again, many thnks and I'll be back in a few hours to digest all the knowledge!

krd7
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20657
  • Country: gb
  • 0999
Re: Begginer exercises/challenges and DC to AC
« Reply #13 on: July 04, 2010, 09:38:20 pm »
LTSpice comes with an example of the astable multvibrator: LTpice\examples\astable.asc

Attached is the LTSpice file for the circuit I posted previously. You might have to download the models for the transistors I've used but I can't remember whether they come with LTSpice. If this is inconvenient, try replacing them with 2N2222 for NPN and 2N2907 for the PNP transistors but the performance isn't as good, especially at lower voltages.
 

Offline KTP

  • Frequent Contributor
  • **
  • Posts: 512
Re: Begginer exercises/challenges and DC to AC
« Reply #14 on: July 05, 2010, 05:28:22 am »
Oh by the way, I wrote a tutorial for the intro class when I took it on how to add a device model to LTspice.  This was the way I did it although there are probably easier ways.  Here is what I wrote back then to add a 741 op-amp model to the LTspice library so we could use it in simulations:



 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #15 on: July 05, 2010, 01:55:56 pm »
Hi again everyone!

Quote
Posted by: cybergibbons
DC->AC is performed by an inverter and is quite a bit more complex than a bridge rectifier.

A quick google will show how they work - making a square wave one is quite easy. Sine wave is much harder.

Yes, already saw that cybergibbons! It's quite more complex to go from DC to AC rather than the reverse.


Quote
Posted by: DJPhil

Here's a few links that might help.
Bobsdata Build
ESP Sinewave Oscillator Article
ESP Wien Bridge Build

For general online resources, there's an older thread where we collected enough to keep you busy for a while. My advice is keep tinkering. Take stuff apart and make new stuff. It's great fun! Cheesy

Thank you very much for the links DJPhil! That older thread is great and has a lot of link contributions from a lot of users! I should have searched better here! Thanks!


Quote
Posted by: Zad
Have patience young padwan! At the moment you have been given a couple of vowels and a handful of consonants and you are trying to write a book. Building oscillators will be much easier when you have covered more active components. Oscillator design is far from basic first semester electronics!

Ahah xD But you know how hard you want to run when you just started walking :D Not too worried about the oscillator, but was a question that emerged when analysing the diode bridge in the AC to DC circuit.


Quote
Posted by: KTP
OP:  Download LTspice and play with it a bit.  It is free and very cool.  Here, I have attached a simple op-amp relaxation oscillator you can build in 30 minutes using a simple 741 type op-amp and a few resistors and caps.  You can also simulate it in LTspice if you don't want to build it (but then you will miss the blinky LED  Cheesy )

Hey KTP! Just downloaded and installed the LTspice software! It's great! Very straightforward and very easy to aply the knowldge I have in OrCad 10. I'll start looking at the relaxation oscillator very soon today!


Quote
Posted by: Hero999
Another option is the astable multivibrator with a couple of transistors.

http://en.wikipedia.org/wiki/Astable_multivibrator#Astable_multivibrator_circuit

Here's the h-bridge version I discussed in my previous post. In this case it's used to make a speaker go beep when run from a single AA cell but it can be modified to give a different frequency and run at higher voltages.


http://www.silicontronics.com/index.php?action=ezportal;sa=page;p=28

Those designs are quite interesting Hero999! I will dig more into transistors in terms of analysis so I can try to understand it better using LTspice also for aid.


Quote
Posted by: shafri
ahh shoot!!! now everybody is giving answer! he asked for questions, not answers. well ok, if you are still not confident, if i remember myself, when looking at those schematic, i was wondering, how the hell on earth u741 op-amp looks like! so, what you have to do, find something like the picture below (the right one, not the left one... is another logic chip, not op-amp) from local electronic shop, find datasheet for it in the net (type in google "741 datasheet") or at http://www.datasheetcatalog.com, and see how its connected to other components in real life.

xD shafri !  Alright, seems like it's simple for datasheet gathering at the places you mentioned. Just search for the component "reference?" and we just get all the details! Looks great!

Quote
Posted by: jh
If you are using a Mac, there is an app called MacSpice for circuit design.
[tossing that in to add to the knowledge pool, not to start an OS flame]

:S No I'm using PC, but still thanks for the info jh!


Quote
Posted by: Hero999
LTSpice comes with an example of the astable multvibrator: LTpice\examples\astable.asc

Attached is the LTSpice file for the circuit I posted previously. You might have to download the models for the transistors I've used but I can't remember whether they come with LTSpice. If this is inconvenient, try replacing them with 2N2222 for NPN and 2N2907 for the PNP transistors but the performance isn't as good, especially at lower voltages.

I'm going to take a look at it, just need to get some more info about transistors first ;)


Quote
Posted by: KTP
Oh by the way, I wrote a tutorial for the intro class when I took it on how to add a device model to LTspice.  This was the way I did it although there are probably easier ways.  Here is what I wrote back then to add a 741 op-amp model to the LTspice library so we could use it in simulations:

Awesome! i haven't checked yet on the presence of all the components i need but will do, and in case they're not here, I'll try to add them that way ;)


Thank you very much everyone! This is just what I expected from this forum, a great load of useful information!
I'll get back here after I've properly checked the oscillators you guys presented. Probably will start on the relaxation first because I know all the components,. and then advance to the astable multvibrator after I get the transistor info ;)
 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #16 on: July 06, 2010, 08:19:05 pm »
Hey again everyone!

Already got the Relaxation OpAmp circuit working with the help of KTP's schematics! Thank you very much!

Didn't do the analysis yet, but already got that the capacitor plays a big role on the frequency of the square wave.
What I'm not getting is the R3 resistor. Probably some kind of OpAmp circuit I'm forgetting here. I'll do a review on the OpAmp matter because this is the kind of doubts I'm worried about.

And again, thank you guys for everything.

P.S.: LTspice is awesome!!! ahah xD
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20657
  • Country: gb
  • 0999
Re: Begginer exercises/challenges and DC to AC
« Reply #17 on: July 06, 2010, 08:33:50 pm »
R3 provides hysteresis, look up Schmitt trigger.
 

Offline KTP

  • Frequent Contributor
  • **
  • Posts: 512
Re: Begginer exercises/challenges and DC to AC
« Reply #18 on: July 06, 2010, 09:09:22 pm »
The cool thing about op-amp circuits is you can usually analyze them using the ideal model, where you assume that Vin- = Vin+ and that no current flows into either input terminal.

In this case, the capacitor voltage is presented to the inverting terminal (negative terminal).  The capacitor is charged (and discharged) through R1 which is in the negative feedback path (it goes from the output of the op-amp back to the inverting input terminal).   When the voltage at the Vin+ terminal is higher than the voltage at the Vin- terminal, the op-amp tries really really hard to equalize these by increasing it's output (all the way up to near Vcc in this case).  This causes the capacitor to charge through R1 (which gives you a time constant of t = R1*C) until the point that the voltage at the capacitor (which is also the voltage presented to Vin-) is equal to Vin+ which at this point is the op-amp "high" output modified by the resistors R3, R5, R1 and R2 (see note below about R1 and R2).  The op-amp then swings it's output to low (which is near ground in this case) causing the now charged capacitor to start discharging through R1 (the time constant is still R1*C).  At first you would think that the capacitor would discharge a tiny amount and then Vin- would be back below Vin+ but ahah! R3 has also linked the output to Vin+ such that when the op-amp output went low Vin+ also went quite a bit lower and thus the capacitor has to discharge for quite some time before Vin- is indeed below Vin+.  At that point the whole cycle starts over again.


In short, Hero's answer was much cleaner...R3 provides hysteresis  ;D


*note about R1 and R2
In my breadboarded circuit I had R1 and R2 actually as a potentiometer which *biased* the op-amp such that I could operate it from a single supply (a 9 volt battery).   At the point where R1 = R2, if they are much smaller than R3 and R5, the capacitor charges and discharges around a voltage level centered at Vcc/2 and thus you do not need to have a negative supply for the op-amp (and need two batteries, blah blah blah).  If you tweaked the R1 and R2 ratio you could shift the duty cycle somewhat and get a pulse that was on for a shorter amount of time than it was off.
« Last Edit: July 06, 2010, 09:26:45 pm by KTP »
 

Offline KTP

  • Frequent Contributor
  • **
  • Posts: 512
Re: Begginer exercises/challenges and DC to AC
« Reply #19 on: July 06, 2010, 10:48:29 pm »
Ok, I just had another idea for a better way to control the duty cycle in the relaxation oscillator circuit I posted.

I am going to assume you have had a bit of study of diodes, but if not, then a simple explanation is that they are a one way "valve" that only lets current flow significantly in one direction.  A simple diode model that will work for a ton of analysis applications is to use this ideal one way valve diode concept in series with an opposing voltage source such that there is a constant voltage drop in the direction of current flow.  Most texts use a value in the range of 0.6 to 1 volt for this constant voltage drop model.

In this slight modification of our op-amp relaxation oscillator I have replaced the negative feedback resistor which both charged and discharged the capacitor with two resistors and two diodes.  Now the capacitor charges through the 10K resistor but discharges through the 100K resistor.  Pretty neat.

Well, I have to do some yard work now..enough goofing off.

Here is the circuit (note I extended the simulation time to catch the rather long period the oscillation has now):
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20657
  • Country: gb
  • 0999
Re: Begginer exercises/challenges and DC to AC
« Reply #20 on: July 07, 2010, 10:30:10 am »
Why not simply use a CMOS Schmitt trigger?

Here's an example demonstrating variable duty cycle with minimal components. It even does away with the current limiting resistor and takes advantage of the restricted output current from the CMOS output.

Of course, it's possible to omit the diodes and just have a single resistor and capacitor.

The simple Schmitt trigger oscillator is less accurate than the op-amp as the hysteresis on each IC is not exactly the same but it will work up to a higher frequency and is easier to make.

EDIT:
Here's another circuit which works on the same principle and the frequency is also variable. This time three NOT gates form the Schmitt trigger, P1 varies the hysteresis and therefore the frequency and P2 varies the duty cycle. P1 should be logarithmic as the frequency vs resistance relationship is non-linear. This circuit is more accurate than the simple Schmitt trigger circuit but it's more complicated.
« Last Edit: July 07, 2010, 11:09:22 am by Hero999 »
 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #21 on: July 07, 2010, 06:05:18 pm »
Hi everyone!

Here I am again! xD

Quote
Posted by: Hero999
R3 provides hysteresis, look up Schmitt trigger.

Hey Hero999!
Looked up Schmitt trigger in wikipedia: http://en.wikipedia.org/wiki/Schmitt_trigger

Quoting:
[...]The comparator extracts the sign  of the difference between its two inputs. When the non-inverting (+) input is at a higher voltage than the inverting (?) input, the comparator output switches to +VS, which is its high supply voltage. When the non-inverting (+) input is at a lower voltage than the inverting (?) input, the comparator output switches to -VS, which is its low supply voltage. In this case, the inverting (?) input is grounded, and so the comparator implements the sign function – its 2-state output (i.e., either high or low) always has the same sign as the continuous input at its non-inverting (+) terminal. [...]
   A Schmitt trigger is a bistable multivibrator, and it can be used to implement another type of multivibrator, the relaxation oscillator. This is achieved by connecting a single resistor–capacitor  network to an inverting Schmitt trigger – the capacitor connects between the input and ground and the resistor connects between the output and the input. The output will be a continuous square wave whose frequency depends on the values of R and C, and the threshold points of the Schmitt trigger. Since multiple Schmitt trigger circuits can be provided by a single integrated circuit (e.g. the 4000 series CMOS  device type 40106 contains 6 of them), a spare section of the IC can be quickly pressed into service as a simple and reliable oscillator with only two external components.
Output and capacitor waveforms for comparator-based relaxation oscillator.[...]

Got it ;)


Quote
Posted by: KTP
The cool thing about op-amp circuits is you can usually analyze them using the ideal model, where you assume that Vin- = Vin+ and that no current flows into either input terminal.

In this case, the capacitor voltage is presented to the inverting terminal (negative terminal).  The capacitor is charged (and discharged) through R1 which is in the negative feedback path (it goes from the output of the op-amp back to the inverting input terminal).   When the voltage at the Vin+ terminal is higher than the voltage at the Vin- terminal, the op-amp tries really really hard to equalize these by increasing it's output (all the way up to near Vcc in this case).  This causes the capacitor to charge through R1 (which gives you a time constant of t = R1*C) until the point that the voltage at the capacitor (which is also the voltage presented to Vin-) is equal to Vin+ which at this point is the op-amp "high" output modified by the resistors R3, R5, R1 and R2 (see note below about R1 and R2).  The op-amp then swings it's output to low (which is near ground in this case) causing the now charged capacitor to start discharging through R1 (the time constant is still R1*C).  At first you would think that the capacitor would discharge a tiny amount and then Vin- would be back below Vin+ but ahah! R3 has also linked the output to Vin+ such that when the op-amp output went low Vin+ also went quite a bit lower and thus the capacitor has to discharge for quite some time before Vin- is indeed below Vin+.  At that point the whole cycle starts over again.


In short, Hero's answer was much cleaner...R3 provides hysteresis  Grin


*note about R1 and R2
In my breadboarded circuit I had R1 and R2 actually as a potentiometer which *biased* the op-amp such that I could operate it from a single supply (a 9 volt battery).   At the point where R1 = R2, if they are much smaller than R3 and R5, the capacitor charges and discharges around a voltage level centered at Vcc/2 and thus you do not need to have a negative supply for the op-amp (and need two batteries, blah blah blah).  If you tweaked the R1 and R2 ratio you could shift the duty cycle somewhat and get a pulse that was on for a shorter amount of time than it was off.

Hey KTP! Awesome explanation! After reading the wiki and reading this it became very clear how this is working. 
Funny I was observing (and then felt stupid for only reading the note after :D ahah) that the resistors on the voltage divider in Vin+ have a role on the duty cycle. If I lower R2, the ON time gets shorter. The other way around if I increase it.
I already have the components, but decided to put a 10k potentiometer there to change the duty cycle.
Variable capacitors for C1 are too small, the biggest I could find is 120pF, so I think I'll change the resistor that "charges" C1, to a potentiometer too so I can change frequency easier.

P.S.: Yes, OpAmps are great, this one LT1001 (LM741) is great I think, at least i was testing by doing the calculations on paper first and then making the simulation to see how close they were and it was perfect!

Quote
Posted by: KTP
Ok, I just had another idea for a better way to control the duty cycle in the relaxation oscillator circuit I posted.

I am going to assume you have had a bit of study of diodes, but if not, then a simple explanation is that they are a one way "valve" that only lets current flow significantly in one direction.  A simple diode model that will work for a ton of analysis applications is to use this ideal one way valve diode concept in series with an opposing voltage source such that there is a constant voltage drop in the direction of current flow.  Most texts use a value in the range of 0.6 to 1 volt for this constant voltage drop model.

In this slight modification of our op-amp relaxation oscillator I have replaced the negative feedback resistor which both charged and discharged the capacitor with two resistors and two diodes.  Now the capacitor charges through the 10K resistor but discharges through the 100K resistor.  Pretty neat.

Well, I have to do some yard work now..enough goofing off.

Ahahah! That way makes it "simpler" to get, I like it pretty much, very neat indeed! I didn't get to diodes yet :S but yes, not hard at all to understand with that explanation!


Quote
Posted by: Hero999
Why not simply use a CMOS Schmitt trigger?

Here's an example demonstrating variable duty cycle with minimal components. It even does away with the current limiting resistor and takes advantage of the restricted output current from the CMOS output.

Of course, it's possible to omit the diodes and just have a single resistor and capacitor.

The simple Schmitt trigger oscillator is less accurate than the op-amp as the hysteresis on each IC is not exactly the same but it will work up to a higher frequency and is easier to make.

EDIT:
Here's another circuit which works on the same principle and the frequency is also variable. This time three NOT gates form the Schmitt trigger, P1 varies the hysteresis and therefore the frequency and P2 varies the duty cycle. P1 should be logarithmic as the frequency vs resistance relationship is non-linear. This circuit is more accurate than the simple Schmitt trigger circuit but it's more complicated.

Now this one is out of my knowldege at this time, but I'll take a look into it today and understand it, looks very nice and "sharp"! I mean, not much components! Let's see if I can get it still today!

Again, many thanks for the knowledge! Feels like i'm learning from scratch here ahah :D

By the way! I'm going to build the relaxation oscillator in the bread board today, I'll try and post a picture or video of it working!

krd777
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20657
  • Country: gb
  • 0999
Re: Begginer exercises/challenges and DC to AC
« Reply #22 on: July 07, 2010, 06:45:40 pm »
Both of the circuits I posted are relaxation oscillators like the op-amp circuits.

The CMOS Schmitt trigger IC has a lower on threshold than the off threshold i.e. hysteresis and it's an inverter.

Its very simple to understand, here it is again but with a fixed resistor.

Suppose the capacitor starts at 0V. The output will be high, causing the capacitor to charge via R, when the upper threshold is reached, the output will go low, causing the capacitor to discharge via R until the lower threshold is reached causing the output to go high again and the cycle to repeat.

http://datasheetoo.com/semiconductor-article/construct-square-wave-oscillator-using-cmos-logic-element.html

The one with the variable resistor works on the same principle but there are two diodes causing the capacitor to charge and discharge through opposite ends of the pot. When the duty cycle is set low, the capacitor will charge faster than it discharges and when the duty cycle is set high the opposite is true. The extra NOT gate just acts as a buffer to drive the LED but as it's inverting the duty cycle will be opposite.

The one with four ordinary NOT gates is slightly more complicated but works on the same principle. This time two NOT gates are connected together forming a non-inverting buffer. Without R1, P1 and R2, the threshold will be approximately half the supply voltage. R1, R1 and R2 form a positive feedback network which introduces hysteresis. They act as a potential divider, when the output is high, the input voltage is shifted slightly positive and when the output is low, the input voltage is shifted slightly negative. Adjusting P1 alters the difference between the on and off thresholds, i.e. the hysteresis, the higher the setting, the smaller the hysteresis band. The gate after the Schmitt trigger act like a normal inverter. The circuit works on the same principle but the hysteresis band is adjustable, the smaller the hysteresis band, the higher the frequency because the capacitor charges/discharges less before the output goes from low to high or vice-versa.
 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #23 on: July 07, 2010, 09:43:43 pm »
Hi hi!

Just did the bread board circuit!

Here are the pictures and a small video. Problem was the cellphone camera could only capture at the lowest frequency and with a small duty cycle.




Quote
Posted by: Hero999
Both of the circuits I posted are relaxation oscillators like the op-amp circuits.

The CMOS Schmitt trigger IC has a lower on threshold than the off threshold i.e. hysteresis and it's an inverter.

Its very simple to understand, here it is again but with a fixed resistor.

Suppose the capacitor starts at 0V. The output will be high, causing the capacitor to charge via R, when the upper threshold is reached, the output will go low, causing the capacitor to discharge via R until the lower threshold is reached causing the output to go high again and the cycle to repeat.

Yes, with such explanation I got it, thanks! Tomorrow morning I shall do a simulation using a CMOS Schmitt and post the results! The goal is to have the same output as the OpAmp circuit but with the CMOS Schmitt! (I'll try it simple first before going to the one with the four NOT gates).

krd777
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20657
  • Country: gb
  • 0999
Re: Begginer exercises/challenges and DC to AC
« Reply #24 on: July 07, 2010, 10:46:25 pm »
Good, I'm glad you've got it working.

Please note that the CMOS IC must be 74C14, if you use the 74HC14 you'll need to add a current limiting resistor for the LED and use a 3V to 6V supply.
 

Offline KTP

  • Frequent Contributor
  • **
  • Posts: 512
Re: Begginer exercises/challenges and DC to AC
« Reply #25 on: July 08, 2010, 12:47:25 am »
Wow, nice video...even has a catchy soundtrack  ;D

All of Hero999's suggestions are really the better way to do this, but when I made the circuit I wanted to only use what we were given in our tiny kit of lab parts for the intro EE class so that everyone else in the class could make the same blinky led with their parts.  The only semiconductor we had in the kit was the lowly 741 op-amp (ok, it was a really intro EE class...I made a 99.5 average ;) ).  Too bad nobody else in the class seemed interested in doing the circuit or anything else other than the minimum homework problems to prepare for the tests.  I found a similar attitude in the mosfet class I just took.  Ah well, I think I had more fun than they did.

Good job, keep at it!  After you get comfortable making oscillators we can try driving a mosfet with it that is hooked up to an inductor with a catch diode and capacitor filter after.  This would be the start of a very crude open loop unregulated switching boost converter, which could turn the 9 volt battery voltage into 24 volts or even higher (for small loads).  Watch Dave's video on regulators when you get a chance.
 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #26 on: July 12, 2010, 08:49:03 pm »
Hi everyone!

Back again and sorry I didn't do the Schmitt Trigger simulation yet but I had a problem with my spare time and with LTspice too.

Quote
Posted by: shafri
HAHA! thats more like it. congratulation! welcome to EEVBlog for anyone interested in electronic design... for makers and "hackers" haha! Grin
next move? buy an oscilloscope and multimeter! if you still not own one, it will display some reality, not the simulated one.
and when you go advance, you can start looking for function generator, spectrum analyzer etc etc all those fancy gadgetries!

:D Well, since i can't afford to buy an oscilloscope right now, I'll use the ones i have available xD

First of all, here is a picture of the LM741 oscillator connected to an oscilloscope. It was working at 250 Hz with a 100 uF capacitor . I made a video of it working at around 2 KHz using a 10 uF capacitor which link is:


Quote
Posted by: Hero999
Good, I'm glad you've got it working.

Please note that the CMOS IC must be 74C14, if you use the 74HC14 you'll need to add a current limiting resistor for the LED and use a 3V to 6V supply.

Thank you Hero999!
Now for the Schmitt Trigger, I couldn't quite find the proper model in LTSpice to do as Mr. Hero999 said. I'll still search if there are any libraries with it.


Quote
Posted by: KTP
Wow, nice video...even has a catchy soundtrack  Grin

All of Hero999's suggestions are really the better way to do this, but when I made the circuit I wanted to only use what we were given in our tiny kit of lab parts for the intro EE class so that everyone else in the class could make the same blinky led with their parts.  The only semiconductor we had in the kit was the lowly 741 op-amp (ok, it was a really intro EE class...I made a 99.5 average Wink ).  Too bad nobody else in the class seemed interested in doing the circuit or anything else other than the minimum homework problems to prepare for the tests.  I found a similar attitude in the mosfet class I just took.  Ah well, I think I had more fun than they did.

Good job, keep at it!  After you get comfortable making oscillators we can try driving a mosfet with it that is hooked up to an inductor with a catch diode and capacitor filter after.  This would be the start of a very crude open loop unregulated switching boost converter, which could turn the 9 volt battery voltage into 24 volts or even higher (for small loads).  Watch Dave's video on regulators when you get a chance.

Yes, it happens. Some people just don't get a kick out of electronics right away. I think some start to have fun after a while.
Thanks! I'll still keep testing and trying new ones, see what I can get. Right now i want to test the Schmitt trigger Mr. Hero999 has suggested. Then I want to compare them. So for now, until I can't do the Schmitt one, I'll make this one on a PCB, so i can use it later easily for comparison.


P.S.: I know I know, my multimeter is a piece of $#%&/#/, but oh well, I didn't see the multimeter review videos before I bought it (I bought it around 6 months ago). It was around 30€, it was the best in the store I bought it, the next above it was a Fluke which costed +/- 300€ :D  but yes, if it was now, I would prefer to buy a  BK Precision BK2709B which really got me on the video Mr. Dave just did about 100$ multi meters.

Bye for now everyone, I shall be back with the "war on" Schmitt Trigger :D !
 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #27 on: July 12, 2010, 09:37:20 pm »
nice osc you have there! your multimeter is a piece of $#%&/#/? ahhhh! its just a tool! i used to play with cheaper than anything shown here in EEVBlog.

Thanks Mr. shafri! Well, I say it based on the multimeter reviews from mr. Dave. Still this one does all I need for now, without auto-range xD
 

Offline Zad

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: gb
    • Digital Wizardry, Analogue Alchemy, Software Sorcery
Re: Begginer exercises/challenges and DC to AC
« Reply #28 on: July 12, 2010, 11:02:01 pm »
nice osc you have there! your multimeter is a piece of $#%&/#/? ahhhh! its just a tool! i used to play with cheaper than anything shown here in EEVBlog.

Quite right!

An awful lot of multimeter elitism has been generated over the past few months to be honest, and to a certain extent people have lost sight of reality. Bear in mind that one of the meters I use quite frequently is a 3.5 digit non-autoranging machine, made in the mid 1980s, and bought for something under £20 even back then. Im sure that if I were to present 240v across it, it would detonate and take out half the UK, and accuracy is outside 1% now, but it still does it's job fine. When comparing spec sheets and construction, I am as prone as anyone to want the ultimate meter, but eventually we have to realise what we are going to use it for.

Offline KTP

  • Frequent Contributor
  • **
  • Posts: 512
Re: Begginer exercises/challenges and DC to AC
« Reply #29 on: July 13, 2010, 12:47:35 am »
Yes sometimes Dave seems to dink a multimeter a point or two if it will not survive a thermonuclear blast and he gets really pissy when it falls over, but in general the reviews look like a good way for a newbie or not so newbie to know what is out there in terms of value.
 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #30 on: July 13, 2010, 02:12:35 am »
nice osc you have there! your multimeter is a piece of $#%&/#/? ahhhh! its just a tool! i used to play with cheaper than anything shown here in EEVBlog.

Quite right!

An awful lot of multimeter elitism has been generated over the past few months to be honest, and to a certain extent people have lost sight of reality. Bear in mind that one of the meters I use quite frequently is a 3.5 digit non-autoranging machine, made in the mid 1980s, and bought for something under £20 even back then. Im sure that if I were to present 240v across it, it would detonate and take out half the UK, and accuracy is outside 1% now, but it still does it's job fine. When comparing spec sheets and construction, I am as prone as anyone to want the ultimate meter, but eventually we have to realise what we are going to use it for.


Very true Mr. Zad. You don't buy an helicopter to just go get groceries from the local market. You also don't buy a car to travel quickly from Europe to Australia. xD But it still happens that some of us tend to buy a luxury car to go get the groceries and a private jet to go to Australia xP ahahah, I think this is the case. I may still use this multimeter of mine for quite a while (which I'll do for sure, since even college ones are the same model) but there's a tendency to look at such thing as the BK Precision BK2709B and say: I shouldn't have got that one instead! xD

But you and Mr. shafri are right for sure. No need to buy what we don't need!

Quote
Posted by: KTP
Yes sometimes Dave seems to dink a multimeter a point or two if it will not survive a thermonuclear blast and he gets really pissy when it falls over, but in general the reviews look like a good way for a newbie or not so newbie to know what is out there in terms of value.

Ahahahah, but that's something I like in the reviews! xD Like the Ideal Multimeter rant because it falls off due to balance problems in the design, or the "picking" on Extech's bad PCB layout xD

And yes, I find the reviews very helpful. Not that I buy multi meters every day but it allows to learn a lot about the kind of measuring equipment that is out there in the market.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11714
  • Country: my
  • reassessing directives...
Re: Begginer exercises/challenges and DC to AC
« Reply #31 on: July 13, 2010, 02:09:09 pm »
Dave's review is very useful for somebody who already familiar and needing for an upgrade to more expensive DMM, as there are lot out there that sell crap at higher than cheapy price. But we cannot take it fanatically up to a point that we just blindly take what Dave has said, trust just one brand and trash another. We have to choose whats best and suitable for us.

I bought Uni-T DMM just due to some discussion raised by forum members, before the $100 shootout by Dave, but it turned out Uni-T got no big issue in the review. Quite glad to hear that, but... i can sense a switch in the trend that Dave made the review, he seems to make an attempt to equalize among all the DMM brand, carefully pointing the pros and cons for each model, and keep emphasizing that you should get whats suitable for you, quite matured review IMO, but sadly.... no more nasty rants that i used to like and makes me laugh the hell out loud.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #32 on: July 13, 2010, 03:35:29 pm »
Dave's review is very useful for somebody who already familiar and needing for an upgrade to more expensive DMM, as there are lot out there that sell crap at higher than cheapy price. But we cannot take it fanatically up to a point that we just blindly take what Dave has said, trust just one brand and trash another. We have to choose whats best and suitable for us.

I bought Uni-T DMM just due to some discussion raised by forum members, before the $100 shootout by Dave, but it turned out Uni-T got no big issue in the review. Quite glad to hear that, but... i can sense a switch in the trend that Dave made the review, he seems to make an attempt to equalize among all the DMM brand, carefully pointing the pros and cons for each model, and keep emphasizing that you should get whats suitable for you, quite matured review IMO, but sadly.... no more nasty rants that i used to like and makes me laugh the hell out loud.



Ahahah, so true Mr. shafri! So true. And yes, the rants are awesome xD
 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #33 on: July 13, 2010, 04:15:43 pm »
Ok, so I finally tried to make a simulation using LTspice's Schmitt trigger, but with no success due to an error I can't get rid of. Any suggestions?

PrintScreen attached.
 

Offline KTP

  • Frequent Contributor
  • **
  • Posts: 512
Re: Begginer exercises/challenges and DC to AC
« Reply #34 on: July 13, 2010, 05:51:04 pm »
right click on the transient analysis directive (the .tran thing). Set your maximum timestep to something reasonable (do you have it at 0 seconds or something?)  Try 10uS.

 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #35 on: July 13, 2010, 07:32:28 pm »
No, actually had it at 100 us, already tried 10 us, even 1 ms, no good. I found a question like this one on the net but can't quite get the answer.

http://www.electronics-related.com/usenet/design/show/56037-1.php


I can't find the trigger levels anywhere.
 

Offline jahonen

  • Super Contributor
  • ***
  • Posts: 1055
  • Country: fi
Re: Begginer exercises/challenges and DC to AC
« Reply #36 on: July 13, 2010, 08:03:12 pm »
Digital primitives are behavioral models, so no real devices are simulated. However there are number of parameters you can add to the gates to make the simulation a bit more realistic. See LTSpice help for LTspice/Circuit elements/A. special functions. Here is an example of schmitt-trigger oscillator which seems to run just fine after tweaking some parameters. These parameters can be entered in the "Value" attribute (right-click on the gate).

Regards,
Janne
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20657
  • Country: gb
  • 0999
Re: Begginer exercises/challenges and DC to AC
« Reply #37 on: July 14, 2010, 05:02:41 pm »
You need to get those parameters right, in order to ensure an accurate simulation.

The 74C14 typically has a positive and negative threshold of 3.6V and 1.4V respectively, when the supply voltage is 5V, so the correct value for Vh is 1.1V.

I don't know about the rise time, it does vary on the load (the higher the capacitive the longer the rise/fall time), 10ns seems a bit optimistic but I suppose it doesn't matter for a low frequency oscillator, anway I just set it to 50ns.

I don't know why some people seem to be obsessed with simulation anyway, don't get me wrong, it saves money and time but for simple circuits which have been proven to work, it isn't necessary.

Attached is the .asc file with the correct parameters.
 

Offline KTP

  • Frequent Contributor
  • **
  • Posts: 512
Re: Begginer exercises/challenges and DC to AC
« Reply #38 on: July 14, 2010, 05:17:34 pm »

I don't know why some people seem to be obsessed with simulation anyway, don't get me wrong, it saves money and time but for simple circuits which have been proven to work, it isn't necessary.


Simulating simple circuits which have been proven to work (and thus the outcome is predictable so you know if your simulation is working) is a great way to learn how to use the simulation tools.  I don't think the OP is trying to do this simulation in order to do a board run of 100,000 schmitt trigger oscillators...
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20657
  • Country: gb
  • 0999
Re: Begginer exercises/challenges and DC to AC
« Reply #39 on: July 15, 2010, 01:54:55 pm »
Yes, you're right of course, it's also best to start off with the basics.

This was just reminiscent of someone on another forum not wanting to use a CMOS crystal oscillator because they couldn't get it to work in some simulation program.
 

Offline krd777Topic starter

  • Contributor
  • Posts: 33
Re: Begginer exercises/challenges and DC to AC
« Reply #40 on: July 15, 2010, 08:49:22 pm »
Quote
Digital primitives are behavioral models, so no real devices are simulated. However there are number of parameters you can add to the gates to make the simulation a bit more realistic. See LTSpice help for LTspice/Circuit elements/A. special functions. Here is an example of schmitt-trigger oscillator which seems to run just fine after tweaking some parameters. These parameters can be entered in the "Value" attribute (right-click on the gate).

Regards,
Janne

Thanks for the explanation Ms. Janne! Looks like these Schmitt Triggers are more complicated to simulate than OpAmps. or probably it's me not being used to LTSpice yet.

You need to get those parameters right, in order to ensure an accurate simulation.

The 74C14 typically has a positive and negative threshold of 3.6V and 1.4V respectively, when the supply voltage is 5V, so the correct value for Vh is 1.1V.

I don't know about the rise time, it does vary on the load (the higher the capacitive the longer the rise/fall time), 10ns seems a bit optimistic but I suppose it doesn't matter for a low frequency oscillator, anway I just set it to 50ns.

I don't know why some people seem to be obsessed with simulation anyway, don't get me wrong, it saves money and time but for simple circuits which have been proven to work, it isn't necessary.

Attached is the .asc file with the correct parameters.


Thank you very much again Mr. Hero999! It's a more complex piece for me at the moment. Didn't know about all those parameters when you advanced the idea of using a Schmitt trigger.
I wouldn't call it an obsession. Simulation is a part of my college work. I must prove my calculations with simulation. So everything I can get my hands on to simulate is great for training. Also is a great way to "see" the results without a physical circuit.


Quote
Simulating simple circuits which have been proven to work (and thus the outcome is predictable so you know if your simulation is working) is a great way to learn how to use the simulation tools.  I don't think the OP is trying to do this simulation in order to do a board run of 100,000 schmitt trigger oscillators...

As I said above xD. And yes, I could have stopped the simulations with the OpAmp idea, but was curious to compare both circuits and see if there were any significant differences in the output.


Quote
Yes, you're right of course, it's also best to start off with the basics.

This was just reminiscent of someone on another forum not wanting to use a CMOS crystal oscillator because they couldn't get it to work in some simulation program.

Still, trying something more advanced isn't too bad. the only problem there might be is that we may not get the results we wanted. But one always learns something I think.
And I thank you for sharing the concept and explanations here Hero999!


So yes, I consider the two questions I had answered! Thank you very much to you all!

Right now, and because I started reading on OpAmps because of this, I shall start a project where the objective is to select certain frequencies of a signal. And for each frequency "observed", there will be an action.
But this is a topic for another post xD.

Again, thank you very much everyone!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf