Sensing a physical movement with a ferrofluidic device