Author Topic: Simple voltage differerential to logic conversion ?  (Read 1232 times)

0 Members and 1 Guest are viewing this topic.

Offline bithead9Topic starter

  • Contributor
  • Posts: 34
  • Country: us
Simple voltage differerential to logic conversion ?
« on: July 29, 2019, 02:59:56 am »
I have a device that is generating between 5 and 6V DC as the result of breaking an LED beam.  I would like to turn this into PULSES that can be read as ON/OFF (digital)  - I was thinking of possibly using a 741 OP AMP in bi-stable mode.  The designs I find so far will work with HALF the +VCC (VREF) and trigger when  the voltage goes above that VREF.  Ideally when the input if +6V that would be an ON state and +5V would be OFF.  Is there a way to use the OP AMP in this way or should I be looking for another IC or circuit?  The non-inverting comparator is what I thought might work:
https://www.electronics-tutorials.ws/opamp/op-amp-comparator.html
Any suggestions?
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7208
  • Country: pl
Re: Simple voltage differerential to logic conversion ?
« Reply #1 on: July 29, 2019, 05:23:56 am »
741 - only if you increase VCC to maybe 9V or more. And then the output will swing up to 8V.
On 6V supply and out of classic parts, TL071/TL072 might perhaps work. It's a rare opamp which works with its inputs close to VCC, but not close to ground.

Normally though, dedicated comparator ICs exist which are like opamps but switching faster. You would be looking for some comparator with rail to rail input, whatever you can get wherever you buy parts.
 

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 9947
  • Country: gb
Re: Simple voltage differerential to logic conversion ?
« Reply #2 on: July 29, 2019, 03:11:07 pm »
Most comparators are open-collector output too, meaning that you can power them at a higher voltage if you need to and just use a pullup resistor between the output and your logic supply.

Look at an LM311 or LM339 (quad) datasheet as a starting point.
Best Regards, Chris
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15320
  • Country: fr
Re: Simple voltage differerential to logic conversion ?
« Reply #3 on: July 29, 2019, 03:32:08 pm »
Ideally when the input if +6V that would be an ON state and +5V would be OFF.

Ok. A comparator with a 5.5V threshold would do. I don't know what the power supplies are in your system. What is VCC? (5V? 3.3V?)

If you don't want to bother with power supplies, instead of going higher, you'd just have to attenuate the input voltage so that 5.5V gives for instance half-way VCC? Set your threshold voltage accordingly.
(Eg: a resistor divider that divides by 2. 5V will give 2.5V, 6V will give 3V. A second resistor divider - but from VCC - to generate the 5.5/2 = 2.75V threshold.)
Take care of the operating range and working supply voltage of the comparator or opamp you're going to select. Power it at VCC.

You can also do the same but add some hysteresis to your comparator (so for instance use two thresholds such as 5.25V and 5.75V) to avoid spurious toggling if the input signal is a bit noisy and/or could be too close to the middle voltage (5.5V).

« Last Edit: July 29, 2019, 03:34:58 pm by SiliconWizard »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19933
  • Country: gb
  • 0999
Re: Simple voltage differerential to logic conversion ?
« Reply #4 on: July 29, 2019, 04:44:43 pm »
The LM311, LM393/LM339 have a common mode range of +V-1.5V, so 4.5V with a 6V supply.

Attenuating the inputs is with a potential divider is a sensible enough solution. Alternatively use a comparator which will work with its inputs closer to 5V. The TL072 is a possibility, although 6V is a bit low and it's optimised for use as a linear amplifier, rather than a comparator.

There are plenty of comparator ICs which will work near or all the way up to the positive rail. The TLC3702 is specified to within 1V of +V, at room temperature and the MIC7211/7221 will work with its inputs up to 0.3V outside the supply rails, so -0.3V to 6.3V with a 6V supply.
https://www.ti.com/lit/ds/symlink/tlc3702-q1.pdf
http://ww1.microchip.com/downloads/en/DeviceDoc/mic7211.pdf
 

Offline bithead9Topic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Simple voltage differerential to logic conversion ?
« Reply #5 on: July 29, 2019, 04:49:36 pm »
I am willing to use any necessary voltage for VCC but the circuit need to trigger based on the 5 to 6V delta of the input.  Thanks for all the replies and suggestions. 
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15320
  • Country: fr
Re: Simple voltage differerential to logic conversion ?
« Reply #6 on: July 29, 2019, 04:55:51 pm »
The additional benefit of using a divider is that it would protect your comparator's input(s). For all I know, the 5-6V supply may come from a source that is much more likely to fail than your own VCC supply (I don't know the whole picture), or at least you may not have any means of controlling it, thus it could be considered an  "unknown".

Of course you can also just protect them with a series resistor (and optionally followed by diodes to VCC and GND) in case you're going for a higher VCC.

I don't know again anything about your device, but adding some protection to your own circuit sounds like a good idea.
 
The following users thanked this post: bithead9


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf