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.
- DDS Signal Generator Module - any one of the AD9850 boards should work. I used each of these at different times:
- https://www.amazon.com/HiLetgo-AD9850-Generator-0-40MHz-Equipment/dp/B01J7XPWNU/
- https://www.amazon.com/gp/product/B082143FD9
- https://www.analog.com/media/en/technical-documentation/data-sheets/AD9850.pdf
- 16x2 I2C LCD display
- Rotary Encoder with switch
- 10K linear taper potentiometer
Here is the wiring:
Signal Generator Wiring |
Fit and finish details:
- Enclosure - 4"x3" plastic enclosure
- Panel mount BNC Connector
- PCBs = two Adafruit 1/4 sized breadboard PCBs, one for the Arduino and one for the AD-9850 module
- Mini toggle switch for power
- Panel mount 2.1mm DC barrel jack
- Mounting hardware - 4-40 standoffs and spacers, machine screws, washers and nuts
- 0.1" female headers on the breadboard make it easy to wire the components up in the case
Signal Generator Construction |
And here is what the finished product looks like:
KK4DAS Signal Generator |
73 from Great Falls
Dean
KK4DAS
Hello Mr. Dean:
ReplyDeleteI 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.
Hi Antonio -
ReplyDeleteI'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
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?
ReplyDelete- bea
Hi Beatrice - Yes an Arduino Uno would work fine. The pins are the same.
ReplyDeleteGood luck,
73 Dean KK4DAS
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??
ReplyDeleteThanks!
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
DeleteGood luck with your project,
Dean
KK4DAS
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. :-)
ReplyDeleteI'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
Here's a Link with an Arduino-based 'Signal Generation' twist I think you might appreciate :-)
ReplyDeleteTook me forever to track down...
>>https://www.nongnu.org/pulsefire/<<
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 :-( ...
DeleteGood luck.
ReplyDeletehello, can you tell me which library for the I2C lcd was used?
ReplyDeleteTNX from py2wy
It is LiquidCrystal_I2C which you can download from the Arduino library manager.
Delete