The Output Voltage of LM358

Hello,

Please look at the following diagram:

When positive input is 0,the output should be 0v,while the output should be 5v If positive input is 1.8v.

However, now the output is 1.8v when positive input is also 1.8v.

The first solution I think is that: need I delete C5/C8? Maybe the first output is vibrate. But I can’t assure that.

The second solution: Can I use LMV358 instead of LM358 ? Because LMV358 is a rail to rail output amplifier. ( the

datasheet of LMV358: http://www.kynix.com/uploadfiles/pdf9675/LMV358AM8X.pdf )

Could anyone here give me some suggestions?

Best regards~

The LM358 is not rail to rail, and the output will always be a volt or two less than the positive supply voltage. If you intend the output stage to be a comparator, use a comparator.

Get rid of C5, C7 and C8; they are not doing anything useful.

Neither amplifier in the circuit is properly biased, even a rail to rail op amp.

What is connected to J1? What is this circuit supposed to do?