How to detect the Accelerometer is moving
Calculate the distance of the accelerometer vectors.

\$L = \sqrt{x^2+y^2+z^2}\$

You will have roughly one g active at all times due to gravity. So L should be about 1 when the bike is not moving, and something oscillating near 1 when you're moving.

So what you are really interested in is the vibrations caused by the moving bike, you are not interested in the long frequency gravity noise. This means that a high pass filter will give a small value, near 0. 

The simplest high pass filter would be something like this:

L_HP = L-L_t1;
L = L_t1;



L will be according to the equation above
L_t1 will be the previous value of L
L_HP will contain information about the vibrations without any offset


And then all you need is an if statement to decide what noise that stems from riding a bike or from all other unwanted noise.

if(L_HP&gt;0.1){
  //We've detected that the bike is moving
}


But as the vibrations go back and forth, the if statement will go true and false for small moments when we actually drive it, so you will need some timer that gets activated every time we detect that the bike is moving. So a timer for like 1 second should be enough. If you can, use actual timers that comes with the microcontrollers, I will write pseudo code so you get the gist of it.

So all in all, this is the idea of how it can be done.

/*initiation*/{
  float x = 0;
  float y = 0;
  float z = 0;
  float L_HP = 0;
  float L = 0;
  float L_t1 = 0;
  int timer=0;
}

/*major loop of the microcontroller*/{

  L = sqrt(x*x+y*y+z*z);
  L_HP = L-L_t1;
  L = L_t1;

  if(L_HP&gt;0.1){//0.1 means g force of 0.1, you will have to
    //change this threshold to something that you prefer. 
    timer = 10000;//Or some value that equals to 1 second
  }

  if(timer==0){
    //We're not moving any more
  }else{
    //We're moving
    timer -= 1;
  }
}


If calculating the L variable takes too much time, then just use L = abs(x) + abs(y) + abs(z), it won't be as accurate, but it will make the code run much faster.



It's hard to give specific help when you haven't shared the code, the microcontroller, the programming language, the problems you've actually encountered. But this general information should suffice, if it doesn't, then udpate your question and hope that someone else will come along. 

Good luck.