user18449: If so, please tell me and also tell me if any interfacing of other microcontroller needed?

user18453: If you don't care about measuring the strength of the magnetic field, you can use a magnetic switch (sometimes called a reed switch). A magnetic switch closes when a magnet is put up to it and opens when there is not. The only problem with this is that the magnet has to be within about one inch from the switch. The magnetic switch works just like a normal switch and usually has two contacts. Here is an example.

user18451: I can't comment yet but you probably are looking for a hall effect sensor.
Something like this is a simple version of the sensor. https://www.sparkfun.com/products/9312
You can then do a digitalRead on the DO pin to detect if a magnet is near the sensor. 
You would connect the Vdd to 5v arduino supply and GND to the GND of the board.

18449: <p>If so, please tell me and also tell me if any interfacing of other microcontroller needed?</p>
 18453: <p>If you don't care about measuring the strength of the magnetic field, you can use a magnetic switch (sometimes called a reed switch). A magnetic switch closes when a magnet is put up to it and opens when there is not. The only problem with this is that the magnet has to be within about one inch from the switch. The magnetic switch works just like a normal switch and usually has two contacts. <a href="http://www.mouser.com/ProductDetail/Standex-Electronics/ORD324-1520/?qs=JzJq8kwFq1kL6csKqXqJlw%3D%3D&amp;gclid=CjwKEAiA0ZC2BRDpo_Pym8m-4n4SJAB5Bn4xq9r0brZEKWex5eS-FfwskFgNwpZVISwIe8pVCaHRaBoCKxnw_wcB" rel="nofollow">Here</a> is an example.</p>
 18451: <p>I can't comment yet but you probably are looking for a hall effect sensor.</p>

<p>Something like this is a simple version of the sensor. <a href="https://www.sparkfun.com/products/9312" rel="nofollow">https://www.sparkfun.com/products/9312</a></p>

<p>You can then do a digitalRead on the DO pin to detect if a magnet is near the sensor. </p>

<p>You would connect the Vdd to 5v arduino supply and GND to the GND of the board.</p>
