Non zero output from LM358 even though input is zero - Page 1
Forum section: electronics / beginners

author: Arb32
author_rank: Newbie
timestamp: September 21, 2021, 09:18:01 pm
content: HiI was using LM358 as voltage comparator in non inverting configurationI gave 5V to vcc and 2.5V to inverting pin through a potentiometerThe issue is I am getting a output voltage of approx 3.8V even when the supply to the non inverting terminal is zeroI get output no matter I set the voltage of the non inverting pin zero or less than or more than that of inverting terminalAlso the ic gives the same output when non inverting is given some voltage and inverting is zeroThe ic output gets zero only when both inverting and non inverting terminals are zeroPlease help me to sort thisI desire to get high output only when the voltage at non inverting is greater than that at inverting i.e 2.5V

author: DavidAlfa
author_rank: Super Contributor
timestamp: September 21, 2021, 10:29:43 pm
content: 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...

author: SmokedComponent
author_rank: Regular Contributor
timestamp: September 22, 2021, 03:42:01 am
content: Quote from: DavidAlfa on September 21, 2021, 10:29:43 pmActually, LM358 can swing to near ground or V-.

author: perieanuo
author_rank: Frequent Contributor
timestamp: September 22, 2021, 04:53:30 am
content: 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 withavoid using opamps without any reaction and filtering, i don't want to elaborate because your schematic point the need to watch opamp tutorials firstif you want a voltage value detection, this is what voltage supervisor are made, they do it perfectly at a good cost

author: Whales
author_rank: Super Contributor
timestamp: September 22, 2021, 05:58:57 am
content: 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.

author: Arb32
author_rank: Newbie
timestamp: September 22, 2021, 07:38:02 am
content: Hi Whales, I tried this but still faced the same issue

author: Whales
author_rank: Super Contributor
timestamp: September 22, 2021, 07:56:45 am
content: Quote from: Arb32 on September 22, 2021, 07:38:02 amWhat did the output voltage do?

author: magic
author_rank: Super Contributor
timestamp: September 22, 2021, 08:03:43 am
content: Probably something like:- fake chip- damaged chip- bad breadboard, missing connection somewhere- you got the pinout wrong

author: DavidAlfa
author_rank: Super Contributor
timestamp: September 22, 2021, 02:19:58 pm
content: Quote from: SmokedComponent on September 22, 2021, 03:42:01 amWell, that's what the datasheet says. It it's actually capable of reaching gnd, that's a bonus, but not specified there...

author: StillTrying
author_rank: Super Contributor
timestamp: September 22, 2021, 02:33:45 pm
content: 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.

author: Cerebus
author_rank: Super Contributor
timestamp: September 23, 2021, 12:15:20 am
content: Quote from: DavidAlfa on September 22, 2021, 02:19:58 pmA more careful reading of the data sheet is in order:Edit: Actually it even says it on thefront pageof the data sheet:

author: Arb32
author_rank: Newbie
timestamp: September 23, 2021, 08:50:20 am
content: Hi,I replaced the opamp with LM393The issue is when I test the comparator individually ,it works fine, i.e it will give output only when noninverting is greater than invertertingBut when I connect it in the whole circuit the same issue occurs of giving output when noninverting is zeroPLEASE HELP ME TO SORT IT

author: perieanuo
author_rank: Frequent Contributor
timestamp: September 23, 2021, 03:26:01 pm
content: eliminate those pull-up/dn resistors on opamp outputs and tell us what's the resultif you want protection for IC3 put some 100R in series with opamp outopamp 358d is push-pull he don't need pull-ups or anything elsethe idea ishttps://www.electronics-tutorials.ws/opamp/op-amp-comparator.htmlno more no less