Tuesday 18 July 2017

arduino - Solution for detecting a magnetic field



I have an Arduino based circuit that performs a mechanical job and I'd like the circuit to turn on when it detects a magnetic field. I want to use a magnet as a trigger for the circuit. When a magnet is attached to something like say a stick and put near the circuit board I'd like it to detect the magnetic field and turn on.


I have learnt that an operational amplifier can be used for this purpose but need guidance on how to do it as I am a novice in embedded systems & electronics.



Answer



One way or another, you need some kind of transducer that can make a electrical signal that is a function of magnetic field strength. No, a opamp can't do this. A opamp may be useful in tranforming the raw signal from such a transducer into something the microcontroller can read, but by itself a opamp is not a magnetic sensor.


Two possibilities come to mind:



  1. Reed switch. These are the bare switch parts of a relay, usually enclosed in a small glass envelope. The right magnetic field causes the switch to close. This will be the simplest solution if you have a strong enough magnetic field. This usually means a reasonable permanent magnet can be placed with a half inch or so of the reed switch.

  2. Hall effect sensor. The underlying physics of these sensors creates a small electrical signal proportional to the magnetic field in a particular direction. However, you rarely get bare Hall sensors directly. Usually they are integrated into a single package with something that either makes a reasonable size voltage proportional to magnetic field strength, or provides a digital output, usually with some hysteresis, to indicate presence or abscence of some level of magnetic field. Allegro is a supplier that makes a lot of these things with various options.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...