what is the difference between tilt sensor and accelerometer ?

what is the difference between tilt sensor and accelerometer ?

A tilt sensor doesn't measure motion, it's just an on-off switch whose contacts close when it's not level. It doesn't open again when it's not in the process of tilting, it only tells you that it has tilted.

tilt sensors don't give acceleration values. Tilt sensors are often contacts NO or NC like these :

the contact chatters when it is tilted, that's all

accelerometers measure the acceleration on one or more axes, and send the values via I2C or other serial communication.
some accelerometers have also a interrupt ouput, which is active when movement is detected, then these can be used as tilt sensors as well

An accelerometer can be used as a tilt sensor. However, not all tilt sensors are accelerometers. For example, a mercury switch can be used as a tilt sensor, but it can't give you a readout of acceleration.

DC,

But it can be used to tell you if you are accellerating..... or, accellerated... in usless theory...

While I agree a mercury switch is a poor accelerometer, we used one for just that back in high school back in 1973. We wanted to see which of our bikes had the highest peak acceleration but were fresh out of Arduinos and solid state accelerometer chips. We used a mercury switch mounted on a hinged stick and a light bulb. The more vertical the stick, the harder it was to make the mercury switch turn on the light bulb. we just kept raising the stick by a small amount until the bike could not longer turn it on. The bike with the most vertical stick setting was the winner. Crude, but effective.

Those were simpler times.

From the x,y,z you can find out if the accelerometer is tilted.

A traditional tilt relies on gravity and free flowing dangerous mercury to indicate a tilt but nothing more..

There are other kinds of tilt sensors besides accelerometers and mercury switches.

(note that a mercury switch (or a ball switch) is a sort of "digital" tilt sensor. It only tells you "tilted enough" or "not tilted enough" to trip the switch. An accelerometer provides some sort of analog output. (a lot of modern accelerometers ALSO provide digital outputs for important sub-functions like "falling" and basic orientation.)