Bug in my Op Amp Circuit: please help..

32 views
Skip to first unread message

Marco Bresciani

unread,
Aug 8, 2017, 1:54:15 AM8/8/17
to Connected Community HackerSpace
Hi there,

I have made an Op Amp Circuit powered by a single supply voltage (battery) that is supposed to detect the presence of a low negative DC voltage by amplifying and inverting it so a 3.3v microcontroller can measure it via an ADC pin.  I don't need to know the exact value, I just need to tell the difference between 0v and a negative voltage anywhere in the range of -5mV to -50mV. 


It doesn't work 😞.


Would some kind soul show me the errors of my ways, or supply a link to a proven circuit that works?


I would be very grateful and will write you in my will for your efforts!  (..Although I will probably die in deep debt so maybe that's not such a great reward).


Thanking you,

Marco


Adam Donnison

unread,
Aug 8, 2017, 2:18:16 AM8/8/17
to connected-commu...@googlegroups.com
Don't the capacitors on input and output block DC? Normally that would be used for AC coupling.

Adam

On 08/08/17 15:54, Marco Bresciani wrote:
> Hi there,
>
> I have made an Op Amp Circuit powered by a single supply voltage (battery) that is supposed to detect the presence of a low negative DC voltage by amplifying and inverting it so a 3.3v microcontroller can measure it via an ADC pin. I don't need to know the exact value, I just need to tell the difference between 0v and a negative voltage anywhere in the range of -5mV to -50mV.
>
> <https://lh3.googleusercontent.com/-E5aoIfVhBPI/WYlONVu7e3I/AAAAAAAAAtM/x1LEA39D-9EjOkma92Zg__uRRkfGgcE1gCLcBGAs/s1600/OpAmpCircuit.png>
>
>
> It doesn't work 😞.
>
>
> Would some kind soul show me the errors of my ways, or supply a link to a proven circuit that works?
>
>
> I would be very grateful and will write you in my will for your efforts! (..Although I will probably die in deep debt so maybe that's not such a great reward).
>
>
> Thanking you,
>
> Marco
>
>
> --
> You received this message because you are subscribed to the Google Groups "Connected Community HackerSpace" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to connected-community-h...@googlegroups.com <mailto:connected-community-h...@googlegroups.com>.
> To post to this group, send email to connected-commu...@googlegroups.com <mailto:connected-commu...@googlegroups.com>.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/connected-community-hackerspace/b8f37d8f-8b3e-4c03-9fbd-4e197add6644%40googlegroups.com <https://groups.google.com/d/msgid/connected-community-hackerspace/b8f37d8f-8b3e-4c03-9fbd-4e197add6644%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--
Adam Donnison email: ajdon...@gmail.com
REDBANK VIC 3477 Australia skype/twitter: ajdonnison

Marco Bresciani

unread,
Aug 8, 2017, 3:03:19 AM8/8/17
to Connected Community HackerSpace
Adam, you are correct!  Thank you!

I added those because I saw another circuit that was using them which I thought was measuring DC.  Obviously, it was AC.

Sadly, I removed the capacitors but it still doesn't work.

Am I using the virtual ground correctly?   Does the ground from the input source go to the circuit's ground or to pin 1 of the op amp?



On Tuesday, August 8, 2017 at 4:18:16 PM UTC+10, AJDonnison wrote:
Don't the capacitors on input and output block DC?  Normally that would be used for AC coupling.

Adam

On 08/08/17 15:54, Marco Bresciani wrote:
> Hi there,
>
> I have made an Op Amp Circuit powered by a single supply voltage (battery) that is supposed to detect the presence of a low negative DC voltage by amplifying and inverting it so a 3.3v microcontroller can measure it via an ADC pin.  I don't need to know the exact value, I just need to tell the difference between 0v and a negative voltage anywhere in the range of -5mV to -50mV.
>
> <https://lh3.googleusercontent.com/-E5aoIfVhBPI/WYlONVu7e3I/AAAAAAAAAtM/x1LEA39D-9EjOkma92Zg__uRRkfGgcE1gCLcBGAs/s1600/OpAmpCircuit.png>
>
>
> It doesn't work 😞.
>
>
> Would some kind soul show me the errors of my ways, or supply a link to a proven circuit that works?
>
>
> I would be very grateful and will write you in my will for your efforts!  (..Although I will probably die in deep debt so maybe that's not such a great reward).
>
>
> Thanking you,
>
> Marco
>
>
> --
> You received this message because you are subscribed to the Google Groups "Connected Community HackerSpace" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to connected-community-hackerspace+unsubscribe@googlegroups.com <mailto:connected-community-hackerspace+unsubscribe@googlegroups.com>.
> To post to this group, send email to connected-community-hacke...@googlegroups.com <mailto:connected-community-hacke...@googlegroups.com>.

Clifford Heath

unread,
Aug 8, 2017, 3:26:10 AM8/8/17
to connected-commu...@googlegroups.com


On 8 Aug 2017 17:03, "Marco Bresciani" <hypnor...@gmail.com> wrote:

Am I using the virtual ground correctly? 

No. Firstly, you need to wire it as a comparator, with positive feedback not negative. That means the resistor from the output goes to + not -. But ignoring that for now, the output will change when the two inputs pass one another. You want that to be somewhere inside the allowed input range, and half Vcc is ok, so your + divider is ok. Run your -ve divider from Vcc to - and from there to your input. That way a zero volt input puts the inputs close to each other. Now tweak the + (reference) divider until the output switches at the right input threshold. 

The feedback resistor is looking at an impedance that's the parallel combination of the reference divider resistors. Make it 100x that to add hysteresis of Vcc/100, so when the output switches it stays switched until the input returns *past* where it triggered. This stops the circuit from glitch in when near the threshold. 

If your micro input can't handle Vcc, add another divider. 

Clifford Heath 

Clifford Heath

unread,
Aug 8, 2017, 3:27:43 AM8/8/17
to connected-commu...@googlegroups.com
Also...

Those divider resistors probably should be 4.7k, not 47 ohms. 

Marco Bresciani

unread,
Aug 8, 2017, 3:42:17 AM8/8/17
to Connected Community HackerSpace
Thank you too, Clifford, for your help.  I will make the changes and let you know how it went.
Reply all
Reply to author
Forward
0 new messages