Well I didn't think I'd be able to do all this, but I made more additions to the Arduino VIC Resonator. :hedidit: I'll surely need someone to pick this apart to see if I did it correctly, even though it does work. O:-)
Update ver. 0.2.11 alpha
-Cleaned up comment alignment
-Increased LCD to use 3 rows, 4 rows are possible in the future
-Relabled LCD frequency titles to Stanley Meyer terminology. T1= step charge frequency and T3= gate frequency
-Reorganized the LCD, changed text to all caps
-Added manual adjustment for step charging frequency via two plus or minus pushbuttons
-Manual push buttons have an associated potentiometer that adjust the scale (1 Hz to 1 KHz) for fine or coarse tuning
-The step charge frequency range has a lower and upper limit of 31 Hz and 24390 Hz, which seems to be an Arduino limitation
Code: [Select]
I have a video to edit showing my progress. I also want to make an updated circuit probably with KiCAD. I'm still working on my output circuit, I still need to combine the signals.
Nate
Update ver. 0.2.11 alpha
-Cleaned up comment alignment
-Increased LCD to use 3 rows, 4 rows are possible in the future
-Relabled LCD frequency titles to Stanley Meyer terminology. T1= step charge frequency and T3= gate frequency
-Reorganized the LCD, changed text to all caps
-Added manual adjustment for step charging frequency via two plus or minus pushbuttons
-Manual push buttons have an associated potentiometer that adjust the scale (1 Hz to 1 KHz) for fine or coarse tuning
-The step charge frequency range has a lower and upper limit of 31 Hz and 24390 Hz, which seems to be an Arduino limitation
/*
VIC Resonator written by Zissis aka zchiotis on open-source-energy.org forum.
Downloaded from open-source-energy.org/?topic=1097.0
Version 0.2.10 beta changes made by firepinto
Version 0.2.11 alpha changes made by firepinto 10/30/14
*/
#include <TimerOne.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
#define TIMECTL_MAXTICKS 4294967295
#define TIMECTL_INIT 0
#define PICKUP A0 //pickup coil is connected to pin A0 via voltage divider and a zener diode
#define TONEOUT 9 //Output to the VIC primary coil
#define GATEOUT 10 //Output pin for Gate signal
#define GATEDUTY A2 //potentiometer connected to A2 to set gating pulse duty
#define BTN 8 //button for scan order is connected to pin D8
#define GATESET A1 //potentiometer connected to A1 pin to set gating frequency
#define LOCKLED 12 //LED - indicator when the frequency is locked, pin D1 *Changed from D1 to D12 just to be next to the new scan LED pin - firepinto 10/25/14
#define SCANLED 11 //LED - indicator when scanning, pin D0 *Changed from D0 to D11 because of serial uploading issues from the IDE - firepinto 10/25/14
#define PEAKLED 13 //LED - indicates when pickup coil input A0 is at or near 5 volts. *Added by firepinto 10/26/14
#define FRANGE A3 //potentiometer connected to A3 to set the scale for manual frequency adjust buttons
#define FREQPLUS 18 //Push Button for adjusting frequency higher
#define FREQMINUS 19 //Push Button for adjusting frequency lower
// #define GATELED 13 //LED - Gating indicator
int hz = 500;
int freq = 0; //Variable for Locked frequency
int freqplus = 0; //Low end of freqency fine tune scale - firepinto 10/27/14
int freqminus = 0; //High end of freqency fine tune scale - firepinto 10/27/14
int freqrange = 0; //Variable for FRANGE POT
int scale = 0; //Scale variable in Hz for manual frequency adjust buttons
int adjfreq = freq; //Resulting frequency from auto scan and fine tune - firepinto 10/27/14
int volt = 0;
int vmax = 0;
int intval = 0;
int gateread = 0;
int gatef = 1;
int duty = 512;
int dutyP = 0;
int freqmstate = 0; //Variable for minus button manual frequency adjustment
int freqpstate = 0; //Variable for plus button manual frequency adjustment
int lastmstate = 0; //last state for minus button
int lastpstate = 0; //last state for plus button
unsigned long it = 0;
unsigned long itlcd = 0;
unsigned long reflcd = 250; // LCD refresh rate mS
int odd = false;
byte lock[8] = { //custom character, it's a lock
B01110,
B10001,
B10001,
B11111,
B11011,
B11011,
B11111,
B00000
};
void setup()
{
lcd.createChar(0, lock);
lcd.begin(16, 3);
lcd.print("VIC SCAN CIRCUIT");
lcd.setCursor(0,1);
lcd.print("VER. 0.2.11alpha"); //print version to screen
delay(5000);
// Serial.begin(9600);
pinMode(TONEOUT, OUTPUT);
pinMode(GATEOUT, OUTPUT);
pinMode(GATEDUTY, INPUT);
pinMode(PICKUP, INPUT); //initializing the pins
pinMode(BTN, INPUT);
pinMode(GATESET, INPUT);
pinMode(FRANGE, INPUT); //firepinto - 10/27/14
pinMode(LOCKLED, OUTPUT); //firepinto - 10/27/14
pinMode(SCANLED, OUTPUT); //firepinto - 10/27/14
pinMode(PEAKLED, OUTPUT); //firepinto - 10/27/14
pinMode(FREQPLUS, INPUT); //firepinto - 10/27/14
pinMode(FREQMINUS, INPUT); //firepinto - 10/27/14
// pinMode(GATELED, OUTPUT); //unused as of ver. 0.2.10a
Timer1.initialize(1000000);
}
void loop()
{
vmax = 0; //comment if you want to keep the best frequency of all scans
intval = 0; //comment if you want to see the frequency found interval in all scans
noTone(TONEOUT); // used to have LOCKLED pin
digitalWrite(LOCKLED, LOW);
Timer1.stop();
digitalWrite(GATEOUT, LOW);
//digitalWrite(GATELED, LOW); //unused as of ver. 0.2.10a
lcd.clear();
lcd.print(" SCANNING... ");
digitalWrite(SCANLED, HIGH);
lcd.setCursor(11,1);
lcd.print("Hz");
for (hz=500; hz<=18000; hz=hz+10) //start from 500hz to 18khz to oscillate the circuit
{
tone(TONEOUT,hz); //will send a tone at first
delay(1); //wait for a millisec
volt = analogRead(PICKUP); //then read the voltage
if (volt > 818) //If pick-up coil voltage is greater than 4 volts
{
digitalWrite(PEAKLED, HIGH); //turn on peak LED
}
else
{
digitalWrite(PEAKLED, LOW); //turn off peak LED
}
if (vmax < volt) //if there is a resonant point voltage should have the highest value on this frequency
{
vmax = volt; //store as the best voltage
freq = hz; //remember that frequency
intval = intval++; //times found a nice frequency interval, is showing during scan on the left of the lcd
lcd.setCursor(0,1);
lcd.print(intval);
}
lcd.setCursor(5,1);
lcd.print(hz);
}
for (hz=24390; hz>=500; hz=hz-10) //do the same for a descent scan
{
tone(TONEOUT,hz);
delay(1);
volt = analogRead(PICKUP);
if (volt > 818) // *Added by firepinto 10/26/14
{
digitalWrite(PEAKLED, HIGH);
}
else
{
digitalWrite(PEAKLED, LOW);
}
if (vmax < volt)
{
vmax = volt;
freq = hz;
adjfreq = freq;
intval = intval++ ;
lcd.setCursor(0,1);
lcd.print(intval);
}
if (hz < 10000)
{
lcd.setCursor(9,1);
lcd.print(" ");
}
lcd.setCursor(5,1);
lcd.print(hz);
}
digitalWrite(SCANLED, LOW);
tone(TONEOUT,freq); //output the frequency found with higher voltage reading
//tone(LOCKLED, (4)); //LOCKLED isn't on a PWM pin - firepinto 10/27/14
lcd.clear();
lcd.print("RESONANCE FOUND");
lcd.setCursor(4, 1);
lcd.print("@");
lcd.setCursor(6, 1); //printing to LCD
lcd.print(freq);
lcd.setCursor(12, 1);
lcd.print("Hz");
delay(1500); //Changed from delay(2500); to delay(1500); - firepinto 10/26/14
lcd.clear();
lcd.setCursor(2, 0);
lcd.print("WAITING FOR");
lcd.setCursor(0, 1);
lcd.print("STABILIZATION...");
delay(2500); //waiting for a stabilizing time for the circuit, comment to avoid *Changed from delay(5500); to delay(2500); - firepinto 10/26/14
volt = analogRead(PICKUP); //read again the voltage from the pickup coil
if (volt > 818) // *Added by firepinto 10/26/14
{
digitalWrite(PEAKLED, HIGH);
}
else
{
digitalWrite(PEAKLED, LOW);
}
if (volt > vmax-51) //check if read voltage is less than 10% of the best voltage found
{
lcd.clear(); //if not, scan will start again
lcd.setCursor(3,0);
lcd.print("FREQUENCY");
lcd.setCursor(1,1);
lcd.write(byte(0));
lcd.setCursor(3,1);
lcd.print(" LOCKED");
//noTone(SCANLED); //LOCKLED pin doesn't have PWM - firepinto 10/27/14
digitalWrite(LOCKLED, HIGH);
delay(1000); //Changed from delay(2000); to delay(1000); - firepinto 10/26/14
}
/* //This section doesn't seem to do anything so I commented it out. firepinto - 10/30/14
lcd.clear();
lcd.setCursor(14,0);
lcd.print("V=");
lcd.setCursor(16,0);
lcd.print(volt);
lcd.setCursor(0,0);
lcd.print("T1= Hz");
lcd.print(" ");
lcd.setCursor(3,0);
lcd.print(freq);
*/
adjfreq = freq; //sets adjustable frequency equal to the locked frequency
while (digitalRead(BTN) == LOW) //until the scan button is pressed, do the following
{
tone(TONEOUT,adjfreq); //turns on pulse signal to pin 9 with adjustable frequency
gateread = analogRead(GATESET); //reads Gate frequency potentiometer and sets the variable
duty = analogRead(GATEDUTY); //read the gating set value from pin A1
freqrange = analogRead(FRANGE); //reads the scale for manual frequency adjustment buttons from the potentiometer and sets the variable
gatef = map (gateread, 0, 1023, 1, 120); //limit the gating frequency from 1 to 120 hz
scale = map (freqrange, 0, 1023, 1, 1000); //limit the gating frequency from 1 to 120 hz ---fp
dutyP = map (duty, 0, 1023, 100, 0); //translate T(miliseconds) into f(Hz) for gating frequency
Timer1.pwm(GATEOUT, duty, 1000000/gatef); //turns on Gating signal to pin 10
//unused as of ver. 0.2.10a
//if (istime(&it,*******)) //start Gating function
//{ //"IsTime()" function will return a pulse of a true value every set miliseconds
//odd = !odd;
// if (odd) //if odd variable is true, turn on frequency generation
// {tone(TONEOUT,freq);
// digitalWrite(GATELED, HIGH); //light an LED also because we can! :P
volt = analogRead(PICKUP); //read the voltage on the VIC *Needed to uncomment this line for the pick up coil voltage to be read during gating - firepinto 10/25/14
if (volt > 818) //If pickup coil voltage is over 4 volts at pin, light LED. *Added by firepinto 10/26/14
{
digitalWrite(PEAKLED, HIGH); //Turn ON pick-up coil peak voltage LED
}
else
{
digitalWrite(PEAKLED, LOW); //Turn OFF pick-up coil peak voltage LED
}
// } //unused as of ver. 0.2.10a
// else //or if odd is false, turn off frequency generation
// {
// volt = analogRead(PICKUP);
// noTone(TONEOUT);
// digitalWrite(GATELED, LOW);
// }
// }
freqpstate = digitalRead(FREQPLUS); //reads frequency plus push button and sets the variable to its value
{
if (adjfreq < 24390) //sets maximum frequency to 24390 through the manual "plus" push button
{
if (lastpstate != 1) //if last state of plus button does not equal 1
{
if (freqpstate == HIGH) //if plus button state is HIGH
{
adjfreq+=scale; //Add scale frequency to adjustable frequency
digitalWrite(SCANLED, HIGH); //Turn on Scan LED
lastpstate = freqpstate; //set plus button last state variable
delay(100); //100 millisecond delay for button debounce (there may be a better option than this)
}
else //if not
{
digitalWrite(SCANLED, LOW); //Turn off Scan LED
lastpstate = freqpstate; //set plus button last state variable
}
}
else //if not
{
lastpstate = freqpstate; //set plus button last state variable
}
}
freqmstate = digitalRead(FREQMINUS); //reads frequency increase push button and sets the variable to its value
if (adjfreq > scale) //sets minimum frequency to the scale frequency through the manual "minus" push button
{
if (lastmstate != 1) //if last state of minus button does not equal 1
{
if (freqmstate == HIGH) //if minus button state is HIGH
{
adjfreq-=scale; //Subtract scale frequency from adjustable frequency
digitalWrite(SCANLED, HIGH); //Turn on Scan LED
lastmstate = freqmstate; //set minus button last state variable
delay(100); //100 millisecond delay for button debounce (there may be a better option than this)
}
else //if not
{
digitalWrite(SCANLED, LOW); //Turn off Scan LED
lastmstate = freqmstate; //set minus button last state variable
}
}
else //if not
{
lastmstate = freqmstate; //set minus button last state variable
}
}
}
if (adjfreq < 31) //blocks the minus push button from going lower than 31 Hz
{
adjfreq = 31;
}
if (adjfreq > 24390) //blocks the plus push button from going higher than 24390 Hz
{
adjfreq = 24390;
}
double vdisp = volt*(5.0/1023.0); //scale digital signal to analog 0.0 - 5.0 volts
if (adjfreq == 0) //resets adjustable frequency to locked frequency if it is zero
{
adjfreq = freq;
}
if (adjfreq != freq) //if adjustable frequency does not equal locked frequency.
{
digitalWrite(LOCKLED, LOW); //then turn off Lock LED
}
else //if not
{
digitalWrite(LOCKLED, HIGH); //turn on Lock LED
}
if (istime(&itlcd,reflcd)) //Original ver. 0.2.10a code
{ //Reorganized LCD and relabeled titles to Stanley Meyer terminology (May want to print titles elsewhere so they don't need to continually refresh and slow down the program, if possible)
lcd.setCursor(0,0); //Move to digit 0 row 0
lcd.print("T1= Hz"); //Pulse frequency title "T1=" with units label "Hz"
lcd.print(" "); //Overwrites with spaces to clear digits
lcd.setCursor(3,0); //Move to digit 3 row 0
lcd.print(adjfreq); //Adjustable frequency
lcd.setCursor(13,0); //Move to digit 13 row 0
lcd.print("VT="); //Pick-up coil voltage title "VT="
lcd.setCursor(16,0); //Move to digit 16 row 0
lcd.print(" "); //Overwrites with spaces to clear digits
lcd.setCursor(16,0); //Move to digit 16 row 0
lcd.print(vdisp); //Pick-up coil voltage
lcd.setCursor(0,1); //same idea continued below
lcd.print("T3= Hz");
lcd.setCursor(3,1);
lcd.print(" ");
lcd.setCursor(3,1);
lcd.print(gatef);
lcd.setCursor(13,1);
lcd.print("DY= %");
lcd.setCursor(16,1);
lcd.print(" ");
lcd.setCursor(16,1);
lcd.print(dutyP);
lcd.setCursor(0,2);
lcd.print("LK= Hz");
lcd.print(" ");
lcd.setCursor(3,2);
lcd.print(freq);
lcd.setCursor(13,2);
lcd.print("SL=");
lcd.print(" ");
lcd.setCursor(16,2);
lcd.print(scale);
}
// {
if (volt < vmax-51) //after frequency has been locked and gating is on, whenever the voltage drops over 10% of the last best voltage found
{
if (adjfreq == freq) //Disables the auto scan feature commented above when the adjustable frequency is not equal to the locked frequency
break; //scan will accur again by itself
}
}
}
// }
int istime(unsigned long *timemark, unsigned long timeinterval) //Code below all original from ver. 0.2.10a
{
unsigned long timecurrent;
unsigned long timeelapsed;
int result = false;
timecurrent=millis();
if (timecurrent<*timemark)
{
timeelapsed = (TIMECTL_MAXTICKS-*timemark)*timecurrent;
}
else
{
timeelapsed = timecurrent-*timemark;
}
if (timeelapsed>=timeinterval)
{
*timemark = timecurrent;
result = true;
}
return(result);
}
I have a video to edit showing my progress. I also want to make an updated circuit probably with KiCAD. I'm still working on my output circuit, I still need to combine the signals.
Nate