Maker.io main logo

Arduino Frequency Sweep Using Visual Programming

18

2025-07-17 | By Ron Cutts

License: General Public License LED / Display Drivers Oscilloscope Signal Generator Arduino

 

In this simple tutorial, we’ll learn how to create a frequency sweep using Arduino and Visuino. The frequency will smoothly sweep from 1Hz up to any desired frequency in 0.1Hz increments, all easily adjustable through visual programming.

Watch the Video!

Step 1: What You Will Need

What You Will Need

What You Will Need

Step 2: Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type

The Visuino: https://www.visuino.eu also needs to be installed. Download the Free version or register for a Free Trial.

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 in Picture 2

Step 3: In Visuino, Add Components

Step 4: In Visuino, Set Components

In Visuino Set Components

In Visuino Set Components

In Visuino Set Components

In Visuino Set Components

In Visuino Set Components

  1. If you want increments to be faster or slower than every second, select "ClockGenerator1" and change the frequency

  2. Set the Starting Frequency: Select "AnalogValue1" and in the properties window set "Value"; in our case, it is 1Hz

  3. Set the Frequency increments: Select "IntegerToAnalog1" and in the properties window set "Scale", in our case it is 0.01

  4. Set the End Frequency: Select "CompareValue1" and in the properties window set "Value" in our case it is 5Hz and set "Compare Type" to ctSmaller

  5. Select "PulseGenerator1" and in the properties window select "Frequency" and click on the pin Icon button and select "Float SinkPin"

Step 5: In Visuino Connect Components

image

  1. Connect "ClockGenerator1" pin [Out] to "Counter1" pin[In]

  2. Connect "Counter1" pin[Out] to "IntegerToAnalog1" pin[In]

  3. Connect "AnalogValue1" pin[Out] to "Add1" pin[0]

  4. Connect "IntegerToAnalog1" pin[Out] to "Add1" pin[1]

  5. Connect "Add1" pin [Out] to "AnalogMultiSource1" pin[In]

  6. Connect "AnalogMultiSource1" pin[0] to "AnalogSwitch1" pin [In]

  7. Connect "AnalogMultiSource1" pin[1] to "CompareValue1" pin [In]

  8. Connect "CompareValue1" pin[Out] to "AnalogSwitch1" pin [Enable]

  9. Connect "AnalogSwitch1" pin [Out] to "PulseGenerator1" pin[Frequency]

  10. Optional Connect "AnalogSwitch1" pin [Out] to "Arduino" Serial pin[In]

  11. Connect "PulseGenerator1" pin[Out] to "Arduino" digital pin[2]

Step 6: Generate, Compile, and Upload the Code

Generate, Compile, and Upload the Code

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.

Step 7: Play

If you power the Arduino module and connect a Frequency meter to the Arduino digital pin 2, you will be able to see the frequency increasing.

You will also be able to see the frequency increasing in the serial monitor window.

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

Download Visuino file: freq-sweep3.visuino

Mfr Part # A000066
ARDUINO UNO R3 ATMEGA328P BOARD
Arduino
$227.20
View More Details
Add all DigiKey Parts to Cart
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.