Very good job. Congratulations on your project.
Announcement
Collapse
No announcement yet.
Arduino based VDI!
Collapse
X
-
Arduino VDI Experiments - Details with 3 sample programs!!
Attached are complete details for the Arduino experimenter. I have tested these programs with four different coils BM 600, Home built 8" CC and two different homebuilt DDs, they all work!
Enjoy!!
DonAttached Files
Comment
-
Originally posted by dfbowers View PostAttached are complete details for the Arduino experimenter. I have tested these programs with four different coils BM 600, Home built 8" CC and two different homebuilt DDs, they all work!
Enjoy!!
Don
In the PDF you mention connecting the Arduino GND to the IDX ground - I think this is fine.
But when I look at the Drawing showing the connection labels in red - the Ground label isnt on the idx Ground.
IDX supply and Ground are a bit weird, Battery 0v rail is the IDX -4volt rail.
You mention that in your experiments it worked better with a separate battery rather than using IDX supply - this odd supply system may be associated?
Steve
Comment
-
Hi,Steve.
Ha! thanks for catching that.
Just taking a look at my setup, the IDX has a trace that completely surrounds the PCB, and it is the common ground derived from U6 pin7. This is what I was using for a ground, NOT -v or the negative battery terminal. So, you can connect the Arduino ground to one of may points, as long as it's connected to the outer trace of the PCB.
Sorry for the error.
Don
Comment
-
Updated - Arduino VDI Experiments
Updated document.. Just to hide the misleading label.
Thanks for catching that Steve.
DonAttached Files
Comment
-
Congrats for your brilliant work Don!
I've a question: You told that TGSL could support your VDI like the IDX do...but it is more "noisy" in some manner. Did you suggest to me to try it in my TGSL EDU or it is not a good idea?
Is correct to connect Y and X at pin 1 and 7 of U103 in TGSL scheme?
Sorry me if those questions are already replied in the forum... thanks if someone can point me in a previous thread of the argument.
Comment
-
I would like to spend more time with the VDI and adapt it to the TGS. I think it has potential. I never took it much past the experimentation phase though because of the power consumption.. maybe try an LDC display with no backlight or something.
Another winter project..
Comment
-
I have a 1.3 Ah battery in my TGS. so no problem with current drain...
Turn backlight off surely will do the trick...under sunlight or cludy i think that only lcd text is enough to be seen clearly.
What kind of difference there is from idx to tgs thst have to be adapted in arduino vdi Don?
Comment
-
I seem to remember another thread where someone adapted the IDX VDI that Silverdog sells to the TGS.
I played around a bit with the Arduino on the TGSL project. It basically worked but maybe needs a little filtering.
Other option is the Arduino Micro. It works too and is much smaller. Maybe we need to do a shield project?
Comment
-
operates. and modified code for lcd, and goes perfect,thanks
dfbowers
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h> // NewLiquidCrystal libreria
/*-----( Declaramos las constantes )-----*/
#define I2C_ADDR 0x20 // Direccion I2C para PCF8574A que es el que lleva nuestra placa diseñada por MJKDZ
//definimos las constantes para esta placa
#define LED_OFF 0
#define LED_ON 1
//mjkdz i2c LCD board
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(I2C_ADDR, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE);
int backLight = 13; // pin 13 will control the backlight
// Sensors
int sensorPinx = A0; // Intialize analog pin A0 and name it "sensorPinx" for the all metal channel
int sensorPinr = A1; // Intialize analog pin A1 and name it "sensorPinr" for the all disc channel
//Variables
float sensorValuex = 0; // assign a floating point value of "0" to a variable called "sensorValuex"
float sensorValuer = 0; // assign a floating point value of "0" to a variable called "sensorValuer"
float slope; // assign a floating point value of "0" to a variable called "slope"
int n = 0; // assign an integer value of "0" to a variable called "n"
int cursorClmn = 0; // assign an integer value of "0" to a variable called "cursorClmn"
int numSamples = 0; // assign an integer value of "0" to a variable called "numsamples"
float slopeTotals; // assign an integer value of "0" to a variabel called "slopeTotals"
float slopeAve = 0; // assign an integer value of "0" to a variable called "slopeAve"
int VDI = 0; // assign an integer value of "0" to a variable called "VDI"
// program setup follows
void setup()
{
pinMode(backLight, OUTPUT);
digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
lcd.begin(16,2); // columns, rows. use 16,2 for a 16x2 LCD, etc.
lcd.clear(); // start with a blank screen
lcd.setCursor(0,0); // set cursor to column 0, row 0 (the first row)
lcd.print( " VDI CHISPA "); // print whatever you want
lcd.setCursor(0,1); // set cursor to column 0, row 1
lcd.print("IDX PRO + VDI"); // print whatever you want
delay (2000); // wait 1 second
lcd.clear(); // Clear the LCD
}
// The main loop follows
void loop()
{
first: //This is a label called "first" so a goto statement can find the beginning of the loop when called
sensorValuex = analogRead (sensorPinx); //Read the analog pin A0 and store it's value as sensorValuex (it will be between 0 and 1023)
sensorValuer = analogRead (sensorPinr); //Read the analog pin A1 and store it's value as sensorValuer (it will be between 0 and 1023)
//Change SensorValues below to adjust VDI sensitivity
if (sensorValuex > 5) { //If this sensorvalue becomes > 5 it executes the next line. If not, it drops to the "else" statement and goes to the beginning again ("first")
if (sensorValuer > 5) { //If this sensorvalue becomes > 5 it executes the next line. If not, it drops to the "else" statement and goes to the beginning again ("first")
for (int n = 0 ; n < 85 ; n ++) //Starts a counter to read the sensors again in a loop 85 times
reread: //A label called reread will check sensors again if a floating point calulation is bad {0 value)
{
sensorValuex = analogRead(sensorPinx); //Read the analog pin A0 and store it's value as sensorValuex (it will be between 0 and 1023)
sensorValuer = analogRead (sensorPinr); //Read the analog pin A1 and store it's value as sensorValuer (it will be between 0 and 1023)
slope=sensorValuer / sensorValuex; // calculate X/R ratio and call it "slope"
if (slope ==0) {
goto reread;
}
slopeTotals = slopeTotals + slope;
}
}
}
else {
goto first; // runs a loop until the sensors become low again
}
slopeAve = slopeTotals/85; // take all the slope values and average them.
VDI = ((10 - slopeAve) * 10);
// you can manipulate the range of how your VDI numbers are calulated by changing the line below
cursorClmn = (10 - slopeAve); // slopeAve will typically be between .1 and 9. It just converts it to an integer number between 1 and 10.. used to position the "*" character
tone (8 , (cursorClmn * 200), 100); // produces a tone of 200 Hz X the mumber above for 100 mS
lcd.clear(); //clear LCD
if (VDI > 98 ) {
lcd.clear();
goto finish;
}
lcd.setCursor(0,0); //Set cursor on line 0, column 0
lcd.print("VDI = "); // print "VDI ="
lcd.print (VDI) ; // prints the calculated number following "VDI ="
lcd.setCursor(9,0);
//if (VDI = 100 ); {
// lcd.clear();
// goto finish;
//}
if ( VDI > 91 ) {
lcd.print ("BRONCE");
goto DonePrinting;
}
if ( VDI > 90 ) {
lcd.print ("BRONCE");
goto DonePrinting;
}
if ( VDI > 85 ) {
lcd.print("MONEDA");
goto DonePrinting;
}
if ( VDI > 85 ) {
lcd.print("COBRE");
goto DonePrinting;
}
if ( VDI > 82 ) {
lcd.print("ORO");
goto DonePrinting;
}
if ( VDI > 80 ) {
lcd.print ("MONEDA");
goto DonePrinting;
}
if ( VDI > 71) {
lcd.print ("HIERRO");
goto DonePrinting;
}
if (VDI > 70) {
lcd.print ("BASURA");
goto DonePrinting;
}
if (VDI > 65) {
lcd.print ("BASURA");
goto DonePrinting;
}
if (VDI > 61) {
lcd.print ("BASURA");
goto DonePrinting;
}
if (VDI > 47) {
goto DonePrinting;
}
if (VDI > 30) {
goto DonePrinting;
}
if (VDI > 0) {
lcd.setCursor (10,0);
lcd.print ("Foil");
goto DonePrinting;
}
DonePrinting:
lcd.setCursor(cursorClmn,1); // Positions the cursor on a particular column on row 1
lcd.print ("*"); // prints the "*" character in that partular column
finish:
delay (100); // display the VDI numbers for 100 mS before going to the beginning of the code again
numSamples = 0; // reset all numbers back to "0"
slopeTotals = 0;
slopeAve = 0;
slope = 0;
}
Comment
-
end and my taste runs luxury
if ( VDI > 91 ) {
lcd.print ("BUENO");
goto DonePrinting;
}
if ( VDI > 90 ) {
lcd.print ("BUENO");
goto DonePrinting;
}
if ( VDI > 85 ) {
lcd.print("MONEDA");
goto DonePrinting;
}
if ( VDI > 86 ) {
lcd.print("MONEDA");
goto DonePrinting;
}
if ( VDI > 83 ) {
goto DonePrinting;
}
if ( VDI > 82 ) {
lcd.print("ORO");
goto DonePrinting;
}
if ( VDI > 81 ) {
lcd.print ("FOIL");
goto DonePrinting;
}
if ( VDI > 80 ) {
goto DonePrinting;
}
if ( VDI > 71) {
lcd.print ("HIERRO");
goto DonePrinting;
}
if (VDI > 70) {
lcd.print ("BASURA");
goto DonePrinting;
}
if (VDI > 65) {
lcd.print ("BASURA");
goto DonePrinting;
}
if (VDI > 61) {
lcd.print ("BASURA");
goto DonePrinting;
}
if (VDI > 47) {
goto DonePrinting;
}
if (VDI > 39) {
goto DonePrinting;
}
if (VDI > 30) {
goto DonePrinting;
}
if (VDI > 0) {
lcd.setCursor (10,0);
Comment
Comment