Arduino DDS Frequency Sweep - Signal Generator AD9850

by RonFrtek in Circuits > Arduino

581 Views, 2 Favorites, 0 Comments

Arduino DDS Frequency Sweep - Signal Generator AD9850

Arduino DDS Frequency Sweep - Signal Generator AD9850

In this tutorial we will learn how to make a Pulse Generator with a Frequency Sweep using DDS Frequency Signal Generator AD9850.

Pulse generator will start with 1Hz and increase its frequency for 0.5Hz every second. Once it reaches 10Hz it wil stop increasing the frequency.

You can set your own Starting frequencyEnd frequency, Frequency increment, and the increment interval.

The output will be Square waves or Sine Waves.

What You Will Need

s-l640 (1).jpg
arduino.jpg
oled.jpg
VisuinoAdvrtisemenESPNowESP32C3-1.jpg
F5OFEUQJJ4ZYFKY.LARGE.jpg
breadboard.png
pngegg.png
  • Arduino Uno or any other Arduino board
  • AD9850 (DDS Synthesizer) More Info
  • OLED Display
  • Jumper wires
  • Breadboard
  • Visuino software: Download here
  • Oscilloscope (Optional)


Brought by PCBWay

2022-08-26_13-41-18.jpg
FHUQHJ6LF9Y8DUL.png

Thank you PCBWay for supporting this tutorial and helping users learn more about electronics.

NEW! Now you can get Aluminum PCB & FLEX PCB in their Special Offer!

What I like about the PCBWay is that you can get 10 boards for approximately $5 which is really cost effective for professional made boards, not to mention how much time you save!

Go check them out here. They also offer a lot of other stuff in case you might need it like assembly3D printingCNC machining and a lot more.

Output Response

2023-04-17_16-06-58.jpg
2023-04-17_16-07-23.jpg

You can see the output results for the frequency 10Hz

  • First picture is Scope connected to SQ Wave 1 pin
  • First picture is Scope connected to Sine Wave 1 pin


The Circuit

2023-04-17_15-43-54.jpg
FUJ5N78KHCC45R2.jpg
20230417_153251.jpg
  • Connect "AD9850" module pin Serial "W_CLK" to Arduino Digital pin 8
  • Connect "AD9850" module pin Serial "FQ_UD" to Arduino Digital pin 9
  • Connect "AD9850" module pin Serial "Serial Data" to Arduino Digital pin 11
  • Connect "AD9850" module pin Serial "Reset" to Arduino Digital pin 10
  • Connect "AD9850" module pin VCC to Arduino pin 5V
  • Connect "AD9850" module pin GND (On both sides) to Arduino pin GND


  • Connect OLED Display pin [SCL] to Arduino pin [SCL]
  • Connect OLED Display pin [SDA] to Arduino pin [SDA]
  • Connect OLED Display pin [VCC] to Arduino pin [5v]
  • Connect OLED Display pin [GND] to Arduino pin [GND]


Start Visuino, and Select the Arduino UNO Board Type

select-board-uno.jpg
Visuino-Select-Board-UNO.jpg

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

In Visuino Add Components

2023-04-17_15-47-54.jpg
F3EFQSWL74RS11J.jpg
F5WCXHVL74RS11D.jpg
FAGVSP2L74RS11K.jpg
FCBQESSL74RS11C.jpg
FDLETYTL74RS11I.jpg
FO7UPUDL74RS11G.jpg
FPHNGMXL74RS11E.jpg
FUREAVQL74RS11F.jpg
FV3D692L74RS11H.jpg
  • Add "Clock Generator" component
  • Add "Counter" component
  • Add "Analog Value" component
  • Add "Integer To Analog" component
  • Add "Add Analog" component
  • Add "Analog Multi Source" component
  • Add "Compare Analog Value" component
  • Add "Analog On/Off Switch" component
  • Add "OLED I2C" component
  • Add "Analog Devices Serial DDS Synthesizer (Signal Generator) - AD9850" component


In Visuino Set Components

2023-04-17_15-53-59.jpg
F2MSVSIL74RS4PQ.jpg
F16QA3UL74RS4PY.jpg
FDFW8U6L74RS4PX.jpg
FFC0V1BL74RS4PW.jpg
FHOQRGXL74RS4PR.jpg
FP9JLRPL74RS4PP.jpg
FTRD8BFL74RS4PZ.jpg
  • Set the Interval: Select "ClockGenerator1" and in the properties window set frequency, in our case it is 1Hz, this means that the frequency will increase every second
  • Set Start Frequency: Select "AnalogValue1" and in the properties window set "Value", in our case it is 1, this means that we will start with the frequency 1Hz
  • Set Frequency Increment: Select "IntegerToAnalog1" and in the properties window set "Scale", in our case it is 0.5, this means that the frequency will increase for 0.5Hz every time
  • Set End Frequency: Select "CompareValue1" and in the properties window set "Compare Type" to ctSmaller and "Value", in our case it is 10, this means that the frequency will stop increasing at 10Hz
  • Select "Synthesizer1" and in the properties window select "Frequency" and click on the Pin Icon and select "Float SinkPin"


  • Double click on the "DisplayOLED1" and in the "Elements" window drag "Draw Text" to the left side and in the Properties window set "Text" to "Frequency" and "Size" to 2
  • In the "Elements" window drag "Text Field" to the left side and in the Properties window set "Size" to 2 and "Y" to 30
  • Close the "Elements" window


In Visuino Connect Components

2023-04-17_15-58-21.jpg
freq-sweep.png
  • Connect "ClockGenerator1" pin [Out] to "Counter1" pin[In]
  • Connect "Counter1" pin [Out] to "IntegerToAnalog1" pin[In]
  • Connect "AnalogValue1" pin [Out] to "Add1" pin[0]
  • Connect "IntegerToAnalog1" pin [Out] to "Add1" pin[1]
  • Connect "Add1" pin [Out] to "AnalogMultiSource1" pin[In]
  • Connect "AnalogMultiSource1" pin [0] to "AnalogSwitch1" pin[In]
  • Connect "AnalogMultiSource1" pin [1] to "CompareValue1" pin[In]
  • Connect "CompareValue1" pin [Out] to "AnalogSwitch1" pin[Enable]
  • Connect "AnalogSwitch1" pin [Out] to "Synthesizer1" pin[Reset]
  • Connect "AnalogSwitch1" pin [Out] to "Synthesizer1" pin[Frequency]
  • Connect "AnalogSwitch1" pin [Out] to "DisplayOLED1" > "Text Field1" pin[In]
  • Connect "DisplayOLED1" pin [I2C] to Arduino pin[I2C]
  • Select "Synthesizer1" component and connect pin "Word Load Clock" to Arduino digital pin 8
  • Select "Synthesizer1" component and connect pin "Frequency Update" to Arduino digital pin 9
  • Select "Synthesizer1" component and connect pin "Reset" to Arduino digital pin 10
  • Select "Synthesizer1" component and connect pin "Data" to Arduino digital pin 11


Generate, Compile, and Upload the Arduino Code

FBR42I2KXBU01YW.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the Arduino module, The OLED Display will show the increasing Frequency. If you have an Oscilloscope you can connect it to the AD9850 SQ Wave 1 pin (see wiring schematic) or AD9850 Sine Wave 1 pin (see wiring schematic).

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this tutorial, you can download it and open it in Visuino: https://www.visuino.eu