Trampoline Bounce Counter

My university trampoline club (i'm the captain) is running a 12 hour charity bounce and I thought it would be a nice touch to count the total number of bounces done during the 12 hours across all 4 trampolines. Now I am no where near mean enough to get one of my committee to count each trampolines bounces and I love any excuse to play with my Arduino's (even moved to dual boot with linux to get round the silly FTDI gate) so i thought i'd give it a go at creating a bounce counting system.

Anyway my thought was to have some form of motion detection to see when the bed is depressed. I was wondering what would be best for this as it will have to detect a trampoline bed which has quite allot of holes (google eurotramp 4x4 if curious). My other thought was something that could tell when a spring had been stretched?

How about having an infrared emitter on one corner and a photo-transistor receiver at the other corner. With no one on the trampoline, the signal is HIGH. When a person is standing on the trampoline, the signal is broken (LOW). When they jump the signal goes HIGH, then LOW. The higher they jump, the HIGH duration increases and the LOW duration decreases.

So in summary, its possible to both count jumps and to determine how high they jumped based on the HIGH/LOW timing ratio. Also possible to set a timing ratio that determines if its an official jump to count (above a certain height) or just preliminary bouncing.

another easy way would be to place a distance sensor as mentioned, below the trampoline looking up at the centre and use the decrease in distance to count not only the bounces but whether its a "proper bounce", you may need to attach something like hard fabric to make the surface more likely to reflect sound waves etc for different sensors.

Put an accelerometer on one of the springs, this will be able to cover the entire trampoline.

Get a base line reading from the Accel and if the readings change dramatically then you can consider someone to be bouncing on it.

Simple.

Sorry it has taken so long for me to respond! (I'm in the middle of exams at the moment and prior to that I was skiing).

First up Dlloyd - IR and photo-transistor is a great idea, and could work very well, however I am initially trying to achieve this with minimum wiring and hopefully from a single arduino with 4 sensors attached and located in the centre of 4 trampolines set up in a 2x2 formation. If other methods fail I will certainly try this though!

OllyOlly - I have actually considered this! Again it will require more wire length to monitor all 4 trampolines or multiple arduinos. I was initially looking at using some very cheap IR obstacle detection sensors so their range was limited to about 30cm and wouldn't have been appropriate. I have however ordered some cheap ultrasonic modules from amazon and i'm hoping the Bed is suitable bounce that signal off of!

HazardsMinds - I hadn't even considered this and this could be an ideal solution in terms of low wiring length, I have a cheap 3 axis accelerometer which i might give it a go with on a single trampoline and see if I can get working results!

I will keep everyone posted - Exams finish Friday so my creativity will get a chance to be used!

Speaking as an old paramedic, just take the number of broken limbs and multiply by 6.

But that formula applies to kids, since you guys are more skilled, your bounces per injury constant may need to be a bit higher.

Just a thought ... could easily be wireless by using:
Battery holder for 2 NIMH 2500mAH AA batteries.
IRLED (940nm) in series with 100Ω resistor, connected to battery (2.4V) for 8mA current draw, will last 312.5 hrs before recharging required.
Phototransistor (940nm) , pullup resistor and Arduino circuit at other end.

Interesting idea to use IR to transmit the data! If i'm honest it isn't something I have played with at all yet. I have got some cheap nrf24l01 breakouts which I plan on using :slight_smile:

Now that my exams have finished I have finally got round to writing up a quick test sketch to see if I can get it to work with the HC-SR04 ping sensor! (I would use a cheap arduino nano clone, a HC-SR04, nrf24l01 and a battery packaged into a small 3d printed case for each module - these would transmit to a local node connected to usb on my computer and a processing sketch to give me a GUI to display bounces to the people there on the day)

I am going to test this tonight so I will give you feedback on the success (or not) shortly!!!

#include <NewPing.h>

#define TRIGGER_PIN  4  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     3  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 400 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

// bounce counter initiation variables
unsigned int trampolineHeight = 0;
unsigned int trampolineTimeout = 3000; // maximum bounce time
unsigned int trampolineDebounce = 100;
boolean trampolineState = false;

// bounce counter global variables
unsigned int bounces = 0;
unsigned int height = 0;
unsigned int previousTime = 0;
unsigned int currentTime = 0;


void setup() {
  Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
  Serial.println(F("=== Initiating bounce counter ===\n"));
  
  // Determine the fixed trampoline height
  Serial.println(F("> Calculate trampoline fixed height"));
  Serial.println(F("Place sensor on the floor under the central cross"));
  Serial.println(F("when ready send any character..."));
  while(!Serial.available()){}
  Serial.println(F("Measuring fixed trampoline height"));
  trampolineHeight = (getDistance()+getDistance()+getDistance())/3;
  
  // determine if the height found is suitable
  if (trampolineHeight != 0){
    Serial.print(F("Fixed trampoline height: "));Serial.print(trampolineHeight);Serial.println(F("cm"));
  }
  else{
    Serial.println(F("Error finding trampoline height..."));
  }
  
}

void loop() {
  height = getDistance();
  if (height < trampolineHeight -10){
    if (trampolineState == false){
      currentTime = millis();
      if (currentTime >= previousTime + trampolineDebounce){
        trampolineState = true;
        bounces++;
        previousTime = millis();
        Serial.println(bounces);
      }
    }
  }
  else{
    trampolineState = false;
  }
}

unsigned int getDistance(){
  unsigned int uS = sonar.ping(); // Send ping, get ping time in microseconds (uS).
  unsigned int cm = uS / US_ROUNDTRIP_CM; // convert to
  return cm;
}

:smiley: it worked - I will need to play with the settings and code to get more reliable bounce counting but the sensor was able to detect the distance accurately enough to be very good at detecting larger bounces. I'm hoping with some more complex code I can better tell the difference between small bounces!