Arduino Sine wave Generator

We now published an article how to generate sine waves with an arduino board using the DDS method.
The article can be found here:
playground:audio:Synthesizers and sound generation:Arduino Sinewave DDS Generator
http://interface.khm.de/index.php/lab/experiments/arduino-dds-sinewave-generator/
regards
martin

Looks pretty cool, I must play with it

That's very interesting!

That could be useful for testing circuits when you need to generate a sinewave...

I wonder if I could use this for a DC-AC inverter? I'm using a 555 timer at the moment but I'm struggling finding the perfect frequency

I think this could be useful in a capacitor/inductor measuring tool. See the following link: http://www.thekeeser.com/Electronics%20info/measure_an_unknown_inductor.htm

With your design, is it possible to generate a sine wave and then take a measurement while the sine wave is still working?

The quality of this kind of sine wave is limited by the 8-bit table and the analog reconstruction filter you need on the output of the pwm.

I would be careful about building measuring tools with this approach,

My implementation of the DDS algorithm for Arduino has a parameterization of the algorithm that could be adapted for different resolutions and table sizes and comes with some examples of how to smoothly interpolate frequecy and amplitude for Arduino music and sound applications

measurement while sine is generated can be done. have a look at my "arduino realtime audio" article where where sound is sampled, processed an given out simultaneously.
martin

This is an excellent article. Thanks for posting it.

(* jcl *)

Hi there,

I'm new to the forum, fairly new to arduino, and ridiculously new to actually using custom built things like that first link's sinewave generator. I was wondering if anyone could list the parts that were used in that project? I took the picture and schematic to radioshack, but they were only able to define half of the components used. :-/

Please be as specific as possible, so I don't manage to get confused.

Thanks in advance!

Can you say which parts Radio Shack were able to identify? That way, we could concentrate on those that they could not identify!

The three capacitors should be easy to find (two 47nF and one 100nF). The resistors, also should be no problem (two 270 Ohm and a 100k Ohm log pot). The inductors (coils) may be the problem items (two 4.7mH). The units 'mH' are milli-Henries, where a 'Henry' is the SI unit for inductance.

oh wow thank you very much!

the problems were the inductors and the long pot. also. is the long pot the only one where orientation matters?

EDIT

  1. is there any difference between axial and radial capacitors that would affect this project?

  2. if you would please, tell me where i could get one of those long pots and the inductors? because i cant seem to find them on the net.

  3. do i need a specific potentiometer or will any ohm-rating suffice.

  4. does the site say that i can just run this through active speakers without building the side apparatus? because right now i'm running the arduino tone() tutorial through a 1/4" jack into an amplifier. could i just run this code with that setup and an added potentiometer?

is the long pot the only one where orientation matters?

It's a log pot (short for logarithmic), and yes, it's the only one where orientation matters. The logarithmic track must be wired up to that minimum volume (wiper at ground end) is anti-clockwise.

  1. is there any difference between axial and radial capacitors that would affect this project?

No, either type will work.

  1. if you would please, tell me where i could get one of those long pots and the inductors? because i cant seem to find them on the net.

Just about any good component supplier will have them. In the US, Jameco, Digi-Key, Mouser. In the UK, Maplin's, Rapid, Farnell, RS.

  1. do i need a specific potentiometer or will any ohm-rating suffice.

You do not need an exact Ohm-rating, but you will need one that is approximately the right value. Anything from 47k Ohms to 500k Ohms should work OK.

oh excellent! thank you for explaining. now just to be sure(and i'm sorry for all the questions but..) i can use two 100k ohm pots, one for the pitch and one for the volume?

and any two inductors measured at 4.7mH? or are there specifics that i need to mind with the inductors also?

use two 100k ohm pots, one for the pitch and one for the volume?

Yes, but one must be linear (for the Analog Pin 0 input, frequency) and one must be log (for volume). You may find that a 10k linear or 50k linear pot works better for the frequency control.

any two inductors measured at 4.7mH?

Yes, any 4.7mH inductors will work OK. No special requirements on those.

well thank you very much sir for your patience and help! i really appreciate it!