Saturday, October 3, 2020

Homebrew Signal Generator - Arduino and AD-9850 Module

 

                              

Arduino Nano and AD-9850 Signal Generator

The ability to generate a clean sine wave is incredibly useful to the electronic home-brewer. In testing a an audio or RF circuit you often need a tune-able, stable frequency source. Commercial ones range from very expensive, with the ability to generate arbitrary waves at very precise signal levels. For my purposes a simple sine wave generator with a variable attenuation meets most of my needs.

This Signal Generator is built using an AD-9850 Direct Digital Synthesizer and an Arduino Nano. It generates a clean sine wave from 0 to 62.5 MHz (very clean up to about 50 MHz, but still use-able up to 62.5. There are various versions of this floating around the internet, including prebuilt ones from a variety of sellers. The display is 16x2 I2C LCD. The control is a Rotary Digital Encoder with push button. Turn the encoder to change frequency. Push the button to select the tuning increment.

There are various versions of this floating around the internet. This is my implementation. 

The code and build instructions are available on Github at:

To control the AD-9850 I chose to use a DDS library written by Paul Darlington, M0XPD.  You'll need to download it from his Github repository and install it using the Arduino IDE Library Manager.  You can read Paul's original blog for details on the library.

Here is the wiring:

Signal Generator Wiring

Fit and finish details:


Signal Generator Construction

And here is what the finished product looks like:

KK4DAS Signal Generator

I've been using this in my shop over the last few months to test out circuits on the Furlough-40.  It's really useful to be able to inject a known signal at various points in the circuit and see now the downstream amplifiers and filters perform  Highly recommended!

At a recent meeting of the Vienna Wireless Society I demonstrated how straightforward it is to build this.  I went from a pile of parts to a working unit in under an hour.  Here is the video from the meeting:



If you build it please let me know in comments.

73 from Great Falls

Dean

KK4DAS

12 comments:

  1. Hello Mr. Dean:
    I was watching the video you put on Youtube about Signal Generator and was pleasantly surprised by the few components needed.
    I put it together as it is in the diagram, but when I went to check the sketch I got errors that I do not understand why since I did not write anything in it, since I do not know anything about programming, since the age exceeds me the IDE that I use is on 1.8.13.
    I could send you the errors that come out, but I don't know if it would be too much to abuse your precious time.
    Receive a greeting from the EA6OK station and continue with your projects that I find very interesting.
    Grateful Antonio.

    ReplyDelete
  2. Hi Antonio -

    I'll be happy to take a look. You can send the error messages or screen shots to KK4DAS@gmail.com

    But, before you do that - can you confirm that basic Blink sketch compiles and loads? The instructions are here: https://www.arduino.cc/en/Guide/ArduinoNano

    73,
    Dean KK4DAS

    ReplyDelete
  3. hi mr. dean, if i were to change the arduino nano into an arduino uno, will it still work and are the connections of the wires going to be any different?

    - bea

    ReplyDelete
  4. Hi Beatrice - Yes an Arduino Uno would work fine. The pins are the same.

    Good luck,
    73 Dean KK4DAS

    ReplyDelete
  5. I was planning on making a 3-channel siggen that would allow me to drive 3 loads or 3 windings of ONE load simultaneously or with a programmable/user controlled 'delay' in between each channels ooutput for a 'pulsing' effect... and each of the channels would drive a 400v, 30A (heatsinked and cooled) MOSFET with a variable input on each of 0 to 80vDC (possibly a 2nd controller) Your project would work, but would only output 2 channels at a time.. (0-40 Mhz of output waves where two outputs are specified for sine waves and two outputs are specified for square wave output. Can the Arduino (Uno/Mega) code be tweaked to drive 2 of the AD9850 devices - and more importantly, HOW would I do that??

    Thanks!

    ReplyDelete
    Replies
    1. Hi - thanks for the note. The AD9850 only has a single frequency output - either sine or square wave, inverted or not. I think you should be able run two off a single Arduino - but you would need 4 digital lines for each one. If you need three frequencies I would look at the SI5351 - it has three independent clocks and will generate signals from 2.5KHz to 200MHz. You can see an example of how to program it in my SSB Radio Control Sketch - https://github.com/kk4das/SSB_Radio_Control

      Good luck with your project,
      Dean
      KK4DAS

      Delete
  6. Thanks for the REALLY(!) quick reply - I looked at that device earlier in my planning and even though the UPPER range is better, the lower ranges 0Hz-39.99KHz where most of my testinand tuning/tweaking experimentation would start is missing. :-)

    I'll try hardwiring in a x-way rotary switch, and select from 2-3 divide by x circuits to get theem. Suggestion accepted!

    Several benefits: My upper range just expaanded 60Mhz !) and it is a workable/cheap but effective solution. Also, the extracted 2-3 ranges of LOW frequencies can easily be amplified using MOSFET drivers/ZVS power and other brute force means, and will be much more PURE. Additionally, I'll have the bonus of creating precise and arbitrary frequencies. There are three independent outputs, each with a different frequency.

    Off-the-wall Q - For you only:
    Being that you are into working and using Low, Medium and High/Very High and Ultra High RF energy - have you ever done any work using your skills on either/both TESLA or LAKHOVSKY technologies that often used these and still higher frequencies? Let me know - I have a lot to share

    ReplyDelete
  7. Here's a Link with an Arduino-based 'Signal Generation' twist I think you might appreciate :-)

    Took me forever to track down...
    >>https://www.nongnu.org/pulsefire/<<

    ReplyDelete
    Replies
    1. and... My 3 SI-5351's just arrived! So I'll be tinkering again this weekend - After I fix my wife's 22 yr old Electronic Embroidery/Sewing machine (Brother Ultima 2001) wich just stopped, AND my HP 75100 ColorInjet printer/scanner/copier that won't turn on after I fixed a feed issue :-( ...

      Delete
  8. hello, can you tell me which library for the I2C lcd was used?
    TNX from py2wy

    ReplyDelete
    Replies
    1. It is LiquidCrystal_I2C which you can download from the Arduino library manager.

      Delete