Published © GPL3+

Smart jump rope counter

The purpose of this project is to show you how we can use Arduino 101 with grove sound sensor.

IntermediateFull instructions provided3 hours742
Smart jump rope counter

Things used in this project

Story

Read more

Code

Processing sketch

Processing
This app help you to know the number of jump
import processing.serial.*;

Serial myPort;                                            
String val="0";                                               
PFont Monospaced;

void setup(){  
  size(500,200);
    
  Monospaced = createFont("Monospaced", 2);
  textFont(Monospaced);
  textAlign(CENTER);
  textSize(40);
  
  myPort = new Serial(this, "COM4", 115200);  
}

void draw(){
   
  if ( myPort.available() > 0) {                            
    val = myPort.readStringUntil('\n');         
  }
  writeText("Jump Reading:"+val);  
}

void writeText(String textToWrite){
  background(#d3d3d3);
  fill(0);
  text(textToWrite, width/2, 100);   
}

Arduino 101 sketch

Arduino
int jump=0;
int JumpRate=0;
int JumpRateMeasurement=0;

void setup(){
    Serial.begin(115200);
}

void loop(){
    JumpSignal();   
}

void JumpSignal(){
    JumpRateMeasurement = analogRead(A0);
    JumpRate = map(JumpRateMeasurement, 0, 1023, 0, 100);
       
    //uncomment this this for serial plotter
    //Serial.println(JumpRate);

    if(JumpRate>=80){
      jump++;
      Serial.println(jump);      
    }

    delay(1);
}

Credits

Comments