In this tutorial, weβll use the Arduino Uno R4 WiFiβs built-in DAC and LED Matrix to build a simple signal generator capable of producing sine, square, and triangle waves.
The built-in DAC (Digital-to-Analog Converter) is used to generate the analog waveforms directly from the board. The DAC on the Arduino Uno R4 WiFi provides 12-bit resolution (0β4095 levels) and outputs an analog voltage from 0V up to approximately 3.3V, allowing smooth waveform generation.
A rotary encoder is used to change the output frequency, while pressing the encoder button switches between the different waveform types.
The currently selected waveform is shown as an icon on the LED matrix, and when the encoder is rotated, the selected frequency value is displayed so you can easily adjust the signal in real time.
This project demonstrates how to create a compact waveform generator using the Arduino Uno R4 WiFi, combining the DAC output, rotary encoder input, and the onboard LED matrix display.
The result is a small interactive signal generator capable of generating sine, square, and triangle waves with adjustable frequency while providing visual feedback directly on the board.
Note: The project uses the built-in DAC and LED matrix of the Arduino Uno R4 WiFi, so only a rotary encoder is required as external hardware.
Watch the Video!
You can download the Visuino file below.
Step 1: What You Will Need- Arduino UNO R4 Wifi
- Rotarry Encoder
- Breadboard
- Jumper wires
- Oscilloscope (Optional to see the output signal)
- Visuino program: Download Visuino
- Connect Encoder pin [CLK] to Arduino pin [3]
- Connect Encoder pin [DT] to Arduino pin [4]
- Connect Encoder pin [SW] to Arduino pin [2]
- Connect Encoder pin [+ (VCC)] to Arduino pin [5V]
- Connect Encoder pin [GND] to Arduino pin [GND]
- Connect Arduino pin [A0] to oscilloscope Signal pin (probe)
- Connect pin [GND] to oscilloscope GND (probe)
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 R4 WiFi" as shown on Picture 2
Step 4: In Visuino Add Components- Add "Rotary Encoder Sensor" component
- Add "Integer To Analog" component
- Add "Sine Analog Generator" component
- Add "Square Analog Generator" component
- Add "Triangle Analog Generator" component
- Add "Analog Mux(Multi channel Switch)" component
- Add "Debounce Button" component
- Add "Counter" component
- Add "Clock Demux(Multiple Output channel Switch)" component
- Select Arduino UNO R4 WiFi and in the properties Modules > Display > Orientation set to goDown
- Select Arduino UNO R4 WiFi and in the properties Modules > Display > Elements click on the 3 dots and in the Elements window:
- Drag "Fill Screen" to the left side
- Drag "Text Field" to the left side and in the properties window select "Elements" and click on the 3 dots button, In the Elements window drag "Font" to the left side and in the properties window set "Font" to Adafruit\Picopixel
Close this Elements window
- And drag in the main Elements window drag "Draw Bitmap" to the left side and in the properties window load Sine_wave.png
- drag another "Draw Bitmap" to the left side and in the properties window load Square_wave.png
- drag another "Draw Bitmap" to the left side and in the properties window loadTriangle_wave.png
- Select "RotaryEncoderSensor1" and in the properties set "Max" > "Value" to 100, and "Roll Over" to False
- Select "RotaryEncoderSensor1" and in the properties set "Min" > "Value" to 0, and "Roll Over" to False
- Select "SineAnalogGenerator1" and in the properties select "Frequency" and click on the pin icon and select "Float Sink Pin"
- Select "SquareAnalogGenerator1" and in the properties select "Frequency" and click on the pin icon and select "Float Sink Pin"
- Select "TriangleAnalogGenerator1" and in the properties select "Frequency" and click on the pin icon and select "Float Sink Pin"
- Select "Counter1" and in the properties set "Max" > "Value" to 2
- Select "Counter1" and in the properties set "Min" > "Value" to 0
- Select "Mux1" and in the properties window set "Input Pins" to 3
- Select "MultiSource1" and in the properties window set "Input Pins" to 4
- Select "ClockDemmux1" and in the properties window set "Input Pins" to 3
- Connect Counter1 pin [Out] to MultiSource1 pin [In]
- Connect MultiSource1 pin [0] to Mux1 pin [Select]
- Connect MultiSource1 pin [1] to Arduino > Display > Fill Screen1 pin [Clock]
- Connect MultiSource1 pin [2] to ClockDemux1 pin [Select]
- Connect MultiSource1 pin [3] to ClockDemux1 pin [In]
- Connect ClockDemux1 pin [Output 0] to Arduino > Display > Draw Bitmap1 pin [Clock]
- Connect ClockDemux1 pin [Output 1] to Arduino > Display > Draw Bitmap2 pin [Clock]
- Connect ClockDemux1 pin [Output 2] to Arduino > Display > Draw Bitmap3 pin [Clock]
- Connect Mux1 pin [Out] to Arduino DAC pin [14]
- Connect RotaryEncoderSensor1 pin [Out] to Arduino > Display > Fill Screen1 pin [Clock]
- Connect RotaryEncoderSensor1 pin [Out] to Arduino > Display > Text Field1 pin [In]
- Connect RotaryEncoderSensor1 pin [Out] to IntegerToAnalog1 pin [In]
- Connect Arduino Digital pin [3] [Out] to RotaryEncoderSensor1 pin [Clock (A)]
- Connect Arduino Digital pin [4] [Out] to RotaryEncoderSensor1 pin [Direction (B)]
- Connect Arduino Digital pin [2] [Out] to Button1 pin [In]
- Connect Button1 pin [Out] to Counter1 pin [In]
- Connect IntegerToAnalog1 pin [Out] to SineAnalogGenerator1 pin [Frequency]
- Connect IntegerToAnalog1 pin [Out] to SquareAnalogGenerator1 pin [Frequency]
- Connect IntegerToAnalog1 pin [Out] to TriangleAnalogGenerator1 pin [Frequency]
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 9: PlayCongratulations! 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.com
#Arduino #SignalGenerator #ArduinoDAC #LEDMatrix












Comments