Announcement

Collapse
No announcement yet.

Arduino metal detector?

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

  • #76
    Here's a demo - the signal output from the op-amp:

    Since the op amp gain is small for stable operation of the comparator circuit, then for clarity using large targets placed in the coil - 1 (without target), 2 (beer can), 3 (dumbbell).
    Taking the curve of exponential function, defined for fun time constant for dumbbell - 84 microseconds.
    P.S. I went back to the old version of the driver:

    This circuit is the most stable.
    Attached Files

    Comment


    • #77
      Attached is my old schematic for arduino shield
      Attached Files

      Comment


      • #78
        Originally posted by captainart3000 View Post
        Attached is my old schematic for arduino shield
        This long board is the same circuit?
        Thanks.

        https://www.youtube.com/watch?v=Sg1dT_T4AXY


        ...

        Comment


        • #79
          Hello captainart3000,

          can you provide sourve file or hexcode?

          which Controller is it atmel or pic?

          Comment


          • #80
            Originally posted by bernte_one View Post
            Hello captainart3000,

            can you provide sourve file or hexcode?

            which Controller is it atmel or pic?
            you can contact him at [email protected]

            Comment


            • #81
              Hi Foxylab

              I am trying to find out the value of L2 the choke in the 12 v battery supply of your PI circuit, could you please tell what is its value ? thanks.
              http://acdc.foxylab.com/sites/defaul...s/foxyPIv2.png

              Comment


              • #82
                I tried this project, but the way the LEDs light up in response to a target is too hard to follow.
                http://alex---1967.narod.ru/PI_metal...arduino_u.html

                Comment


                • #83
                  What does it do? Random ? Erratic? To Fast?

                  Comment


                  • #84
                    All of the above (Random ? Erratic? To Fast?)

                    Comment


                    • #85
                      LOL The code looks like it's trying to light all LED's at the same time to me. Not by levels.

                      Comment


                      • #86
                        Try this. Should give you progressing LED.


                        // PI metal detector for arduino version_16_min (C)alex---1967 2015
                        byte ss = 0;
                        byte c = 0;
                        byte i = 0;
                        int s0 = 0;
                        int s1 = 0;


                        void setup()
                        {
                        DDRB = 0xFF; // port B - all out
                        DDRD = 0xFF; // port D - all out

                        for (i = 0; i <16; i++) // калибровка / calibration
                        {
                        s0 = analogRead(A0);
                        s1 = analogRead(A0);
                        c = c + s1;
                        }
                        c = c / 16;
                        c = c - 2;
                        }

                        void loop()
                        {
                        PORTB = B11111111; // переводим пины порта B в 1, открывая т.о. ключ (turn on)
                        delayMicroseconds(200); // wait 200 microseconds
                        PORTB = 0; // закрывааем ключ, прерывая ток в поисковой катушке (turn off - interrupt circut in search coil )

                        s0 = analogRead(A0);
                        s1 = analogRead(A0);

                        ss = s1 - c;
                        ss = ss / 2;

                        PORTD = ss; // посылаем на индикатор (send to LEDs)


                        delay(4);
                        }









                        // PI metal detector for arduino version_18_min (C)alex---1967 2015 **** Modified LED Progression I Hope
                        int ss0 = 0;
                        int ss1 = 0;
                        int ss2 = 0;
                        long c0 = 0;
                        long c1 = 0;
                        long c2 = 0;
                        byte i = 0;
                        int sss0 = 0;
                        int sss1 = 0;
                        int sss2 = 0;
                        int s0 = 0;
                        int s1 = 0;
                        int s2 = 0;


                        void setup()
                        {
                        DDRB = 0xFF; // port B - all out
                        DDRD = 0xFF; // port D - all out

                        for (i = 0; i <255; i++) // калибровка / calibration
                        {
                        PORTB = B11111111; // переводим пины порта B в 1, открывая т.о. ключ (turn on)
                        delayMicroseconds(200); // wait 200 microseconds
                        PORTB = 0; //
                        delayMicroseconds(20);
                        s0 = analogRead(A0);
                        s1 = analogRead(A0);
                        s2 = analogRead(A0);
                        c0 = c0 + s0;
                        c1 = c1 + s1;
                        c2 = c2 + s2;


                        delay(3);
                        }
                        c0 = c0 / 255;
                        c0 = c0 - 5;
                        c1 = c1 / 255;
                        c1 = c1 - 5;
                        c2 = c2 / 255;
                        c2 = c2 - 5;


                        }

                        void loop()
                        {
                        PORTB = B11111111; // переводим пины порта B в 1, открывая т.о. ключ (turn on)
                        delayMicroseconds(200); // wait 200 microseconds
                        PORTB = 0; // закрывааем ключ, прерывая ток в поисковой катушке (turn off - interrupt circut in search coil )
                        delayMicroseconds(20);
                        s0 = analogRead(A0);
                        s1 = analogRead(A0);
                        s2 = analogRead(A0);
                        ss0 = s0 - c0;

                        if (ss0 < 0)
                        {
                        sss0 = 1;
                        }
                        ss0 = ss0 / 16;
                        PORTD = ss0; // посылаем на индикатор (send to LEDs)
                        delay(1);

                        ss1 = s1 - c1;
                        if (ss1 < 0)
                        {
                        sss1 = 1;
                        }
                        ss1 = ss1 / 16;
                        PORTD = ss1; // посылаем на индикатор (send to LEDs)
                        delay(1);


                        ss2 = s2 - c2;
                        if (ss2 < 0)
                        {
                        sss2 = 1;
                        }
                        ss2 = ss2 / 16;
                        PORTD = ss2; // посылаем на индикатор (send to LEDs)
                        delay(1);

                        if ( sss0+sss1+sss2 > 2)
                        {
                        digitalWrite(0,HIGH);
                        delay(2);
                        sss0 = 0;
                        sss1 = 0;
                        sss2 = 0;
                        if ( sss0+sss1+sss2 > 3)
                        {
                        digitalWrite(1,HIGH);
                        digitalWrite(0,HIGH);
                        delay(1);
                        sss0 = 0;
                        sss1 = 0;
                        sss2 = 0;
                        }
                        if ( sss0+sss1+sss2 > 4)
                        {
                        digitalWrite(3,HIGH);
                        digitalWrite(2,HIGH);
                        digitalWrite(1,HIGH);
                        digitalWrite(0,HIGH);
                        delay(1);
                        sss0 = 0;
                        sss1 = 0;
                        sss2 = 0;
                        }
                        if ( sss0+sss1+sss2 > 5)
                        {

                        digitalWrite(4,HIGH);
                        digitalWrite(3,HIGH);
                        digitalWrite(2,HIGH);
                        digitalWrite(1,HIGH);
                        digitalWrite(0,HIGH);
                        delay(1);
                        sss0 = 0;
                        sss1 = 0;
                        sss2 = 0;
                        }
                        if ( sss0+sss1+sss2 > 6)
                        {
                        digitalWrite(5,HIGH);
                        digitalWrite(4,HIGH);
                        digitalWrite(3,HIGH);
                        digitalWrite(2,HIGH);
                        digitalWrite(1,HIGH);
                        digitalWrite(0,HIGH);
                        delay(1);
                        sss0 = 0;
                        sss1 = 0;
                        sss2 = 0;
                        }
                        if ( sss0+sss1+sss2 > 7)
                        {

                        digitalWrite(6,HIGH);
                        digitalWrite(5,HIGH);
                        digitalWrite(4,HIGH);
                        digitalWrite(3,HIGH);
                        digitalWrite(2,HIGH);
                        digitalWrite(1,HIGH);
                        digitalWrite(0,HIGH);
                        delay(1);
                        sss0 = 0;
                        sss1 = 0;
                        sss2 = 0;
                        }if ( sss0+sss1+sss2 >
                        {
                        digitalWrite(7,HIGH);
                        digitalWrite(6,HIGH);
                        digitalWrite(5,HIGH);
                        digitalWrite(4,HIGH);
                        digitalWrite(3,HIGH);
                        digitalWrite(2,HIGH);
                        digitalWrite(1,HIGH);
                        digitalWrite(0,HIGH);
                        delay(1);
                        sss0 = 0;
                        sss1 = 0;
                        sss2 = 0;
                        }
                        }

                        Comment


                        • #87
                          Thanks for the code, but there is a small error when I try and verify the code here is the error message (there is a smiley face in the code would that cause a problem ?)

                          Arduino: 1.6.11 (Windows 7), Board: "Arduino Nano, ATmega328"

                          C:\Felz\sketch_may01a\sketch_may17a\sketch_may17a. ino: In function 'void loop()':

                          sketch_may17a:154: error: expected primary-expression before '{' token

                          {

                          ^

                          sketch_may17a:154: error: expected ')' before '{' token

                          sketch_may17a:168: error: expected primary-expression before '}' token

                          }

                          ^

                          sketch_may17a:168: error: expected '}' at end of input

                          exit status 1
                          expected primary-expression before '{' token

                          Comment


                          • #88
                            Originally posted by 6666 View Post
                            Thanks for the code, but there is a small error when I try and verify the code here is the error message (there is a smiley face in the code would that cause a problem ?)

                            Arduino: 1.6.11 (Windows 7), Board: "Arduino Nano, ATmega328"

                            C:\Felz\sketch_may01a\sketch_may17a\sketch_may17a. ino: In function 'void loop()':

                            sketch_may17a:154: error: expected primary-expression before '{' token

                            {

                            ^

                            sketch_may17a:154: error: expected ')' before '{' token

                            sketch_may17a:168: error: expected primary-expression before '}' token

                            }

                            ^

                            sketch_may17a:168: error: expected '}' at end of input

                            exit status 1
                            expected primary-expression before '{' token
                            You need to replace with "8" followed by ")".
                            The bulletin board interprets this as "glasses".

                            Comment


                            • #89
                              Thanks for the tip about the glasses, I fixed that part of the code but it still says an error somewhere here is the error message

                              Arduino: 1.6.11 (Windows 7), Board: "Arduino Nano, ATmega328"

                              C:\Felz\sketch_may01a\sketch_may17a\sketch_may17a\ sketch_may17a.ino: In function 'void loop()':

                              sketch_may17a:168: error: expected '}' at end of input

                              }

                              ^

                              exit status 1
                              expected '}' at end of input

                              This report would have more information with
                              "Show verbose output during compilation"
                              option enabled in File -> Preferences.

                              Comment


                              • #90
                                Originally posted by 6666 View Post
                                Thanks for the tip about the glasses, I fixed that part of the code but it still says an error somewhere here is the error message

                                Arduino: 1.6.11 (Windows 7), Board: "Arduino Nano, ATmega328"

                                C:\Felz\sketch_may01a\sketch_may17a\sketch_may17a\ sketch_may17a.ino: In function 'void loop()':

                                sketch_may17a:168: error: expected '}' at end of input

                                }

                                ^

                                exit status 1
                                expected '}' at end of input

                                This report would have more information with
                                "Show verbose output during compilation"
                                option enabled in File -> Preferences.
                                Sorry - I cannot help you with that, as I've never used an Arduino.

                                Comment

                                Working...
                                X