I was browsing eBay one day and I ran across a posting for the Analog Devices AD9850. The AD9850 is a chip that can produce a sinusoidal wave from about 1hz to 40mhz. Somehow the electronics dealers in Hong Kong have been able to mate the chip to a small board that provides TTL level control and then sell it for an unbelievable $8 (or less!). I know a few people have paid as little as $4 (USD) for them.

AD9850 Module

To control the AD9850 you’ll need some sort of micro-controller.  Without going into too much detail you are required to send a set of serial or parallel data to the chip to set the frequency.  There are numerous postings on the web detailing exactly how to do this so I won’t go into too much detail. However it has been hard to find a good AD9850 Pinout so here you go.

D0 – D7 = Parallel programming bits
GND = Ground (obvious); Vss
CLK = Serial programming clock
Latch = Serial programming latch (FQ_UD pin on 9850)
DATA = Serial programming DATA (internally tied to D7)
RST = Reset. Keep tied to GND
SQW = Square wave outputs (complementary) Duty cycle adjustable with blue pot.
SINA = Raw unfiltered AD9850 sine output
SINB = 70 MHz LPF filtered AD9850 output.

For me, the easiest way to manage the AD9850 is with an Arduino Uno.  If you don’t know about the Arduino platform you should check out the official site at  I have been playing with the Arduino for only a couple of months and I already have found it to be a fantastic development platform.  If you are a hobbyist tinkerer… you really can’t go wrong with one.

I have paired may AD9850 with an Arduino Uno, LCD display, Rotary encoder, and a few other small parts and have put together a very descent DDS VFO capable of any frequency between 1mhz and 30mhz (It will go to 40 if you wish).  A little quick work with a protoboard and I have a nice working VFO.  You can watch my video on YouTube showing how it works. I also have another video of the VFO attached to my oscilloscope.


This project is ongoing.  You should be able to deduce the pin outs on all items from the Arduino Sketch but if you have questions just contact me. My schematic is a little rough as I do not tend to create them that often so let me know if you catch anything out-of-place!

Because of a lot of requests I have also created a version for IF (superhet) type receivers. The VFO now supports an Intermediate Frequency and can switch upon the HI/LOW level of one analog input on the Arduino. The IF can be anything you wish and can be additive or subtractive.

** UPDATE November, 2013 **
I have updated the sketch to write the last tuned frequency to memory and recall it upon boot-up. This is a 100% direct drop-in replacement and requires you to only upload the new sketch. The code is well documented and for those of you who modified my original sketch it should be easy enough to adapt as you see fit.

Both Arduino sketchs (IF and NON-IF), schematic, libraries, and notes are available for download here.  Also, Jiri (OK1DXK) create a great drawing (aka schematic) if you wish to use an Arduino Nano. If you build something from my design please send me a picture or a video of your creation.  I love to see what others do!

Or you can also send a donation via paypal to (My registered PayPal address.)

