0
\$\begingroup\$

this is my first question,

I want to ask a simple question, I searched but couldn't find proper answer, here is my situation; I want to build frequency generator circuit with op-amp oscillator topologies, but I want to control the circuit with ATMega328p's RC-Filtered PWM Analog outputs, but as you know, oscillator circuits tuned with changing R and/or L (if RL resonator/tuned circuit used) or C ( if RC circuit used for oscillation) values, it is obvious that I cannot change L or C values easily, so I decided to change R values to tuning oscillation frequency (as variable), so I think that I need to implement digitally controlled potentiometer or variable resistor, after that I came up with an idea; when using a BJT transistor at Active region, it acts as a variable resistor (ofcourse there will be some voltage drops due to Vbe)

but I cannot achieved this goal because active region needs small signal input at base, here is my question : can I set the PWM or RC Filtered Analog output's amplitude as needed for active region ( as mV scale, I think) or should I consider another way to accomplish this issue?

thanks in advance, sorry for my bad english

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Usually JFETs are used as voltage-variable resistors. You could also use a bass-ackwards current DAC. \$\endgroup\$ Commented Jul 6, 2015 at 17:21
  • 1
    \$\begingroup\$ google voltage controlled oscillators (VCOs) and operational transconductance amplifiers (OTAs) \$\endgroup\$ Commented Jul 6, 2015 at 17:28
  • \$\begingroup\$ A BJT cannot act as a variable resitor. Its V-I characteristic is not symmetric with respect to the origin. Instead, use a FET or an OTA. But be aware that most oscillator topologies do not allow independent control of oscillation frequency and oscillation condition. Show us your preferred circuit. \$\endgroup\$
    – LvW
    Commented Jul 6, 2015 at 17:44
  • \$\begingroup\$ for example, can I use MOSFETs as a variable resistor? \$\endgroup\$
    – fatalblade
    Commented Jul 7, 2015 at 6:16
  • \$\begingroup\$ Yes - MOSFET or JFET. But be aware that that such application requires the source node to be grounded! There are not many oscillator circuits allowing independent frequency control with one single grounded resistor! \$\endgroup\$
    – LvW
    Commented Jul 7, 2015 at 7:45

2 Answers 2

3
\$\begingroup\$

You could use a DDS which is easy (the hard work has been done for you). Assuming you don't want to do that, read on.

For low frequencies (through the audio range) the easiest way is to generate triangle waves with a VCO which can then be shaped into sine waves if necessary. This can be done with a DAC to generate the control voltage and an oscillator made with an integrator and a comparator switching the integration direction.

For high frequencies (1MHz and up) you can easily change the C by using a varactor diode. You can phase-lock the signal to a reference signal if you want.

You can use a JFET or a lamp + LDR (light dependent resistor) to vary resistance, or as Ignacio says, use an MDAC to simulate a relatively low frequency resistor.

Or you can use a digital pot! Some are specified well enough to use them as rheostats, though they are always better used as potentiometers. Again, not so great at high frequencies.

\$\endgroup\$
1
  • \$\begingroup\$ I was used ADF 4350 VCO with arduino couple years ago, but it didn't went good, we had some issues with arduino libraries, frequency instabilities etc. I think I might try JFETs, thank you \$\endgroup\$
    – fatalblade
    Commented Jul 7, 2015 at 6:15
0
\$\begingroup\$

Here is another answer that will work if your microprocessor PWM frequency is much higher than the oscillator frequency and/or if your desired frequency range is small in percentage terms Use the pwm to switch two resisters via a analog CMOS switch like a 4053 or a 4066 which has worked for me the two resistors correspond to Fmax and Fmin your resister values depend on your oscillater set up but it will be fine as long as the resister has a high value compared to the CMOS switch ie in the Kohm range NOW your RC osc should have capacitance in the nF range so parasitic switch capacitance wont muck it up what happens is you will be able to smoothly vary the frequency What I did was use 100KHz PWM from a lm393 running a 4066 with resistors into a state variable oscillator and made 50Hz and harmonics the clock noise was very easy to filter giving much lower noise than switched cap filters featured in my bad beetles website

\$\endgroup\$
1
  • 1
    \$\begingroup\$ You need to start using punctuation my friend. \$\endgroup\$ Commented Jul 6, 2015 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.