Eli5: So apparently Arduino Uno cannot output analog signals and so it uses pulse width modulation to mimic an analog signal output. So then, how can a square wave with varrying width mimic an analog signal’s sine wave?

313 views

Eli5: So apparently Arduino Uno cannot output analog signals and so it uses pulse width modulation to mimic an analog signal output. So then, how can a square wave with varrying width mimic an analog signal’s sine wave?

In: 34

18 Answers

Anonymous 0 Comments

It’s all about frequency response and filtering.

The scheme you describe is called “pulse width modulation”, and it works how you describe. For a given time period, the signal is pulsed on and off so the average amount of time that it is on is equal to the output value that you want.

Now you need a filter – specifically a low-pass filter. For dimming LEDs, our eyes do it – we interpret the PWM signal as the average value.

In other cases, it is done electronically.

There’s a very popular class of audio amplifier known as “class D” that uses this technique, and it makes light and powerful amplifiers.

Note that there are also a wide range of digital to analog converters that produce true analog output.

You are viewing 1 out of 18 answers, click here to view all answers.