444 thoughts on “AD9850 DDS VFO

  1. Hi, I’m wanting to build a VFO to run an old Drake 2 NT xtal controlled transmitter. I’m interested in what you have built here. I will need some kind of amp to bump up the output to 4v ptp, manual calls for 12v on 15 meter band for some reason.
    Anyhow I like what you have here and let me know what you think.
    Thanks, Gary KF7WNS

    • Gary,

      You can easilly build a buffer amp to drive the signal to 4v PTP or even 12v PTP, however, I find that level somewhat huge! Typically 1v or .5v is more than ample for most circuits but if that’s what the manual for your Drake states… that’s what you’ll need.

      Please remember that the output voltage of the DDS VFO varies with frequency so if you need it to output a constant level across a wide-range VFO you’ll need to design an AGC (or sorts) into your buffer to provide a constant level output. I’ve seen some great designs with simple op-amps that accomplish this with a tap into the feedback circuit. I’m not the expert here so I would recommend you get on the forums or TIS group for more assistance.

      God luck on your project.



    • I am not familiar with the Arduino Mega so I can’t be of assistance. You’ll probably need to adjust the pinouts from the UNO to the MEGA as they are different. The main difference is going to be the Interrupt pins.



    • This was asked a number of years ago but is still valid.
      The reason the rotary does not work on the Mega2560 is due to the differences in interrupts between the Uno and the Mega2560 or or specifically the Uno’s lack of them. It turns out the fix is rather simple.

      In the setup(){} function comment out the following lines and then add the two lines immediately after the commented out code like this::
      PCICR |= (1 << PCIE2);
      PCMSK2 |= (1 << PCINT18) | (1 <=30000000){rx=rx2;}; // UPPER VFO LIMIT
      if (rx =30000000){rx=rx2;}; // UPPER VFO LIMIT
      if (rx <=1000000){rx=rx2;}; // LOWER VFO LIMIT

      No change in pinouts necessary though I did adjust the lcd wiring with pin 4 of the lCD to D13 and pin 6 of the LCD to D12 (just swapped them) and changed:
      LiquidCrystal lcd(12, 13, 7, 6, 5, 4);
      LiquidCrystal lcd(13, 12, 7, 6, 5, 4);

      One last thing that is not Mega2560 specific was a labeling errata in the wiring diagram. D10 of the Arduino goes to the DATA pin of the AD9850 and NOT D7. So it should read DATA and not D7 on the DDS AD9850 in the diagram. Hope this helps someone.
      It works for me :-)

      • What a shame, the web code filtered out some of the code I posted. This makes the above incomplete. So I will try to describe what needs to be done instead.

        On the Mega2560 use the attachInterrupt() function in the setup() part of the program. The lines that reference PCICR , PCIE2, PCMSK2, PCINT18 and PCINT19 as well as the sei(() function in setup() can be commented out or deleted. This amounts to 3 lines towards the top of the setup() function. The new code uses attachInterrupt() for INT_0 & INT_1 like this:
        of course don’t forget the semicolons at the end of each line.

        Next you simply want to change the name of the ISR service routine (called ISR) from ISR(PCINT2_vect) to void MyIsr(void). Then your’re done. I hope the web server doesn’t filter out this, If it does, then I tried.
        Good luck,

        • in this way?
          void setup() {
          lcd.setCursor(0,0); // Se pone el cursor en la primera posición de la pantalla
          pinMode(A0,INPUT); // Connect to a button that goes to GND on push
          //PCICR |= (1 << PCIE2);
          //PCMSK2 |= (1 << PCINT18) | (1 <=30000000){rx=rx2;}; // UPPER VFO LIMIT
          if (rx <=1000000){rx=rx2;}; // LOWER VFO LIMIT
          well i have a problem :

          dds9850.ino: In function 'void setup()':
          dds9850.ino:33:20: error: 'MyIsr' was not declared in this scope
          dds9850.ino: At global scope:
          dds9850.ino:46:6: error: expected constructor, destructor, or type conversion before '(' token
          Error de compilación

          • //PCICR |= (1 << PCIE2);
            //PCMSK2 |= (1 << PCINT18) | (1 <=30000000){rx=rx2;}; // UPPER VFO LIMIT
            if (rx <=1000000){rx=rx2;}; // LOWER VFO LIMIT

      • good morning i’m trying to load the code into an atmega1284p and i have a problem with the rotary encorder can you help me?
        in terms of the changes I need to make

        • Post your problem. However, most times you can fix the rotary encoded by making sure you use the proper case: Rotary not rotary.

          • good morning I am loading the file on arduino nano, uno, mega it works perfectly !!!! I also uploaded it to atmega 1284 and I see that it wants a different library for the rotary encoder, this is the only problem, can someone help me? I am new to programming !!! Thanks in advance.

  2. Hi, I too am planning on building this circuit. I was wondering if you’ve messed around with the AD9850 Library for the Arduino? I appears to have simplified things quite a bit. I’m also looking for other examples using the AD9850. I bought 2 for pocket change. Here’s the library:

    • Never used the library as I had no issue controlling it for what I needed it to do but thanks for the tip! 73, AD7C – Rich.

    • Analog Devices AD9850. Get on ebay.
      The rotary encoder I used was from a junk drawer, however, you can find a similar one for $3-$4USD at or

  3. Might this be a cheap replacement for a bad PTO on a TenTec Century 21 I have? Thoughts? Thanks for your work!


    • I don’t know much about Permeability Tuned Oscillator circuits, however, I see no reason why you can’t use it. Realize that it would replace the entire PTO section (or rather VFO). The nice part is that if you did replace it with the AD9850 you would get a much wider tuning range over the PTO. 73 – AD7C

  4. Rich,
    Please send me the new code for superhet receivers. I have a SW receiver that I built with the NE602 that uses 455khz and it would be awesome to have that figured in. Thanks for commenting a lot in the code. It helps for those of us that are struggling. This is really great that your doing this. Having a powerful VFO like this is
    worth big bucks!

    Harold Lacadie

    • Me Again,
      Well I built the circuit EXACTLY as you have described using inexpensive EBAY parts it and your software. Oh my sweet Lord! This is the coolest thing ever. Tomorrow night, it gets a real workout on my little superhet. Your setup is flawless!

      • Glad it works well for you. FYI: The NE602 doesn’t require much drive (input) to work, however, you may find that some designs require a little extra “oomph” from the AD9850 output. KF0XO has a simple buffer circuit a few posts back that boosts the output around 10db.

        Love to see a photo of it in action!

        73, Rich AD7C

        • Rich,
          I connected the Arduino VFO up to my little NE602 superhet last night. found out 2 things:
          1). A coupling cap is required (there must be some DC in the sine wave or something.
          2). The NE602 needed the entire waveform to work well and seemed to want more; need to make a buffer.

          Other than that, the tuning was smooth and clear. I even tuned down to the upper AM bradcast band. Found some spanish broadcast ot the Redsox game. I’m going to alter the code to go lower into the broacast band, make a buffer and maybe stick a little MMIC before the first IF can. Fun stuff dude! Video coming soon I hope.

          • If you watch my 2nd video of the AD9850 on Youtube you can see that the lower in Hertz you go… the more powerful the sine wave output. So in the AM band you may be able to work without a buffer but, most likely, anything above 7mhz will require one.

  5. Fantastic circuit worked straight away with the same components. I am very much interested in the new version could you please email at
    Many Thanks a lot for the wonderful circuit.

  6. Hello
    I want to ask you about the schematic I try the connection thet you made but it doesn’t work can you help me please

    • I built the circuit, but the software wouldn’t compile properly. I ended up putting the code for rotary.h into the beginning of the main program and removing the “#include rotary.h” line. The rotary encoder wouldn’t work to change frequency. I figured out that adding external 10k pullup resistors to the two encoder outputs fixed the problem, and now it works fine. I’m happy. I’m not sure what “# include Arduino.h” refers to. I hope this can help someone.

  7. Rich,
    Sorry to be a PIA but my programming skills are pretty bad when it comes to the Arduino (C language). Could you please send me the new version of your software that takes into account the IF frequency you mention above for June 6th?

  8. In looking at the AD9850 board’s specifications there is a jumper for serial mode – yet in most of the pictures I don’t see this jumper used. Is this jumper necessary or not?


    • The jumper let’s you select between parallel or serial input, however, you can also software select it. Generally unnecessary.


  9. Pingback: 7MHZ VFO with Arduino and AD9850 | AD7C

  10. Hi Richard,
    For past few days I was trying to assemble the AD9850+LCD+rotary Encoder for the HF VFO. I have almost made it but for the rotary encoder part. In the sketch you have published I am getting some errors especially for the rotary encoder code lines .First in line no 11- it says ‘Rotary’ does not name a type, Then in line no 40 – ‘r’ was not declared in this scope .Next in line no 42 – ‘DIR_CW’ was not declared in this scope .I am not able to address these 3 errors. Hope you can help me.Thanks in advance for your time.

    (Pravinkumar Anandan)

    • You most likely did not include the rotary encoder libraries. You have to include the extra libraries for my sketch to work. While I have provided the libraries in the ZIP file, you have to setup them up to be correctly imported during build/compile. See:


      • Hi Rich,
        I tried to instal the rotary encoder libraries as instructed by you. But it says already there is a library called
        ” Encoder” and true to it the rotary encoder works in stand alone mode. But somehow when I try to include it is not taking saying it is not named a type. In your experience of Arduino what may be the reason it is taking “Encoder” but not taking “Rotary” ? Thanks for your time.


        • Sorry. Don’t know how much more help I can be. I have never experienced the problem you describe. You may want to remove then re-install everything related to the project (Arduino environment and all). Make sure you have the latest version of the Arduino environment when you re-install. Lot’s have people have downloaded my code and it has worked without issue. You can also try posting to the Arudino forums to see if someone there can help as well.


  11. I have tried that also but the problem persists . Anyway thanks for all your help and if and when I solve this problem I will certainly update you.

    (Pravinkumar Anandan)

  12. Hi, I finally got hold of all the parts needed for the arduino ad9850 vfo project. My question is I guess the lcd I bought is the lcd keypad shield. Will this work? I’m new to this arduino and I tried to upload the code and there seems to be an error every time I do it. Could you please help me with these? 73′s and more power.

    • The code was designed for an external Hitachi styled LCD unit and not the Arduino LCD shield. However, you it can be made to work with the shield. You will need to look at the shield pin-outs (RS, write, Data, etc) and match those to the data pin-outs I used in my schematic. You’ll then need to change the code in my sketch to assign the correct pins. It’s fully documented so you can easily find the pin assignments are re-arrange them. It’s going to be a lot of work if the new pin-outs use pins assigned to the rotary encoder or DDS unit.

      Sorry! I don’t have a LCD shield so I can’t help you much with this one unless you feel like sending me one to proto :-) . My $.02. Get a basic, plain, simple LCD. The’re $5-$8. Ebay is your friend.


  13. Hi Richard,
    With the active help of some Arduino forum members I was able to successfully instal the “Rotary” library into my Arduino IDE and now able to compile the AD9850 DDS code . Just now I loaded it into a ATMega328 chip and it has started to work as per your design. I am wondering whether we can modify it such that it can be used as a swept frequency source for an antenna analyzer application .
    Thanks a lot for your wonderful yet simple circuit and code.
    (Pravinkumar Anandan)

  14. Thank you so very much for the FW and the schematics.
    Hello Rich,
    My children’s Aurduino board was sitting idle after they played around building a few basic projects during their last summer holidays….
    The simplicity of the Aurdino attracted me, and while Googling for more info I came across your web page. I’m glad I did !
    Your code worked the very first time I switched it on, and your well commented sketch helped me a great deal in my intro to the Uno.

    Please watch my video @
    This is an ongoing project for a HF to 2m transverter.

  15. Hello Rich: I have a question reguarding downloading the rotary libraries. There are 2 rotary libraries, rotary3 and rotary. Do I need to add both to the IDE? Or am I looking at the wrong file?

    • Dave… those files are part of the original source code. As I did not write that code but rather just modify it I felt it necessary to include and credit the original authors. Ignore everything in the RotarySource folder unless you want to make source code changes (doubt it).

      You are only interested in importing the 2 files in \libraries\rotary folder: rotary.cpp and rotary.h and my main arduiono sketch (.ino file). As there has been some confusion please only 1 of the .ino files. More is explained in the ReadMe.txt file.

      73, Rich AD7C

  16. Hi Rich: Thank’s for the help. I am new to Andurino so just needed a step in the right direction. All is OK now once I downloaded the coerrect file

  17. Hi Rich,
    I will be very grateful if can you tell me how to change the code such that it can be used as a swept frequency antenna analyzer with appropriate LPF from a bank of Low Pass Filters etc. Thanks in advance for your time.


  18. Hi Rich. I am designing a board that will plug into the Arduino and have the 9850 DDS module plug into the top of the board. From your schematic you have the data line from D7 on the 9850 module going to the pin10 on the Arduino.(UNO) which you assigned as Data 10. It would make a cleaner board if I connected Data 10 on the Arduino directly to Data in on the 9850 board.They seem to be connected. Any problem connecting Data 10 directly to Data in on the 9850 module rather than D7? I hope this makes sense!!!
    Dave WB4CHK

  19. how to generate the Arduino Uno with two sinusoids using two plates DDS9850 and only one arduino can someone help me

    • Marcos,

      Doing what you ask would be difficult. The Arduino UNO has just enough outputs to run one AD9850. You probably would need to run an Ardunino Mega to use two boards. Sorry… I’ll be unable to help you with your project.


  20. Hi Rich,
    I tried the sketch to my board, it works well, but the dial speed when change the frequency is too slow for me, i just using generic and commons 3 pins rotary encoder (ticking when i spin it type). i tried to lowering and increasing delay speed with change the value from 250 to 100 and lower with mean i need it that the rotary encoder will response quicker, but i don’t feel many changes, anyone have ideas to fix my problem?
    Thank’s Rich, this sketch is simple and easy, hope i can adding some menus in future :)

    • Rudik,

      Did you also hook up the push-button “switch” as shown on the schematic? When you push the switch it changes the rate (speed) at which the rotary encoder advances/declines the frequency. YOU DO NOT need to modify the sketch code to get the rotary encoder to respond faster. I am also using a generic 3 pin encoder.


  21. Hi Rich,
    Well, because i don’t have the rotary encoder with 5 pins, i just used 3 pins rotary encoder type, and change the push button with ordinary push button switch, in my understanding, it’s should be no problem.
    Another important function i wondering is auto saved last frequency used, so in case we turning the controller off, the last dial should still remain in previous setting. I am and my friend is working with this, so, i will updating the updated sketch here for everyone use.
    thank you

  22. Hi Rich,
    I built your DDS project, it works great. Just wondering what the switch does that is connected to A5 on the Arduino? I have mine hooked up as the schematic shows but it doesn’t appear to do anything. Thanks.


    • The switch changes the steps (rate) of tuning. 10hz, 100hz, 1khz, etc. If your switch does nothing check the connections. Most rotary encoders have a ‘switch’ built in that actuate when you depress them so an external switch is not necessary. However, you can use an external switch as you did. Watch the video of this build on my YouTube page and you can see the action of the switch.


  23. A very nice little sketch and project for the Arduino. Thank you

    Somebody mentioned the switch on A5 and that’s the effectively the TX/RX of if shift state switch as it changes the output frequency to be the one shown on the display, less the constant defined by ‘iffreq’.
    It is not the one to change the DDS switching steps which is on A0 and is the push button on the rotary encoder.

    It certainly works very well and at present I have mine working with the other DDS available on Ebay which has slightly different pin outs and names.
    This may help others to use the different DDS boards out there and the pin markings on the different boards are compared here:
    D7 = DATA
    MCLK = W_CLK
    FQUP = FU_UO

    I also changed the line: lcd.print (” “);
    to be
    lcd.print (“rx”)
    simply to show that it’s in if shift more .

    Brilliant and thanks again
    Dale G4IPZ

  24. anyone have updates regarding the the problem with the last used frequency dialed when system goes shutdown? i mean, when last time i tuned to 7.100.000 Hz, then i turned off the system, i want the dial frequency remain at 7.100.000, Hz, not to the default value as i stated in sketch. i think this should become the basic function anyway.

    • That is not a problem that is by design. There is no routine to store the last entered (dialed) frequency in the DDS so when power is removed and restored the system always resets back to the default VFO frequency.

      However, I am working on this as an improvement… with some other items. Anyone wishing notice when I am done can send an email to AD7C @ ARRL.NET and I will add them to the notify list.

  25. Pingback: Nachbau eines digitalen Sinusgenerators « Peter Hostermann

  26. Rich,
    Great project, I have built it around the Uno, the Nano, and the Pro Mini and they all work perfectly. I prefer the Pro Mini as they are dirt cheap. The only thing that would make this better would be if it had the ability to remember the last frequency you were on and you are working on that, thanks. BTW, mine draws 140ma with the Pro Mini module.

    Joel KB6QVI

  27. This little project has really sucked me in HI !
    My versions have been run on a UNO, a NANO and even on a UNO bootloader chip programmed and built stand-alone on veroboard.
    It’s been a great learning curve.
    So far I’ve rewritten quite a bit of the sketch so it now uses an 8 x 2 display, has separate up/down buttons for the step values, has an IF shift inhibit switch depending on what I’m driving with it and the ability to change the shift frequency by a push button. I’m now working on saving the chosen shift into the EEPROM and learning masses as I go along.
    One of my next mods will be to use an I2C display to release the digital pins for other uses.
    Fantastic fun!

  28. Completed build on the WB4CHK pcb and barring a few toubleshoots we are up and working with a Sine Wave to be proud of.

    Minor problems if they help anyone.
    Keep the IF and the non-IF sketches in separate folders when you load one of them into the arduino IDE you get duplicate declarations etc.

    Others : my faults..
    Using ribbon cable – one faulty data connection traced with ohmeter an fixed.
    22K might be bit to large for the contrast – it is all in the last smidgin of the turn of the pot. (Plans say 25K – but 22k on hand here)
    Non critical.
    Wired the 12V supply into the 5V regulator using connector from the aruduino.
    All works OK but tabbed-regulator gets a bit warm. Fix this next time with 9V into arduino from the 78L09. (with 12v into the 09).

    The project is to become my new bench RF sig generator so will be looking at the N3ZI buffer amp and a stepped attenuator. Possible calibration later or some kind of const voltage amp.

    Enjoy the project everyone!

    • Moving the IF version out of the folder containing both .ino files, solved duplicate declaration error for me too! Compiler was finding first error at ‘void storeMEM()’ Using Linux Mint 17.1 and Arduino 1:1.05. Thanks Tony for the comment. Thanks to Rich for the wonderful project!

      Bob KD0JIY

      • Just finished installing Arduino Ver. 1.6.5 on Xp. Downloaded and tried compiling non IF version of vfo. Got the duplicate declaration error, when both .ino files were in the same folder.
        Removed the IF version and then the remaining one compiled fine! The XP operating system is a virtual one using Oracle virtual box on Linux Mint 17.1 . I found out about the AD9850 Arduino shield (by WB4CHK) at Rich’s site about an hour ago. Neat!
        Tnx agn to Rich, Tony, and WB4CHK

        Bob KD0JIY

        • Installed Arduino Ver. 1.6.5 on Windows 7 Pro Sp1 with all Microsoft updates. Compiled (arduino ‘verify’) Rich’s non-IF .ino file. Got the error ‘duplicate Rotary r’. Removing the IF .ino file from its original folder solved the problem. The non-IF file compiled 100%.
          This time the Windows 7 operating system was on a normal hard drive, not virtual. I need to get some parts, and try this vfo. Thanks again, to Rich and contributors!
          Bob KD0JIY

  29. Pingback: DSS VFO Update – Last Frequency Saved in EEPROM | AD7C

  30. ** Code Update **
    Version 2.0 of both sketches is release. Version 2.0 saves the last dialed frequency to EEPROM memory and reloads it at boot-up. Code is 100% direct replacement of old code.

    If there are any questions please just ask.


  31. Would it be possible to control 2 DDS modules to allow I-Q outputs for SDR applications.
    maybe use extra arduino output pin to select DDS module, send same freq data 32 bits, need control word to for each DDS module for 0′ & 90′ phases.

    • Frank. Very possible to drive 2 AD9850 boards. However, I would probably want to use an Arduino Mega as they have more digital and analog pins easily allowing for the extra AD9850. While I am no expert on SDR and IQ I see a problem as I am not sure how you would control the phase of the AD9850′s. Something conquerable in code perhaps but a little beyond me at this point.


      • Hi Rich,
        Feed both DDS modules with 1 clock source with equal wire length.
        AD9850 control byte can select phase value (5 bits)
        thinking to use Arduino I/O pins 0-1 to select chip when loading 40 bits data into DDS chip.

  32. Hi, very much appreciate your design.
    I downloaded the non-IF version 2.0.
    I am having a problem compiling the code.
    Probably my problem.
    For statement Rotary r = Rotary(2,3),
    I get error ‘Rotary’ does not name a type

  33. Have been looking around at how to incorporate some wobbulator functionality into the DDS VFO so that it becomes a great bench tool – RF signal generator and filter tester/alignment in one.
    Using the existing two switches and adding an I2C DAC to make the sweep voltage it should be possible to program into the existing setup a menu for VFO and another menu for Wob. The IF switch would make an Escape button and the rotary encoder an Enter keep. The Wob sweep limits could be set with the rotary encoder and the step too.
    I have a o-scope that will take X-Y inputs; the idea is that the filter under test gets the sweeping frequency (with the sweep voltage from the DAC) and the output of the filter is then displayed on the o-scope Y. The set frequency and DAC voltage are set on the same loop in software.
    The I2C DAC proposed is the MCP4725. These are an inexpensive chip. The cost of postage is actually more than the IC. You can get a breakout board from Adafruit or Sparkfun. Even using a local distributor in the UK the shipping cost doubles the cost of the purchase. So I’ve decided to get the chip and homebrew the circuit. Will probably add it ‘island style’ on the Arduino DDS VFO “Shield”.

      • Update on the wobbulator project.
        I have now got a MCP4725 working with the arduino on its own and drawing an nice sine wave on the scope. This was the first time I have worked with the SOT23-6 package. So much so that you open the packet from your supplier and say ‘where is the IC’. The are really tiny for something so useful. What a mess though – I switched the SDA and SCL pins so the thing wouldn’t work at first. When I wired them correctly the chip registered on the I2C probe software and bingo – here we are!

        I bought the ‘raw’ chips rather than the breakout board from Sparkfun or Adafruit. Nothing against these people they are great. However, my local supplier didn’t keep the breakout board and I priced up the board at UKPounds 12 delivered, when the chips are UKPence 80p each. Made some adaptor pads using press and peel (really must buy some new stock of this).

        Next job now we have a DDS VFO and a DAC is to integrate the two software modules into a menu driven VFO/Wobbulator.

        More next week.

        • Bit of a haitus in the project – I have completed the hardware element and though it was time to box it up (with a little wriggle room for mods) before finalising the software.

          I did get the DAC to sweep across the X trace of the scope and the VFO to sweep +/- 2KHz of a centre frequency.

          Idea of boxing it up it to 1) try the RF shielding and see if anymore bypass or filtering is needed and 2) to get the project out of the ‘loads of wires’ phase and safe from short circuits on the bench.
          The plan is to allow the boxed project to be programmed by having the USB connector accessible.

          A thought – for an antenna analyser – use some of the design from the 4SQRP projected ‘tenna dipper’ should be able to adapt this on ‘manhattan’ construction.

  34. Hi Rich,
    Hope you still remember me . I have succssfully assembelled your AD9850 DDS VFO design using Arduino ATMEGA328 chip a few months back. Thanks to you it is working fine and of great use to me as a general purpose VFO. Now I want to put similar VFO s for more specialised uses like (1) Antenna Analyser (2) SDR etc. I have got a few AD9850 boards and an AD9851 board through ebay.
    Regarding (1) Antenna Analyer I have alreday requested you to kindly publish the code, hope you are on the job time permits.
    (2) For SDR it will be awsome if two similar 9850 boards can controlled by a single Arduino (I think ATMEGA328 will be sucfficient) as it requires just an extra pin (to drive two separate W_Clks with 90 degree phase delay) than the single board . If it is difficult to do in software I think we can do it in hardware without the need of the extra pin if the clock frequency is known. We can have a full HF SDR without the need to use X4 VFO and the 7474 chips . I request your opinion about the same.
    I am in the process of upgrading the AD9850 software to include the “last frequency” feature you published recently. So far not succssful on it and will let you know the result shortly.
    Regarding the AD9851 board I will be very grateful if you can publish the code for a HF+VHF VFO with LCD & encoder in one of your future blogs. Hope I am not demanding too much from you.

    DE AB9XC

    • Pravin,

      I do not have time, at present, to work on the antenna analyzer. Work and other projects have kept me away from exploring the code. However, I do plan on someday generating a code an schematic but I can not state a time-frame.

      For the SDR I suggest you seek out another user who posted some items about SDR on this board. Frank VK3ZFS has shown an interest in the same topic and together you both may be able to find a way to use dual AD9850′s to build an SDR.

      I would suggest to you that you take a look at With the current code I have published an a little exploring you can build all the items you requested without my help. The arduino platform is simple and learning is part of the fun. Many people have taken my DDS project and expanded on it by learning how to program the arduino.

      To get the AD9851 working in my sketch you should only need to replace one line. Replace my line with this new line: int32_t freq = frequency * 4294967296.0 / 180.0e6;



  35. Hi Rich,
    Thanks for your suggestions and I will try to learn some code programming. Will certainly keep you posted about the modifications/projects if and when I make it. Hope it will be useful to many other hams also through this board.

    DE AB9XC

  36. Hi Frank,
    I would like to know how far you succeded in the quadrature VFO design using two AD9850 boards controlled by single Arduino? Any idea what is the W_CLK frequency ?

    DE AB9XC

    • Did any one get the two in quadrature? Maybe just use the two outputs and a delay line? Most software will correct for this I’m reading. SDR# ha that function.

  37. Rich,
    I run the new compile the new version of your software and I get a “Rotary redefinition error..
    The newer Rotary library is loaded.
    Windows and Linux
    I compile the old version and it’s fine.

    • Odd problem. I’ve experienced this as well. Make sure you open the file in Arduino Program and then you must save the file, typically in the /mydocuments/Arduino folder (varies by OS). If you don’t save the file before you compile… that error will appear. Also make sure you have the latest version of the Arduino program.


  38. Hi Rich,
    I successfully tried your project using Arduino Nano v.3.0. Almost no changes. It works very nice. Thank you very much.
    Jiri (OK1DXK)

    • Antero, Make sure you have newest version of Arduino software. You MUST save the new sketch with a valid name and correctly have the libraries imported.

  39. Copy the text from the sketch and paste into a new MS WORD doc. Then copy out of the word doc and paste back into a NEW sketch. There is something that happens to the formatting that WORD fixes automatically (probably line breaks).
    Make sure the libraries are there as others recommended.
    Also here are some links to info on syncing two of these badboys in Quadrature for the SDR IQ system.

  40. hi great circuit- i built it and works good. i plan on making a small radio. have 1 question- i used a small ebay arduino mini /nano and it dosn’t have a pin a5 for the mf switch so i hooked it up to a3(it only has a0 thru a3). could you tell me were in the program to change a5 to a3? not good at programming yet but having fun learning.


      • Hi Steve.
        Some of the bootleg Arduino Mini’s ‘hide’ the A4 to A7 pins in odd places on the board and often not too clearly screen printed.
        The ones I use have a separate block of holes which are beneath the ICSP connector.
        The bootleg Arduino Nano’s I use have the A4 to A7 in the normal place on one side folowing on from, A0 to A3.
        It is worth noting that some Chinese copies advertised as Nanos are in fact Pro Minis. I’m pretty sure that the easiest way to tell one from the other is that if it has a usb connector it’s a Nano if it doesn’t then it’s a Mini.
        Also check that the ones you buy are using the 328 device as some of the older ones are still floating about out there.
        Slim G4IPZ

  41. Update 15/12/2013

    Incrementally nearer to the final product.

    I’ve got a crude break out of the loops that end the various functions and return to the main menu.
    When A1 goes low the loop should end.
    This works but is a bit hit and miss….

    buttonstate2 = digitalRead(A1);
    }while (buttonstate2 == HIGH);

    (moved my button2 onto A1 for some reason or other early in the project.)
    I realise that you have be ‘caught’ pressing the button with this method.

    Anyone have a better idea?

    • Project nearly finished – if anyone can help with this one…
      I have put in a rudimentary menu system that allows selection of Sig Gen or Wobbulator.
      Problem is – if you break out of the wobbulator do while loop using the button the button press becomes the select button for the menu system which selects the first option – which is sig gen.

      Anyone know how to stop this from happening?

      This is acting as an escape button…
      buttonstate2 = digitalRead(A1);
      }while (buttonstate2 == HIGH);

      the button above is the select button as well as escape, so the keypress is caught and selects the first option on the main menu instead of stopping at the main menu.

      Your help appreciated then I can pass on the project to the group here if they want to give it a try.

      I’m thinking of adding a new button for “escape” to break the loops but would prefer not to as the unit is cased up and I’d have to dismantle etc to drill a new hole for another button.

  42. Hi Rich,

    I have been using your original sketch for a while now with no problems but when I uploaded the new Rev 2.0 sketch it still doesn’t remember the last frequency. I’ve started from scratch several times with the same results. Have you any ideas what i’m doing wrong, it works perfect just won’t remember.

    • I am guessing you didn’t see this section in the Sketch… Just change to 0.

      int ForceFreq = 1; // Change this to 0 after you upload and run a working sketch to activate the EEPROM memory. YOU MUST PUT THIS TO 0 AND UPLOAD THE SKETCH AGAIN AFTER STARTING FREQUENCY IS SET!


  43. Hi Rich,
    I have built a multiband BITx Txvr designed by G6LBQ The IF is 10.7 MHz
    I am also in the process of making your DDS vfo, Thankyou for publishing your design) I managed to get the IF offset to work. but is it possible to have it change from addative to subtractive or vice versa when the frequency changes to, say above 10 MHz. Excelent project Thanks……………Peter (GW4ZUA)

  44. Rich
    I just wanted to say thank you for a wonderful website. I just assembled a prototype of the DDS VFO and it works like a champ. I plan to use it with a small amp to make a VFO to replace xtals used in the older transmitters. I am using the IF version so I can offset the sig gen during receive. I haven’t used it yet but I see no reason why it won’t work. Thanks again.
    I modified the code a bit to remove some of the tuning step choices, it was easy to do even for a non coder such as myself.
    Larry Naumann

  45. Great little project, and valuable learning tool. I didn’t get mine to work first time up, but read over the posts and found my problem, for some reason the rotary folder did not have some files when imported. Fixed problem, and now to box it. I just want to say thanks for making the code and help you gave in this project.
    John N8RVE

  46. Hello great work, and thanks for sharing. I am new to arduino and am still playing around with the starter projects. I am wotking on getting this dds working. Once I do i was wondering if there was a way to send an adjustable reset to the dds with another encoder to do burst pulses. Would like to be able to control the total pulse count and space between pulses. I have been trying to figure it out but am so lost. thanks

  47. In my version I have changed the 100 ohm resistor as follows: +5 VCC –10 k–A0—encoder. So I have cured the instability of the encoder. Thanks to YO6OGW for the right advice.

  48. Hi Rich,
    Thank you, I’ve been made the second version by your updated sketch. first try i confusing because the random frequency at 143.XXX.XXX Hz appeared on LCD display, so i read your sketch comments in program line about what we must do double uploading by 1 and 0 changes in sketch. now the DDS is working as I expected, when the system off and on again, the frequency setting still remain on last position.
    I changed the default frequency setting to 3 MHz because right now i do some 80 meter band experiments, and use this DDS VFO with Arduino Control as the frequency generator.
    thank you,

  49. After hitting some bumps (I’m new at Arduino) I have the circuit working on the breadboard. I have a nice waveform of 1V PP, open circuit and 0.5V PP across a 47 Ohm resistor. I can hear a nice strong signal in a receiver across the room. I can see this as a problem when trying to receive signals. I found that the Arduino and/or the AD9850 are too slow to recover from keying the power. I need a way to turn the VFO on while transmitting and off while receiving. Or, shift the frequency out of the receiver band-pass during receive. The 2NT transmitter I want to use has a VFO keying relay that goes to ground during transmit. Anyone have an idea?
    The OK1DXK drawing has a push button bringing pen A5 to ground through a 1k resistor. This is labeled MF Frequency Shift; I can’t see that this does anything. Maybe this is for the IF version of the Sketch?
    Stew ke4yh

    • I’m a little confused? Don’t you use the same DDS for your TX and RX. Are you using a different oscillator during TX/RX? You mentioned you’re worried about RX then say you want to turn if off for TX. I don’t know why you want to turn it off when transmitting. You may want to explain better so the forum can best answer your question.

      RE: A5
      Putting A5 to ground shifts the frequency, at least in my version of the code. The amount of shift is determined by a setting set in the top portion of the code (easily found).


  50. Hi Rich,
    I will be using separate RX and TX. Old Drake 2NT TX and R4B RX. If the VFO is running during receive it blocks incoming signals. Right now I’m using the non-IF sketch and perhaps I should be using the IF version so I can off-set the VFO during receive. Is that possible?
    Stew ke4yh

    • Yes. If you use the IF version you can then utilize the offset to move the frequency anywhere you wish during the receive.


  51. Hi,
    I have seen many people use AD7C developed Arduinoi Code with an AD9850 DDS VFO as a LO for HF receivers . But wondering how is the performance of the RX with respect to the sensitivity and spurious rejection especially around the Xtal osillating frequency of 16MHz !! Can anybody enlighten me what happens when we tune to near 16MHz region ? Thanks a lot for Rich for his wonderful code and prompt clarification of doubts.

  52. Hello,
    a few weaks ago i found a new Arduino shield. Beside LCD it also is including an increment encoder and some joystick control:
    ( )
    So my idea was, when using it in conjunction with the chinese DDS module and the UNO, this must be the ideal hardware for the DDS generator project.
    Here you can see my results:

    What else is planned, is also storing the step spacings.

    73 de Klaus, DJ7OO

  53. Hi Rich, great project. Thank you for making this available. My VFO is almost complete. Waiting for parts for the LT1253 buffer amp. I am restoring on old tube Johnson Messenger CB transceiver and converting it to 29 Mhz AM. Crystals are high $$$ now days so this is perfect for a crystal substitute. Having the IF offset will be great as the Johnson wants the receive crystals to be 455 Khz lower than the operating frequency. I will use a relay in the transceivers PTT circuit to operate the A5 switching.
    One thing I was wondering, if anyone has found a good way to CW Key the output? Possibly, this could be added into the Arduino Sketch code or the AD9850 output could be keyed? With some buffer amp and filtering these VFO’s would make nice QRP transmitters. Just need to have a way to plug in a key.
    :-) 73, Randy, W5KCM

    • Well, finally finished my DDS VFO, AD9850 Chinese module Arduino mini. The AD9850 and oscillator module ran very hot on 5 volts. Runs much cooler on 3.3 volts. Used the mod by putting 2 diodes in series with the 5 v supply. Drops the voltage to about 3.4 volts. Built the LM1253 buffer amp and this gives good clean consistent output up to 30 Mhz. Works great.
      Looking for a couple items,
      1. A way to CW key the output ?
      2. A good way to adjust the output level with a pot?
      73, Randy, w5kcm

  54. Hi there Rich. Firstly, thanks for a great and well documented project.
    I am new to Arduino, but I have found it a lot less daunting
    than some other more complex DDS sketches.
    I have changed the code around a little, and added a signal meter, using the lcdbargraph library.
    The past few weeks have been a great learning curve and I,m very pleased with the results.
    I would now like to take this further and add some memory options,but I seem to have hit a brick wall!
    Does anyone have any ideas as a starting point?
    Thanks & 73′s John G8FPN

  55. Hi
    Any one have any ideas please, i cant seem to get the rotary encoder to work, the push button part of it works fine but thats all

    Any ideas please

      Turned out to be that the brand new Rotary encoder i brought had 2 of its pins shorted out with a lump of solder, removed the solder and it now works fine, Many thanks for the design

  56. I’m really impressed with your writing skills
    as well as with the layout on your blog. Is this a paid theme or did you modify it yourself?
    Anyway keep up the nice quality writing, it’s rare to see a nice blog
    like this one these days.

  57. Hi, I have built the VFO exactly as the schematic and double checked wiring, but I am getting a very strange problem. The square and sine waves are not the same frequency as the LED display. Have the same effect on three 9850 modules? when the LCD reads 10.Mhz I get 5.8080 Mhz. At 6.0Mhz on the LCD I am getting 1.80900 Mhz.. At 4.0Mhz I am getting 191.Khz. I have not altered the sketch at all. Any ideas before I pull out more grey hairs, please

    • I would suspect you are using the IF version of the code and the difference in display vs. output frequency is because of the IF offset of 4.192mhz. Did you read my code “readme” file? The IF offset is clearly explained. Just turn it off or use the NON-IF version of the code.


  58. I never post comment like this otherwise but i feel i have to complement you for your great work. I have had an AD9850 for a while but i have never come around to doing anything with it until reading this post and the material you have put out for download. Thank you very much! Iĺl throw in a small donation too. Thanks again.

  59. Hi,

    Can we use arduino + AD9850 for an all band VFO lets say in place of a DDS VFOs made using PICs ?? Costruction of the once in you post seems to be a very simple compared to the ones with PICs. I believe only the programming needs to be worked upon for an all band VFO. What are your thoughts around this idea ??

  60. Hello
    Excuse me my English expression.
    I built the VFO. It’s working OK, but introducing the signal in a receiver (mixer NE602, FI Xtal 8 MHy) the reception shows a lot of birdies. I Have not a spctrum analycer, but I think the signal from the AD9850 is very dirty.
    I don’t know it its all OK, but it’s nok working as a VFO in communications receiver
    Any suggestion…?

    • Yes. The AD9850 has a decent output but there are some birdies. However, a lot of people use it in their projects. I believe you need to install a LOW PASS or NOTCH PASS filter on the output to get a clean signal. The higher in frequency you use on the AD9850… the more dirty the output. Anything above 25MHZ has a lot of h