Author Topic: Non zero output from LM358 even though input is zero  (Read 1546 times)

0 Members and 1 Guest are viewing this topic.

Offline Arb32Topic starter

  • Newbie
  • Posts: 8
  • Country: in
Non zero output from LM358 even though input is zero
« on: September 21, 2021, 09:18:01 pm »
Hi
I was using LM358 as voltage comparator in non inverting configuration
I gave 5V to vcc and 2.5V to inverting pin through a potentiometer
The issue is I am getting a output voltage of approx 3.8V even when the supply to the non inverting terminal is zero

I get output no matter I set the voltage of the non inverting pin zero or less than or more than that of inverting terminal
Also the ic gives the same output when non inverting is given some voltage and inverting is zero

The ic output gets zero only when both inverting and non inverting terminals are zero

Please help me to sort this

I desire to get high output only when the voltage at non inverting is greater than that at inverting i.e 2.5V
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5802
  • Country: es
Re: Non zero output from LM358 even though input is zero
« Reply #1 on: September 21, 2021, 10:29:43 pm »
Because not all amplifiers can fully reach the power supply range.
The LM358 output range goes from (+V -1.5V) to (-V +1.5V).
So if you power it with 5V and GND, the output will be between 1.5V and 3.5V.

You need a rail-to-rail amplifier. Ex. the LMV358, MCP 602, MCP6002...
« Last Edit: September 21, 2021, 10:33:51 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline SmokedComponent

  • Regular Contributor
  • *
  • Posts: 60
  • Country: si
  • Emitting smoke
Re: Non zero output from LM358 even though input is zero
« Reply #2 on: September 22, 2021, 03:42:01 am »
The LM358 output range goes from (+V -1.5V) to (-V +1.5V).
So if you power it with 5V and GND, the output will be between 1.5V and 3.5V.
Actually, LM358 can swing to near ground or V-.
 

Offline perieanuo

  • Frequent Contributor
  • **
  • Posts: 838
  • Country: fr
Re: Non zero output from LM358 even though input is zero
« Reply #3 on: September 22, 2021, 04:53:30 am »
using the opamp like this is not recommended, attacking in+ directly is to be avoided at least without mastering opamps. for beginners, in- is much simpler to work with
avoid using opamps without any reaction and filtering, i don't want to elaborate because your schematic point the need to watch opamp tutorials first
if you want a voltage value detection, this is what voltage supervisor are made, they do it perfectly at a good cost
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1898
  • Country: au
    • Halestrom
Re: Non zero output from LM358 even though input is zero
« Reply #4 on: September 22, 2021, 05:58:57 am »
Hmm.  The 358 should allow GND as input and allow differential input voltages.

Try hooking up a pot to the + input too, slowly change it and see what happens at the output.  Perhaps you have a chip that's not really am LM358.

Offline Arb32Topic starter

  • Newbie
  • Posts: 8
  • Country: in
Re: Non zero output from LM358 even though input is zero
« Reply #5 on: September 22, 2021, 07:38:02 am »
Hi Whales, I tried this but still faced the same issue
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1898
  • Country: au
    • Halestrom
Re: Non zero output from LM358 even though input is zero
« Reply #6 on: September 22, 2021, 07:56:45 am »
Hi Whales, I tried this but still faced the same issue

What did the output voltage do?

Online magic

  • Super Contributor
  • ***
  • Posts: 6730
  • Country: pl
Re: Non zero output from LM358 even though input is zero
« Reply #7 on: September 22, 2021, 08:03:43 am »
Probably something like:
- fake chip
- damaged chip
- bad breadboard, missing connection somewhere
- you got the pinout wrong
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5802
  • Country: es
Re: Non zero output from LM358 even though input is zero
« Reply #8 on: September 22, 2021, 02:19:58 pm »
The LM358 output range goes from (+V -1.5V) to (-V +1.5V).
So if you power it with 5V and GND, the output will be between 1.5V and 3.5V.
Actually, LM358 can swing to near ground or V-.

Well,  that's what the datasheet says. It it's actually capable of reaching gnd, that's a bonus, but not specified there...
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Non zero output from LM358 even though input is zero
« Reply #9 on: September 22, 2021, 02:33:45 pm »
The data sheets say the LM358's output can't go higher than Vcc-1.35V so 3.8V max high output on a 5V supply is about right.

"the common mode voltage range is VCC-1.7 V."

Both inputs should be kept between 0V to Vcc-1.7V, so 0V to 3.3V, before you could say it was faulty, although it looks like the output should still be in the right direction if only one of the inputs is above Vcc-1.7V.

On a breadboard, at least sometimes measure the voltages right at the ICs pins as a check for bad connections.
.  That took much longer than I thought it would.
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: Non zero output from LM358 even though input is zero
« Reply #10 on: September 23, 2021, 12:15:20 am »
The LM358 output range goes from (+V -1.5V) to (-V +1.5V).
So if you power it with 5V and GND, the output will be between 1.5V and 3.5V.
Actually, LM358 can swing to near ground or V-.

Well,  that's what the datasheet says. It it's actually capable of reaching gnd, that's a bonus, but not specified there...

A more careful reading of the data sheet is in order:



Edit: Actually it even says it on the front page of the data sheet:

« Last Edit: September 23, 2021, 12:19:42 am by Cerebus »
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 
The following users thanked this post: DavidAlfa

Offline Arb32Topic starter

  • Newbie
  • Posts: 8
  • Country: in
Re: Non zero output from LM358 even though input is zero
« Reply #11 on: September 23, 2021, 08:50:20 am »
Hi,
I replaced the opamp with LM393

The issue is when I test the comparator individually ,it works fine, i.e it will give output only when noninverting is greater than inverterting

But when I connect it in the whole circuit the same issue occurs of giving output when noninverting is zero

PLEASE HELP ME TO SORT IT
 

Offline perieanuo

  • Frequent Contributor
  • **
  • Posts: 838
  • Country: fr
Re: Non zero output from LM358 even though input is zero
« Reply #12 on: September 23, 2021, 03:26:01 pm »
eliminate those pull-up/dn resistors on opamp outputs and tell us what's the result
if you want protection for IC3 put some 100R in series with opamp out
opamp 358d is push-pull he don't need pull-ups or anything else
the idea is https://www.electronics-tutorials.ws/opamp/op-amp-comparator.html
no more no less
« Last Edit: September 23, 2021, 03:28:58 pm by perieanuo »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf