Join us in the search for Free Energy. Share your experiments and discoveries, post your build logs, and discuss.

We have a strict No-Troll policy. So you can post without fear of being ridiculed.

New Members- Check Your Spam Folder For Activation Link

Please read our Rules. Any problems or suggestions- Contact Us

 

Other Overunity Forums:

Overunity Machines   ||   Overunity Research



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pulse Exact Frequencies
#1
I just wanted to post this in case it helps others..

Using arduino and H-bridge to flip polarities, it can be difficult to pulse DC square waves at exact controllable frequencies without complex timers, etc.  And counting delay microseconds is hit or miss..

I figured out a way to use the "Tone Function" to control frequency of pulses.  Just have to change the Hz value in the code and it's dead on..  I been playing with a resonance circuit and the frequency on the scope is exact..  Be aware- it will only work up to 31 Khz tho..


!!!!!!!!!!!!!!!!!!!!!!!!!!  CODE !!!!!!!!!!!!!!!!!!!!!!!

int r1 = 6;
int r2 = 7;
int receiver = 8;

void setup(){

  pinMode(r1, OUTPUT);
  pinMode(r2, OUTPUT);
  pinMode(receiver, INPUT);
  tone(5, 1000);

}

void loop() {

if (receiver == HIGH)
  {
  digitalWrite(r1, LOW);
  digitalWrite(r2, HIGH);
  }
else
{
digitalWrite(r1, HIGH);
digitalWrite(r2, LOW);
 
}


}

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Now on the arduino, put a jumper from D5 to D8.  And connect your H bridge PWM inputs to pins 6 and 7.  Thats it....
To change frequency-  find this code "tone(5, 1000);"  and change 1000 to whatever hertz you want up to 31000 Hz.

Maybe someone will find this useful!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)