Generate 7.83Hz sine wave

Thread Starter

athulascc

Joined Aug 15, 2014
94
I need to make circuit to generate 7.83Hz sine wave accurately.
I am going to make it using arduino because I think I can get 7.83Hz accurately than 555IC.
but how to do it?
can I use PWM output and converte pulse in to sine?

or any good method than it?

thanks
 

crutschow

Joined Mar 14, 2008
34,470
You could use PWM or a DAC to generate the sinewave with typically a look-up table is used for the sinewave coefficients (the number of coefficients depending upon the sinewave accuracy and distortion level you need).
 

Lestraveled

Joined May 19, 2014
1,946
........can I use PWM output and converte pulse in to sine?..........
I create a cheap D to A function by using an R/C averaging circuit connected to the PWM output. The output voltage will roughly equal the logic high voltage times the duty factor. To create a sine wave you would build a look up table with a sine pattern. Each PWM cycle you load the next value into the PWM.

You would have to work out the number of sine points verses your clock frequency/PWM rate.

Is this kind of what you are hinting at??
 

MikeML

Joined Oct 2, 2009
5,444
A two-pole active opamp filter will make a pretty good sine wave out of a 7.83Hz 50% duty cycle sq. wave.

f.gif

Practical circuit using split +-supply opamps.

255.gif

V(a) represents the Arduino pin.
 
Last edited:

ian field

Joined Oct 27, 2012
6,536
I need to make circuit to generate 7.83Hz sine wave accurately.
I am going to make it using arduino because I think I can get 7.83Hz accurately than 555IC.
but how to do it?
can I use PWM output and converte pulse in to sine?

or any good method than it?

thanks
That's very similar to the UK PAL CTV ident oscillator - I don't even know if the US NTSC system uses anything like it, I suspect not.

The ident oscillator in a PAL CTV is synchronised by ripple in the PLL correction voltage that takes care of the "swinging burst" of 4.433MHz on alternate lines.

Sets around the 90s had a fairly substantial inductor for the ident oscillator, and it produced a quite acceptable sinewave - that triggered a bistable that switched a delay in or out of the colour signal path.

All of the frequencies associated with scan rate and colour subcarrier in a CTV are in some way harmonically related, the ident osc is 1/2 line rate.

Try dividing down the 3.58 colour crystal - you might even get lucky.

A study of CTV design might throw some light on putting a PLL between a colour crystal and your application, but the circuitry isn't trivial!
 

David Knight

Joined Aug 4, 2015
26
A two-pole active opamp filter will make a pretty good sine wave out of a 7.83Hz 50% duty cycle sq. wave.

View attachment 89668

Practical circuit using split +-supply opamps.

View attachment 89670

V(a) represents the Arduino pin.
I like this approach. A third op-amp can be used to set gain to get back to 5v peak to peak voltage if that's desired.

I also like using a DAC. It takes some firmware through. You create a lookup table and send values from the table to the DAC periodically. I like to set the period using a timer, and send the values in the interrupt service routine when the interrupt flag toggles.
 

DickCappels

Joined Aug 21, 2008
10,187
Since it is a low pass filter and the exact roll-off characteristics are not very important, the filter could simply be completely passive, made up of a cascade of RC L sections in which each succeeding section has an approximately order of magnitude increase in impedance relative to the prior section. That leaves only one op amp being needed to restore the amplitude. Did that recently at
50 Hz and looked pretty good.
 

ScottWang

Joined Aug 23, 2012
7,409
DAC frequency = Sine wave 7.83Hz x 256 dots = 2004.48Hz
You have to find a sine wave table or using Basic software to generate a sine wave and to get the values, setup the DAC frequency to 2004.48Hz and send the values according to the sine wave table to the DAC port, add an op amp RC Integrating circuit to the end to get a smooth sine wave.
 

AnalogKid

Joined Aug 1, 2013
11,056
Scott's post raises another option. How precise does the 7.63 Hz value have to be, and how much stability or frequency drift can you tolerate? 7.81 Hz is 99.7765% of 7.83, an error of 0.22%. But the frequency stability of even a cheap crystal oscillator is around 0.01%, so it may be off a tiny bit but it will sit there like a stone. If that is good enough, then you can get your output sinewave with a low cost crystal oscillator, a divider, and then either a lowpass filter, a breakpoint shaper and filter, or a sine-weighted D/A and filter. No microcontroller, no firmware.

ak
 

crutschow

Joined Mar 14, 2008
34,470
You can minimize the filter requirements to get a good sinewave from a square-wave if you first integrate the squarewave to get a triangular wave.
Then an integration of the triangle-wave will give a sinewave of about 3% distortion.
 

GopherT

Joined Nov 23, 2012
8,009
I'm curious as to what the sinewave is for? Hopefully not any biomedical/physiological purpose, since frequencies like that can induce epileptic seizures in susceptible people.
And this is true as well. Flashing light or repetitive tones. Flashing lights is the most obvious and most well known 5 - 15 Hz issue causing seizures. But, in the last 10 years, wind turbines have been suspected to cause similar issues with sound pressure waves. As the blade passes the tower, a pressure differential occurs and some people have developed physical symptoms related to the 5 to 15 Hz. The newer towers are more aerodynamically designed and the blades are set more forward to reduce the pressure differential. Newer turbines are getting bigger and bigger so it becomes difficult yo hit that 7-9 Hz frequency that is most bothersome. Most people agree that more research needs to be done but little opportunity exists to put healthy people in front if wind turbines that happen to be spinning at just the right speed.

In any case, be careful with your sine wave generator.
 

AnalogKid

Joined Aug 1, 2013
11,056
Ditching any kind of D/A and getting back to a square wave, this probably is a good application for a resonant filter topology such as one of the twin-t variants or something gyrator based. In only one stage it would deliver much better harmonic suppression than a multi-pole filter without the component matching problems. A passive L-C is possible, but at 8 Hz anything with a decent Q would be massive.

ak
 

ian field

Joined Oct 27, 2012
6,536
You can minimize the filter requirements to get a good sinewave from a square-wave if you first integrate the squarewave to get a triangular wave.
Then an integration of the triangle-wave will give a sinewave of about 3% distortion.
There's a trick of the trade sometimes used in cheap function generators to convert a triangle wave into something approaching a sinewave.

It involves 2 series strings of diodes in inverse parallel and is usually somewhere near the feedback loop of an op-amp.

That's all the detail I remember - but someone may just happen to search in the right place now its mentioned.
 

GopherT

Joined Nov 23, 2012
8,009
There's a trick of the trade sometimes used in cheap function generators to convert a triangle wave into something approaching a sinewave.

It involves 2 series strings of diodes in inverse parallel and is usually somewhere near the feedback loop of an op-amp.

That's all the detail I remember - but someone may just happen to search in the right place now its mentioned.
You and @crutschow are on the same page...
See post 13
 

crutschow

Joined Mar 14, 2008
34,470
Here is an LTspice simulation for going from a square-wave to a sine-wave with a few percent distortion using double integration.
Further filtering can reduce the distortion further if needed.
The output amplitude varies with frequency, of course, but that's not a problem for a fixed frequency output.

Squre to Sine.GIF
 

Attachments

Last edited:
Top