Electronic – arduino – Low frequency sinus generator

arduinooperational-amplifierwien-bridge

I would like to build a sinus frequency generator that can be controlled via an Arduino. Sinus frequency would be in the low frequency regime (below 100 Hz) with a voltage around 2.5 Volts peak to peak.

I will have to use the SPI interface SPI tutorial for other purposes at my Arduino. Therefore an external IC that can be controlled via SPI is not feasible.

Additionally I would like to avoid the DDS (Digital Direct Synthesis) possibility as I would like to externalize the frequency generation.

So perhaps the sinus generation should be made with some of the standard oscillators like Wien bridge etc.

Can somebody give me a link for a circuit that fulfills my requirements and that can be controlled with an Arduino Uno?

With control I mean:

  1. On/off
  2. Frequency (this is not a must but a nice to have)
  3. Amplitude

With "I would like to externalize the frequency generation" I mean:
keep the programming logic inside Arduino clean of too much things, that a dedicated device can do better.
If I use hardware instead of software, I expect to have a less fragile setup regarding timing. If other time critical extensions come up, I have more "headroom" for them.

Best Answer

Have you considered using a look-up table of sine vs angle values and DAC (digital-to-analog converter to produce the analog output? No weinbridge or RC shift oscillators needed. This reduces your parts count and creates an elegant, simplified, precise, digitally controlled oscillator. Simply cycle thru the look-up table at the desired rate to control frequency. You may want to add a low pass filter to smooth the DAC output to reduce harmonic distortion. A lookup table can be built for 1/4 of the cycle to reduce memory needed to store values for the first quadrant (\$0-90^{\circ}\$). Then use symmetry at \$90^{\circ}\$ to build the 2nd quadrant (\$90-180^{\circ}\$). Finally, repeat the 1st and 2nd quadrant with inversion to build the 3rd and 4th quadrants (\$180-360^{\circ}\$). This completes one cycle. Higher resolution is achieved with higher bit DAC. At the max. freq of 100Hz, you should have no problem finding a DAC to do the job. Build the look-up tables values by hand calcs (error prone) or use the first few terms of the Taylor series expansion of the sine function, for example: $$\sin(x) = x-x^3/3!+x^5/5!-x^7/7!+...$$

The 1st 3 ot 4 terms should give a close approximation of the sine of the angle. \$n!\$ means n-factorial, e.g. \$5! = 5 \times 4 \times 3 \times 2 \times 1\$. So, you can actually program the equation in code and load values for each angle between 0 and 90 into memory. http://en.wikipedia.org/wiki/Sine