Shop OBEX P1 Docs P2 Docs Learn Events
Voltage comparator? — Parallax Forums

Voltage comparator?

lairdtlairdt Posts: 36
edited 2007-10-22 04:42 in Propeller 1
Anybody have a very simple voltage comparator circuit?

I need to know if an input goes below 0.40 volts (3.3v source) and I don't have much board space left.

Thanks

Comments

  • viskrviskr Posts: 34
    edited 2007-10-21 00:26
    If you really need an accurate comparison to 0.4V then an LPV7215 or similar which is available in an SC-70 package, that and 2 resistors and you're there.

    If going below 0.6V is close enough, then any NPN transistor with that level tied to the base thru a 10K resistor and a 10K pullup on the collector as an output (emitter to ground)
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-21 00:29
    Basically, you need a voltage comparator like the LM393. This comes in an 8-pin DIP (and other packages) and will run off 3.3V. You'll need a pullup (like 3.3K) and a voltage reference which could be just a simple voltage divider running off the 3.3V supply. Whenever the input voltage goes above the reference voltage, the comparator will turn on and the output will go to zero. There are lots of other comparators, but this one is cheap and widely available.

    Unfortunately, the voltage is too low for the Propeller to directly detect it.
  • lairdtlairdt Posts: 36
    edited 2007-10-21 01:13
    Thanks·for both replies.· I'll give it a try with the 393's... don't have any right now, but I have some 339's that I can test with until Mouser arrives. [noparse]:)[/noparse]

    Was hoping there was a simpler way to get results other than adding another chip, oh well.
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-21 10:24
    I am impressed that they are assumed to work from 0V on from a single supply voltage.... So 3V3 allows an operating range from 0V to 1V8..
    www.ortodoxism.ro/datasheets/stmicroelectronics/2164.pdf The Texas Instruments data sheet gives also many applications...
  • AribaAriba Posts: 2,685
    edited 2007-10-21 21:39
    How about this circuit:
                    +3.3V
                   │
                    33k
                   │
     Inp ────────┻─────── Prop Pin
         ─┐   18k
           ┴
    
    



    The threshold voltage of a PropPin is 1.42 Volt (measured). If the Voltage at the Input goes under 0.4V the Voltage at the resistor divider goes under 1.42V. You can make one of the resistors adjustable if you need a very exact threshold.

    Andy
  • lairdtlairdt Posts: 36
    edited 2007-10-21 22:09
    Ariba - that's almost what I ended up doing, running a different bias setup.

    Now I'm having a stupid moment getting my 5v relay to energize... it *was* working, but something changed.
  • viskrviskr Posts: 34
    edited 2007-10-21 23:46
    While the resistor divider to the driving pin may work, its a very poor practice. The threshold of any CMOS input is going to vary with temperature and time. In fact spec for inputs are defined as requiring 1.1V as a low input, 2.1V as a high input, anything in between can turn out to be anything.

    If the driver is driving at 0.4 V, then the input to the prop would be at the threshold, which means any power supply noise might kick it into the opposite state. Ie, your input becomes a noise sensor and quite unreliable.
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-22 01:05
    @viskr: Your criticism is basically correct for general CMOS inputs. However we have learned that the Propeller behaves - a little bit - differently. It has a very reliable trigger level, and many of our pet applications rely on this...

    I am eager to hear what issues you have experienced!
  • viskrviskr Posts: 34
    edited 2007-10-22 02:29
    No specific experience, but I think you are working with a small sample size, unless the input is designed as a comparator vs a reference or has hysterisis, you will probably find a part next year that won't work as expected.

    Parallax could probably answer this or the fab house as to what specific characteristics the input has. All the parts from a run will have similar characteristics, but from run to run that threshold will shift.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-10-22 04:42
    viskr,

    If you are making general comparisons between different CMOS chips, then I would say yes, that the input threshold would vary widely. But if you are only looking at one CMOS family (i.e. the Propeller) then yes, you will see some process variations typically in the 10's of millivolt range from one Propeller Chip to the next. That said, Chip Gracey has spent many long hours with specific attention to how the I/O's behave, so that any process variation, temperature variation, etc. has a minimal impact on the desired result.


    Edit

    VT can vary due to·changes in oxide thickness,·substrate, polysilicon and implant impurity levels and·surface charge. Accurate control of VT is very important. In the past, it varied up to 50% while today it is controlled within 25-50 mV.

    The main cause of variations in process transconductance are due·to changes in oxide thickness.· Variations in W and L are caused by the lithographic process.· These variations are not correlated because W is determined in the field oxide step while L is defined in the poly and src/drain diffusion steps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 10/22/2007 6:04:56 AM GMT
Sign In or Register to comment.