Sinusoidal voltage generator

Hello,
I would like to know if it's possible to create a sinusoidal voltage using an arduino with the PWM pins ? And if possible, the required libraries.
Or if it's easier to use a Function generator to create a sinusoidal voltage.

It would be for a project where I would like to measure a frequency variation due to the inductance phenomenon.

Thanks for your help.

Natan

Assuming you mean a voltage varying like a sine curve (negative?)

PWM is just an alternance of 0V and 5V, so not with extra equipment

Simplest way is probably a DAC or a dedicated sine wave generation chip

Yes that’s it. Ok, I though that some librairary can help to create fake sine curve like the power inverter that convert direct current to alternating current.

Thanks for your answer. I will have a look how DAC work.

The built in sin() function creates a genuine sine curve. You need a DAC (digital to analog converter) to produce a voltage.

Search for Arduino DDS.

1 Like

Hi,
What frequency (range) and amplitude?

Tom... :grinning: :+1: :coffee: :australia:

of course. dead easy. Send values from a lookup table as described here

This describes a characteristic tester that uses pwm to send a ramp voltage to the device under test. An RC filter converts the PWM to a DC value. You can easily change the sketch to output a sinewave instead.

1 Like

Why don't you use one like AD9833?
https://www.analog.com/media/en/technical-documentation/data-sheets/ad9833.pdf
Its simpler.

1 Like

The frequency should be 730 Hz and voltage arround 15v

Thanks I will look your pdf.

Then you really need a DAC and an amplifier. Smoothing PWM won't work particularly well at such a high rate.

You say you want to create a sine wave, but you also say you want to measure frequency variation. If you create the wave, you know the frequency. Perhaps you mean measure phase variation due to inductive circuit?

If you explain what you are actually trying to do this will help avoid the xyproblem.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.