This project show how to make simple Arduino sine wave circuit with RC filter.
Arduino cannot give real analog output, but it only gives PWM signal.
So we use low pass RC filter to change PWM into smooth sine wave.
Two potentiometer control amplitude and frequency.
This circuit is very easy and good for small experiment.
Low Pass RC Filter Blocking High Frequency PWM:
Graph showing how RC filter removes high-frequency components:
Gain
1.0 |---------\
0.8 | \
0.6 | \
0.4 | \_____
0.2 | \______
0.0 |_____________________________→ Frequency
fc
fc is cutoff frequency = 1 / (2 × pi × R × C)Arduino Coding:
#include <Arduino.h>
int ampPin = A0;
int freqPin = A1;
int pwmPin = 11;
float angle = 0.0;
void setup() {
pinMode(pwmPin, OUTPUT);
}
void loop() {
int ampRead = analogRead(ampPin);
int freqRead = analogRead(freqPin);
float amplitude = map(ampRead, 0, 1023, 0, 255);
float frequency = map(freqRead, 0, 1023, 1, 50);
float sineValue = sin(angle) * amplitude + amplitude;
int pwmValue = constrain(sineValue, 0, 255);
analogWrite(pwmPin, pwmValue);
angle += 0.02 * frequency;
if (angle > 6.28) angle = 0;
}Circuit Working:

Parts List:
| Component | Value / Type | Quantity |
|---|---|---|
| Resistors | 2.2k | 1 |
| Potentiometer 10k | 2 | |
| Capacitor | Ceramic 100nF | 1 |
| Semiconductor | Arduino Uno | 1 |
This circuit show how to make simple sine wave using Arduino.
We can change sine wave frequency and amplitude very easy.
Arduino pin 11 give PWM signal out.
PWM value keep changing like sine shape.
This make digital sine form.
Then R1 with capacitor C1 make low pass filter.
Filter remove fast PWM and give smooth analog sine.
Potentiometer VR1 control amplitude going to A0.
Potentiometer VR2 control frequency going to A1.
Arduino read both values and change the output signal.
Formula with Calculation:
Low pass filter cutoff frequency formula:
fc = 1 / (2 × pi × R × C)
here,
- R is 2.2k
- C is 100nF
fc = 1 / (2 × 3.14 × 2200 × 0.0000001)
fc = 1 / (1.38 × 0.00022)
fc = 723 Hz
This is enough to smooth PWM around 31kHz of Arduino.
How to Build:
To build a Arduino Sine Wave Output Circuit with RC Filter following are the steps to follow:
- Collect all parts same like circuit diagram.
- Arduino A0 go to center pin of amplitude potentiometer VR1, other two pins go to 5V and GND.
- Arduino A1 go to center pin of frequency potentiometer VR2, other two pins go to 5V and GND.
- Arduino pin 11 connect to resistor R1 2.2k.
- Other side of R1 connect to capacitor C1 100n and other leg of capacitor go to GND.
- Point between R1 and C1 is final sine wave output.
- Make sure all grounds connect together.
Conclusion:
This Arduino Sine Wave Output Circuit with RC Filter is easy way to make smooth sine signal.
Signal is not perfect like real DAC but good for hobby and audio demo.
Two knobs give easy control for amplitude and frequency.
Easy to build and good for beginners.
Leave a Reply