Menu

detect when not hitting the Board

Andreas
2017-02-03
2017-02-03
  • Andreas

    Andreas - 2017-02-03

    I think we can use a sound sensor to detect a wrong hit.
    I will test some stuff @ the Weekend

     
  • Andreas

    Andreas - 2017-02-03

    We could use in the Arduino config a Digital 19 PIN and a http://www.ebay.de/itm/Sound-detection-sensor-module-sound-sensor-Intelligent-vehicle-Arduino-/172333346923 it is adjustable, so if a sound detectet (loud) the sensor can make PIN 19 high, or another from the matrix. and hit the button for next dart. It "SOUNDS" easy :)

     
  • poilou

    poilou - 2017-02-03

    Great idea @Andras. What about the false positive case ?

    Diego will ask you for a sensor to detect the dart in an old fashioned dart board ;)

     
  • Andreas

    Andreas - 2017-02-03

    for false fixing we can use a key from the keyboard?

     
  • poilou

    poilou - 2017-02-03

    Yep maybe "backupturn" button could do the trick :)

     
  • Andreas

    Andreas - 2017-02-03

    good idea!

     
  • poilou

    poilou - 2017-02-03

    Note that this button already exists, and the corresponding key as well, it's "b"

     
  • Andreas

    Andreas - 2017-02-03

    i will use a FC-04
    sample code:

    // FC-04 Sound Sensor
    
    const int SenOut = A4;
    
    const int LED1 = 2;
    
    const int LED2 = 4;
    
    int sensorValue = 0;
    
    void setup() 
    {
    
    pinMode(LED1, OUTPUT);
    
    pinMode(LED2, OUTPUT);
    
    pinMode(SenOut, INPUT);
    
    Serial.begin(9600);
    
    void loop() 
    {
    
    sensorValue = analogRead(SenOut);
    
    if (sensorValue > 850)
    
    {
    
    digitalWrite(LED1, HIGH);
    
    digitalWrite(LED2, LOW);
    
    }
    
    else if (sensorValue < 950)
    
    {
    
    digitalWrite(LED2, HIGH);
    
    digitalWrite(LED1, LOW);
    
    delay(50);
    
    }
    
    // Debugging below (un-comment to use)
    
    // Serial.println(sensorValue);
    
    // Serial.println();
    
    // delay(500);
    
    }
    
     

    Last edit: Andreas 2017-02-03
  • Andreas

    Andreas - 2017-02-04

    Ah i see, when i hit a real number, the sensor detects a sound.
    i think that need to be solved by the programmer.
    If hit number > 0 = no fail and count+

     
    • poilou

      poilou - 2017-02-04

      Yep, I can add a new input and consider it :

      exemple : input_sensor = 1 and input_board = 0 then "Failed hit"

      BUT

      1. I have to consider the case of a disabled sensor input
      2. what about the case of someone hitting the floor with his feet or
        slam the door ;) ?
      3. Or it should be an option I'd say. What about your tests ?
       
  • Andreas

    Andreas - 2017-02-04

    the sensor is adjustable, and we can correct a failure with a button "backupturn"
    It is a question of loudness :)
    I have not tested much.
    I have here a raspberry pi 3 for a camera project
    on the floor is a dissambled dart board, i have a bit much work currently :)
    We see us tomorrow in a match?

     
  • diego

    diego - 2017-02-04

    hey andreas!
    i worked on that 2 years ago when I wanted to create a dartboard with 82 piezo sensors!!!
    http://www.ebay.com/itm/20PCS-12mm-Piezo-Elements-Sounder-Sensor-Trigger-Drum-Disc-wire-copper-/381374564334
    here is the arduino soft you can use with the sensor: ("vert" : is when the power of the dart is not enough and "rouge" is when the power of the dart is good (it is like a treshold : 100 in this case)

    It worked well when i launched 1 dart on 1 part of board for tests so I decided to build the whole board! hard and long job ...but when everything was done the sensors did not detect the darts....

    const int ledPin = 13; // led connected to digital pin 13
    const int knockSensor0 = A0; // the piezo is connected to analog pin 0
    const int knockSensor1 = A1;
    const int threshold = 100; // threshold value to decide when the detected sound is a knock or not

    // these variables will change:
    int sensorReading = 0; // variable to store the value read from the sensor pin
    int ledState = LOW; // variable used to store the last LED status, to toggle the light

    void setup() {
    pinMode(ledPin, OUTPUT); // declare the ledPin as as OUTPUT
    Serial.begin(9600); // use the serial port
    }

    void loop() {
    // read the sensor and store it in the variable sensorReading:
    sensorReading = analogRead(knockSensor0);

    // if the sensor reading is greater than the threshold:
    if (sensorReading >= threshold) {
    // toggle the status of the ledPin:
    ledState = !ledState;
    // update the LED pin itself:
    digitalWrite(ledPin, ledState);
    // send the string "vert!" back to the computer, followed by newline
    Serial.println("vert");
    }
    delay(100); // delay to avoid overloading the serial port buffer
    sensorReading = analogRead(knockSensor1);

    // if the sensor reading is greater than the threshold:
    if (sensorReading >= threshold) {
    // toggle the status of the ledPin:
    ledState = !ledState;
    // update the LED pin itself:
    digitalWrite(ledPin, ledState);
    // send the string "vert!" back to the computer, followed by newline
    Serial.println("rouge");
    }
    delay(100); //
    }

     

    Last edit: diego 2017-02-04

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.