Electronic – Tiny Magnet Sensor Switch

hall-effectmagnetreedsensor

I know just enough about electronics to do the occasional Arduino or Raspberry Pi project, as long as I don't have to understand too much of what's going on. I am a software guy who dabbles in hardware a tiny bit. So, I'm not even sure I can form a good question, which is why I haven't been able to Google an answer to this question.

I have made a small wearable device (about 30mm x 30mm x 10mm) that has one simple job. There is a magnet clipped onto the device. When the magnet is removed, it tells my phone (via BLE). Think of a sort of personal alarm device.

My first prototype uses a NC reed switch and works perfectly … except that the reed switch is quite susceptible to false activation when jostled around too much. The device should only activate when the magnet is removed. As an improvement, I figured the solution was probably to use a hall effect IC. I've also read a little bit about MEMS. Cost is not an issue, within reason (i.e. sub-$20), but size and durability are absolutely important.

My questions:

  1. First, is a hall effect IC an appropriate solution, or is there something else that would work better?
  2. My assumption is that I must use a NC switch that is open when the magnet is nearby. This makes a digital IO pin go HIGH only when the magnet is removed. My reasoning is that if the switch is NO, then it will be closed when the magnet is nearby, making the IO pin HIGH most of the time. I believed that this would be an unnecessary drain on the battery. But, I recently read something to suggest that digital IO doesn't work like this. So, my question is … does it use more power to maintain HIGH state than LOW?
  3. Am I thinking about this all wrong? Is there a simple way to accomplish the same thing in a very tiny package? I am using a 3V logic Arduino derivative with plenty of pins. The device currently uses just about 50uA, on average, and I'd like to keep it that way.

Best Answer

Your idea to use a Hall Effect device would seem to be ideal.

There are plenty of Hall Effect sensors, here is one at about $0.40 that would be ideal IMO. It operates at 2.3 - 5V and has an open drain output and so could be used with a single digital input with just a high value pullup resistor. You could probably even just use the inbuilt pullup supplied on most MCUs (in the 20-50k Ohm range. You could search for others on Digikey.

It has ultra low power consumption, but you could drive it using a digital output pin, so it's only turned on when you want. I assume to get very low current consumption of your MCU you are spending most of your time in sleep mode. Before you go to sleep simply turn the port supplying power to an input (lowest power consumption) with no pullup resistor.