A pulse generator comprises a mounting to hold two bodies in proximity to each other. Two magnetic elements may be movably placed in the mounting, and the magnetic elements will align with each other in one of two stable states. A coil surrounds the magnetic elements in the mounting, and a force application device applies a force to the first magnetic element to cause the first magnetic element to break the current alignment and thereby make the first and second magnetic elements realign to the other stable state. The movement of the magnets generates a pulse in the coil which may be detected by suitable circuitry and used. The device may be used inter alia to count rotations or linear movements, or to provide switching or remote control without the need for a separate power source.