+- +-

+- User

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Stats ezBlock

Members
Total Members: 144
Latest: Donald
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 2261
Total Topics: 109
Most Online Today: 17
Most Online Ever: 53
(September 16, 2016, 01:39:23 AM)
Users Online
Members: 0
Guests: 10
Total: 10

Author Topic: Arduino Square Wave Generator  (Read 29475 times)

Offline Vincent

  • Jr. Member
  • **
  • Posts: 50
  • life is a mystery
Arduino Square Wave Generator
« on: January 11, 2014, 01:56:29 PM »
Hello people.

Months ago I was tired of building oscillators and circuits with discrete components so I decided to move all my logic development to Arduino. Cheaper, simple and accurate. Also I can use the code with others ATMEL cpu's. This library wasn't wrote by me and all the credits are for the original developer.  I have more stuff to share and I will do it progressively. I highly recommend to use optocouplers for the high end section ( Mosfet Drivers, etc ).

Regards,

Vincent

Code

// Arduino UNO DDS

#include <PWM.h>

int32_t frequency_9 = 4000; //frequency (in Hz)
int32_t frequency_3 = 3000; //frequency (in Hz)
 

void setup()
{

InitTimersSafe();

SetPinFrequencySafe(9, frequency_9);
SetPinFrequencySafe(3, frequency_3);
 
}

void loop()
{
 
 int dutyC =222; // Duty Cycle 0 (0%) - 1023(100%)
 pwmWrite(9, dutyC / 4);
 pwmWrite(3, dutyC / 4);
 delay(30);
 
 }



Arduino Square Wave Generator (UNO - Mega - Pro.Mini)

Frequency Range : 1Hz to 1Mhz
Duty Cycle : 2% - 98%
Pins Out : 3 - 9

Information

http://code.google.com/p/arduino-pwm-frequency-library/downloads/list
http://forum.arduino.cc/index.php/topic,117425.0.html

Recommended Mosfet driver : FOD3180
http://www.fairchildsemi.com/ds/FO/FOD3180.pdf

Offline Romero

  • Administrator
  • Hero Member
  • *****
  • Posts: 881
Re: Arduino Square Wave Generator
« Reply #1 on: February 07, 2014, 10:01:35 PM »
@Vincent

I need an Arduino code for coil shorting where I can chose the number or shortings per pulse also duration of the shorting pulse. Do you have  or know something like that?
I will prefer to use arduino mega board 2560 with display and keypad.

Best regards,
Romero

Offline kEhYo77

  • Jr. Member
  • **
  • Posts: 61
Re: Arduino Square Wave Generator
« Reply #2 on: February 07, 2014, 10:32:04 PM »
Hi Romero.
I think I can help you with that type of code.
You just need to describe in detail what you want.
I own an ArduinoUno an 2-line and 4-line LCD displays.
Will you be using a pulse detection to trigger the shorting?

kEhYo

Offline Romero

  • Administrator
  • Hero Member
  • *****
  • Posts: 881
Re: Arduino Square Wave Generator
« Reply #3 on: February 07, 2014, 10:49:42 PM »
Hi Romero.
I think I can help you with that type of code.
You just need to describe in detail what you want.
I own an ArduinoUno an 2-line and 4-line LCD displays.
Will you be using a pulse detection to trigger the shorting?

kEhYo
Hi kEhYo,

please have a look at the picture below and you will understand.

Regards,
Romero

Offline Vincent

  • Jr. Member
  • **
  • Posts: 50
  • life is a mystery
Re: Arduino Square Wave Generator
« Reply #4 on: February 07, 2014, 11:46:18 PM »
@Vincent

I need an Arduino code for coil shorting where I can chose the number or shortings per pulse also duration of the shorting pulse. Do you have  or know something like that?
I will prefer to use arduino mega board 2560 with display and keypad.

Best regards,
Romero

Hi Romero,

You read my mind. I was working 1 month ago in that kind of code. I started from the scratch using a Zero Cross detector. Nothing fancy but it works. Originally was wrote for a dimmer and I need to finish the details about the items that are you asking.

Witch will be your trigger ? A truly clean sine-wave or a square waveform ?

@ kEhYo. Nice to meet you. Maybe the code that I started to work can help you too.

Regards, V.


Offline Vincent

  • Jr. Member
  • **
  • Posts: 50
  • life is a mystery
Re: Arduino Square Wave Generator
« Reply #5 on: February 07, 2014, 11:53:24 PM »
Hi Romero.
I think I can help you with that type of code.
You just need to describe in detail what you want.
I own an ArduinoUno an 2-line and 4-line LCD displays.
Will you be using a pulse detection to trigger the shorting?

kEhYo
Hi kEhYo,

please have a look at the picture below and you will understand.

Regards,
Romero

Sorry. I missed the pic. I understand what you want to do. The NE555 and the 4017 can be replaced by the arduino. Mixing CMOS and TTL can be done, but all most be at 5V, or a buffer to convert levels. Let me think about it.

Regads. V

Offline kEhYo77

  • Jr. Member
  • **
  • Posts: 61
Re: Arduino Square Wave Generator
« Reply #6 on: February 08, 2014, 09:07:47 AM »
Ok. I get it now.
I am working on coil shorting as well but things go slow on this. To many projects on my mind.
The arduino code for this setup shouldn't be difficult. I'll try to make some code for this soon.
I include my schematic for testing this.
Tell me what you think.
« Last Edit: February 08, 2014, 09:09:31 AM by kEhYo77 »

Offline Romero

  • Administrator
  • Hero Member
  • *****
  • Posts: 881
