I bought today a motion sensor and i make i simple program that prints the state of the sensor at console. My problem is that when it notice a movement the sensor goes HIGH and stays at that state for a couple of time. For example i pass my hand in front of it, the sensor gives HIGH signal and for about a sec it remains high. Is anything wrong with my sensor or thats the way it works ?
Yep afaik that's they way they work: there are components on the board that set that time. Some have an adjustment.
You might find this tutorial useful, even if your PIR isn't this exact one.