Author Topic: Begginer exercises/challenges and DC to AC  (Read 25240 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
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • 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).

 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • 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 »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • 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
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • 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
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • 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):
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • 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
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • 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
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf