Go Down

Topic: Hysteresis Op Amp weird behaviour (LM358p) (Read 740 times) previous topic - next topic

F1_

Nov 03, 2019, 11:45 pm Last Edit: Nov 04, 2019, 12:23 pm by F1_
Hi

I got the following circuit and with the help of this website I know that R2 = 10k, R1 = 200R, R3 = 1M.


Vref is 4,1V, I apologise for the bad writing.

The problem is that when I connect R1 to R3 and the photodiode + pin, the voltage that usually is 4.56 and above drops immediately to a few 300mV in that node.

The Op-Amp is the LM358p (Datasheet).

What am I doing wrong?
I assembled the circuit as it is in the schematic, but I can send a photo if needed.
"I don't think a success factor of a novel is determined by the tools used by the writer, it can be notepad, ms word, or just pencil and paper, but CREATIVITY IS." ~DuckfaceNinja, Construct2 Forum user

MarkT

#1
Nov 04, 2019, 02:01 am Last Edit: Nov 04, 2019, 02:03 am by MarkT
Please provide the diagram with _all_ the resistor values.  R3 is crucial for instance.

And have you checked the input and output voltage ranges for the opamp?  You perhaps want a real rail-to-rail opamp?
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

MarkT

BTW not all opamps can be used as comparators, rail-to-rail or otherwise, and in general you should use a comparator as a comparator, not an opamp, because they are way way better at the job.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

F1_

R3 is 1M.
I was thinking about using a single supply Op-Amp since the output will be connected to an Arduino board input.


And have you checked the input and output voltage ranges for the opamp?  You perhaps want a real rail-to-rail opamp?
Yes, I have, it is powered correctly.
"I don't think a success factor of a novel is determined by the tools used by the writer, it can be notepad, ms word, or just pencil and paper, but CREATIVITY IS." ~DuckfaceNinja, Construct2 Forum user

MarkT

No, I mean have you checked the input and output voltages for the opamp in the datasheet?  You are expecting them to work at 4.1V from 5V supply, but they can't.

At 1M that R3 has no effect at all on the circuit as R1 will completely dominate.

Where did you get this circuit?

What are you trying to do?
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

F1_

I made up this circuit.
I was trying to get a voltage comparator with Hysteresis so that when a fast object passed in front of the photodiode the comparator would detect the small voltage drop and give a signal to an Arduino board.
In the datasheet, is the topic 7.7 "INPUT VOLTAGE RANGE" the reason it won't operate from 4.1 to 5V? In other words, it's range is only 0 to 3.5V if Vs=5V?
"I don't think a success factor of a novel is determined by the tools used by the writer, it can be notepad, ms word, or just pencil and paper, but CREATIVITY IS." ~DuckfaceNinja, Construct2 Forum user

MarkT

Alas you chose the wrong configuration which heavily loaded the voltage you were trying to sense.

You want to observe the voltage at the junction of the photodiode and 1M resistor?  The you need an impedance much higher than 1M (not 200 ohms!).

You need a true rail-to-rail device for this, be it a comparator or an opamp, if you want to work right up against the +ve rail.

Make life easy and work down near ground - far more devices go to the -ve rail than to the +ve rail.  In particular the LM358 should work close to its negative rail.

So redo the divider: photodiode to ground, 1M to 5V.

The way to wire this is inverting input sensing the photodiode, non-inverting input to the voltage reference (which would be 0.9V with things the other way up), adding hysteresis in that part of the circuit where it doesn't load the diode divider.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

F1_

I think I understand now. I had no idea that there was such a thing as the Input and Output voltage range.
I'll follow your advice, thank you very much for your time and attention!

"I don't think a success factor of a novel is determined by the tools used by the writer, it can be notepad, ms word, or just pencil and paper, but CREATIVITY IS." ~DuckfaceNinja, Construct2 Forum user

Go Up