

The HG2 is a Hall sensor that switches on when it passes the north pole of a magnet and remains switched on until a second magnet is passed with the south pole upwards. Then the sensor switches off again. The magnets must therefore have a different polarity.
Example: First magnet: north pole above, second magnet: south pole above.
With the HG2 sensor, for example, in a car without a DC-Car decoder, the Siren chip can be switched on and off by passing the magnets.