Re: Arduino Square Wave Generator
« Reply #7 on: February 08, 2014, 12:26:12 PM »
Ok. I get it now.
I am working on coil shorting as well but things go slow on this. To many projects on my mind.
The arduino code for this setup shouldn't be difficult. I'll try to make some code for this soon.
I include my schematic for testing this.
Tell me what you think.
Hi,

I know your schematic for long time now but never tested it.
For now I would prefer to use my idea or instead of using cd4017 to replace it with arduino code too.
There is another idea that I must get arduino code for... shorting the bemf. people never understood the importance of this years back while I was playing with coil shorting.
I can do it with magnet motors but solid state will have many advantages.


Best regards,
Romero

Offline kEhYo77

  • Jr. Member
  • **
  • Posts: 61
Re: Arduino Square Wave Generator
« Reply #8 on: February 08, 2014, 12:44:13 PM »
I got the feeling that Ismael Aviso is doing BEMF shorting :)

Offline Vincent

  • Jr. Member
  • **
  • Posts: 50
  • life is a mystery
Re: Arduino Square Wave Generator
« Reply #9 on: February 08, 2014, 10:57:07 PM »
Ok. I get it now.
I am working on coil shorting as well but things go slow on this. To many projects on my mind.
The arduino code for this setup shouldn't be difficult. I'll try to make some code for this soon.
I include my schematic for testing this.
Tell me what you think.
Hi,

I know your schematic for long time now but never tested it.
For now I would prefer to use my idea or instead of using cd4017 to replace it with arduino code too.
There is another idea that I must get arduino code for... shorting the bemf. people never understood the importance of this years back while I was playing with coil shorting.
I can do it with magnet motors but solid state will have many advantages.


Best regards,
Romero


Hi. Well the code is working. I'm just adjusting the last details. Maths are maths..

Offline Romero

  • Administrator
  • Hero Member
  • *****
  • Posts: 881
Re: Arduino Square Wave Generator
« Reply #10 on: February 08, 2014, 11:47:56 PM »
Ok. I get it now.
I am working on coil shorting as well but things go slow on this. To many projects on my mind.
The arduino code for this setup shouldn't be difficult. I'll try to make some code for this soon.
I include my schematic for testing this.
Tell me what you think.
Hi,

I know your schematic for long time now but never tested it.
For now I would prefer to use my idea or instead of using cd4017 to replace it with arduino code too.
There is another idea that I must get arduino code for... shorting the bemf. people never understood the importance of this years back while I was playing with coil shorting.
I can do it with magnet motors but solid state will have many advantages.


Best regards,
Romero


Hi. Well the code is working. I'm just adjusting the last details. Maths are maths..
Excellent,

can we do more than 2 shorts also reduce duration?

Regards,
Romero

Offline Vincent

  • Jr. Member
  • **
  • Posts: 50
  • life is a mystery
Re: Arduino Square Wave Generator
« Reply #11 on: February 08, 2014, 11:57:54 PM »
Ok. I get it now.
I am working on coil shorting as well but things go slow on this. To many projects on my mind.
The arduino code for this setup shouldn't be difficult. I'll try to make some code for this soon.
I include my schematic for testing this.
Tell me what you think.
Hi,

I know your schematic for long time now but never tested it.
For now I would prefer to use my idea or instead of using cd4017 to replace it with arduino code too.
There is another idea that I must get arduino code for... shorting the bemf. people never understood the importance of this years back while I was playing with coil shorting.
I can do it with magnet motors but solid state will have many advantages.


Best regards,
Romero


Hi. Well the code is working. I'm just adjusting the last details. Maths are maths..
Excellent,

can we do more than 2 shorts also reduce duration?

Regards,
Romero

Off course all will be customizable 100%. Main frequency, duty cycle, number of shorting pulses, pulse shorting length and time between shorting pulses.

Regards. V.

Offline Romero

  • Administrator
  • Hero Member
  • *****
  • Posts: 881
Re: Arduino Square Wave Generator
« Reply #12 on: February 09, 2014, 12:10:10 AM »
@Vincent

that is good news. If you can implement the keypad and the display then we have even a super code.

Regards,
Romero

Offline kEhYo77

  • Jr. Member
  • **
  • Posts: 61
Re: Arduino Square Wave Generator
« Reply #13 on: February 09, 2014, 03:02:31 AM »
@Vincent

Hi.

Wow, that was quick with code.
Good job!

Offline kEhYo77

  • Jr. Member
  • **
  • Posts: 61
Re: Arduino Square Wave Generator
« Reply #14 on: February 09, 2014, 03:44:46 AM »
OK, for now I dug up some old code of mine for coil shorting.
I uses a trigger pulse to start the shorting.
Needs to be changed a bit but its a good base.
Hope it helps to build upon.
Feel free to modify it.

Ill try to adapt it for LCD and no trigger but Vincent might be faster with this :)

Cheers
kEhYo

 

Recent Topics

Romero Experiments by Romero
June 10, 2017, 02:22:03 PM

Watersplitting Device via GigaHz pulse Generator by Hitman
June 23, 2016, 05:45:13 PM

Free Energy Flashlight by Hitman
February 24, 2016, 12:35:30 PM

Earth's magnetic field by Romero
January 09, 2016, 05:47:42 PM

Induction Heater of Vasily Kuznetsov by Hitman
July 01, 2015, 10:41:39 PM

Partnered output coils by Romero
June 20, 2015, 01:51:23 PM

Articol de incurajare by sinergicus
February 23, 2015, 12:54:41 PM

Dave45 work and suggestions by Dave45
December 13, 2014, 05:43:42 PM

THE MOST PROFOUND RE-DISCOVERY OF ALL TIME by Hitman
October 18, 2014, 03:54:19 PM

Despre prezent si viitor by sinergicus
October 18, 2014, 02:58:03 PM

Powered by EzPortal