Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Vary voltage and frequency of Square Wave

  1. Feb 29, 2012 #1

    I am using an AtMega32 to output a square wave. I am varying the frequency by toggling the output pin using Timer1.
    However, I also need to vary the voltage of the wave and frankly, have no idea how to. I tried looking up google but not much of it made sense to me thanx to my limited knowledge of electronics.
    Can anyone please help ? I dont have to use the micro controller so even circuit ideas are open. Can I use some kind of voltage controller to modify the wave after the square wave of the set frequency has been output from the micro controller port?
  2. jcsd
  3. Feb 29, 2012 #2
    Look into a 4 quadrants multipliers. I used this one before:


    But this one is more for RF, it is just an example what you need to look for. I don't know your requirements, whether it needs to be precision, DC couple or anything. I use this a long time ago. Also the down side is when you have highest attenuation, the noise goes way up, so there is a limit of how low the gain can go.

    There might be some newer ones you can use to fit your needs. Basically, it take your square wave input and change the amplitude according to a control voltage. With a 4 quad multi, you just feed from the source you have and control the amplitude with a control voltage.

    Also look into variable gain amplifier something like this:


    I am not recommending these two device, just an example to give you a head start what direction to look for. Most likely they have better ones for your specific needs.

    If you can take AC couple, and the frequency is in over 1MHz, then I had a design that use pin diodes that will do the trick.
    Last edited: Feb 29, 2012
  4. Feb 29, 2012 #3
    Hey thnx a lot! will try understanding these :)
  5. Mar 1, 2012 #4
    Last edited: Mar 1, 2012
  6. Mar 9, 2012 #5
    It sounds like a good place for CMOS. CMOS is analog designers dream, because it can switch right to a given voltage.

    I'd suggest looking through the CD4051-CD4053 analog switches. They're cheap as dirt and twice as common. You can place your positive voltage on one input and negative on another and have a lovely square wave that's very well defined.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook