Announcement

Collapse
No announcement yet.

Arduino based VDI!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • manny77
    replied
    Thank you. Yes i think that using 1/2 of total voltage in non inverting pin of operational will do the trick. The preamp stadium of vdi for idx is already a good solution for that...try to build it...

    Leave a comment:


  • onuba
    replied
    Originally posted by manny77 View Post
    I just ordered an Arduino Nano and I want to build a vdi for my TGSL.
    I saw that X and R signals are very weak, probably less than 0.5V for weak detection and they are more or less symmetric from 0V, going negative too.

    How to adapt these signals directly in arduino? They have to be amplified with positive offset too?
    If answer is yes, there is a schematic for that? Surely using operational amplifier...?
    v3. idx my x. e. and. also. V4 pin 5 and 3 perfect

    Leave a comment:


  • golfnut
    replied
    some commercial machines have a dc offset of 1/2 of the positive rail - in order that positve and negative going signals may be measured with the adc's

    ~I would image, check with Don, that the vdi here would not measure -ve going signals only positive going. A threshold value is likely, so the vdi only reads above a value.

    Some averging is needed to smooth the readings out ~50 reading ave from memory.

    As with commercial machines, the small targets althugh ring out,wont show a vdi value (e.g. my Deus)

    Leave a comment:


  • manny77
    replied
    I just ordered an Arduino Nano and I want to build a vdi for my TGSL.
    I saw that X and R signals are very weak, probably less than 0.5V for weak detection and they are more or less symmetric from 0V, going negative too.

    How to adapt these signals directly in arduino? They have to be amplified with positive offset too?
    If answer is yes, there is a schematic for that? Surely using operational amplifier...?

    Leave a comment:


  • ice413
    replied
    I have an LCD with pushbuttons on (like this one: http://www.datsi.fi.upm.es/docencia/...ushbuttons.htm ), and i need to change the pinout in the code for that.
    This is how my LCD works
    =======================================
    LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
    int backLight = 10; // pin 10 will control the backlight ( HIGH / LOW )
    =======================================

    Leave a comment:


  • onuba
    replied
    yes. 7v .9v .12v .

    . The software not for all lcd , buy lcd with Mocila 4 pin and I had to modify code


    easier and less Connection

    Leave a comment:


  • manny77
    replied
    I wanna buy arduino to test on my tgsl. Software is the same for micro or uno version? It could be powered directly from battery 12v?

    Leave a comment:


  • onuba
    replied
    Originally posted by manny77 View Post
    Thanks onuba. But, for clarity...which improvement did you made? Did you implemented filtering for tgsl like Don suggested in previous post?

    , is a coil idx pro BLISSTOOL 8.5KHz;
    had problem with lcd in code because it was different and modify code

    Leave a comment:


  • manny77
    replied
    Thanks onuba. But, for clarity...which improvement did you made? Did you implemented filtering for tgsl like Don suggested in previous post?

    Leave a comment:


  • onuba
    replied
    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);

    Leave a comment:


  • onuba
    replied
    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;

    }

    Leave a comment:


  • dfbowers
    replied
    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?

    Leave a comment:


  • manny77
    replied
    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?

    Leave a comment:


  • dfbowers
    replied
    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..

    Leave a comment:


  • manny77
    replied
    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.

    Leave a comment:

Working...
X