LM339 Quad Comparator
It is useful to both display and be able to react to analog inputs. A microcontroller such as the ATTiny13 or PFS154 is fine for this, but you could also go a bit "old school" and use a comparator such as the LM339.
The scenario is that a 12V battery is "green" above 9V, fine from 3V-9V and "red" below 3V.
Using the LM339 a "window comparator" can be made according to the following circuit diagram.
The first voltage divider (two resistors) simulates voltage changes for an analog input to be tested, whilst the second one with the three resistors "sets" the cutoffs for the window comparator.
The input to be tested is tied to the inverting input of one comparator and the non-inverting input of another comparator. The cutoffs are fed to the remaining inputs, and then the output will reflect where the testing voltage has landed.
Two weird things about the LM339 which caused me pause during the build. One is the unusual position of VCC/GND compared to a lot of CMOS chips, and the other is the fact that it does not source current from it's "outputs" - but rather sinks current. That was a bit unexpected!
No comments:
Post a Comment