Matt Hawkins wanted to detect a magnet on his 3D printer. To do this, he has used a hall-effect sensor module and some simple Python script on the Raspberry Pi. If you want to experiment with this nice little, cheap sensor, take a look at his blog here.