Saturday, May 23, 2020

0000 0000 0011 0000

CD4093 - the magnetic alarm thingy Part Two

On a quest to find some use for the CD4093 Quad Schmitt Trigger NAND gate IC (simply because I love inserting the phrase "Schmitt Trigger" into any conversation), I found in an earlier blog that the CD4093 chips that I had in the bucket did indeed work as advertised. Now it was time to employ it in a circuit that I had found a few months ago online.


So many Schmitt Triggers

One immediate snag that I did not anticipate was the small matter of not having any prescribed MH183 Hall Effect sensors in the buckets. I did scramble around and dig out the following sensors:

  1. SS49E - providing an analog output related to the strength AND direction of the magnetic field - lovely!
  1. US1881 - which outputs a digital signal, and
  1. A3144 - which also outputs a digital signal.
Three sensors ready for testing
The question is do these work? Also, which of them is closest to the MH183? Well the MH183 is billed as a digital output sensor, and from the datasheet we read "The output transistor will be switched on in the presence of a sufficiently strong South pole magnetic field facing the marked side of the package. Similarly, the output will be switched off in the presence of a weaker South field and remain off with “0” field."

After matching this description with the sensors in the bucket and doing a little experimentation (see video below, and note that a 10kΩ resistor needs to be added across 5V and output for the US1881 and the A3144)), I decided that the A3144 would be a suitable replacement. See below for their block diagrams from their respective datasheets - very similar!




If the sensor provides such a clean digital signal, then I started to wonder why should I bother to have any of the extra circuitry? Well it turns out that the 10kΩ resistor means the current allowed out is minimal, plus you can see from the video when I tried this (with a 1kΩ resistor, *yikes* wasted current) that there was no hysteresis, which is the whole point of using a Schmitt Trigger IC in the first place.

So basically we need to invert the signal and clean it up a bit so that the LED/ALARM is OFF if the door/window is closed, then tripped ON if the magnetic connection is broken. The circuit at 6.0V consumes 5.2mA doing nothing, and around 10.3mA once the alarm has been tripped - so that is pretty awful if you want to run this off a battery.


The CD4013 circuit hooked up and ready for magnetic action
There are more efficient ways - and in fact I think I'll build something with a sleeping μC, although there may be no getting around the fact that a Hall Effect Sensor is using current just doing nothing. There are low quiescent current Hall Effect sensors, but the price tag is pitched above my interest.

When I did eventually reach into the buckets to find a commercial "Hall Effect Sensor Module" it turned out that it also used the A3144 sensor at it's heart, and then an LM393 comparator and some other parts to provide the digital output. Crazily, the module uses about 6.5mA when not active, but with the yellow LED I plugged in to indicate loss of magnetic field it used 5.3mA when active - now that's OpAmp magic for you.

The commercial version with a comparator




No comments:

Post a Comment