Generate 7.83Hz sine wave

Discussion in 'General Electronics Chat' started by athulascc, Aug 4, 2015.

  1. athulascc

    Thread Starter Member

    Aug 15, 2014
    86
    1
    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
     
  2. crutschow

    Expert

    Mar 14, 2008
    13,028
    3,237
    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).
     
  3. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,801
    1,105
    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.
     
    GopherT and atferrari like this.
  4. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    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??
     
  5. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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: Aug 4, 2015
    cmartinez likes this.
  6. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    784
    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!
     
    cmartinez likes this.
  7. jjw

    Member

    Dec 24, 2013
    173
    31
  8. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    Schumann resonance?

    ak
     
    atferrari likes this.
  9. David Knight

    New Member

    Aug 4, 2015
    26
    5
    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.
     
    athulascc likes this.
  10. DickCappels

    Moderator

    Aug 21, 2008
    2,658
    632
    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.
     
  11. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    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.
     
  12. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    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
     
    GopherT likes this.
  13. crutschow

    Expert

    Mar 14, 2008
    13,028
    3,237
    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.
     
  14. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    764
    That's it! I was trying to remmeber and you came with the name.
     
  15. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,823
    ScottWang and Sinus23 like this.
  16. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,823
    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.
     
  17. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    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
     
  18. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    784
    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.
     
  19. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,823
    You and @crutschow are on the same page...
    See post 13
     
  20. crutschow

    Expert

    Mar 14, 2008
    13,028
    3,237
    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
     
    Last edited: Aug 6, 2015
    athulascc and ScottWang like this.
Loading...