Go Down

Topic: Arduino Sine wave Generator (Read 6868 times) previous topic - next topic

marnaw

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

Osgeld

Looks pretty cool, I must play with it
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

TeamMCS

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

flyboy

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?

adrianfreed

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 <a href="http://www.adrianfreed.com/content/arduino-sketch-high-frequency-precision-sine-wave-tone-sound-synthesis">Arduino music and sound applications</a>

marnaw

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

jluciani

This is an excellent article. Thanks for posting it.

(* jcl *)
www: http://www.wiblocks.com
twitter: http://twitter.com/wiblocks

ichi1984

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!

Anachrocomputer

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.

ichi1984

#9
Mar 23, 2010, 12:38 am Last Edit: Mar 23, 2010, 12:54 am by ichi1984 Reason: 1
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?

Anachrocomputer

Quote
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.

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


No, either type will work.

Quote
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.


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

Quote
3. 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.

ichi1984

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?

Anachrocomputer

Quote
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.

Quote
any two inductors measured at 4.7mH?


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



ichi1984

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

Go Up