Can someone please verify my schematic /comparator, Schmitt trigger and NOT Gate

Hi,

Here's my schematic. The comparator is a LM339 and the transistor (NOT Gate) is a BC547B.

What I want it to do is the following:

R2 and R4 set the reference voltage for the comparator. Whenever the voltage across the potentiometer R1 goes above that reference voltage, the LM339's output reads LOW (and vice versa).
However, I need that output to be a HIGH when the voltage crosses above the threshold (and vice versa), that's why I've added the BC547 to function as a NOT Gate.

However, I'm not 100% sure, if I've added some redunancy with the resistors, specifically R5, R6, R7. For example, do I still need a pullup resistor R5 when I add the transistor?

Can someone please verify if I could optimize the circuit?

Thanks in advance,
Joël

Attach your images to the post, Drop Box does not work.

I can't see your schematic, but if you want to compliment the output of a comparator you just swap the + and - inputs, then it will work the other way round.

larryd:
Attach your images to the post, Drop Box does not work.

Thanks, I've edited the original post.

Check your GND connection :wink:

The 339 is open collector so you will need R5

PerryBebbington:
I can't see your schematic, but if you want to compliment the output of a comparator you just swap the + and - inputs, then it will work the other way round.

Unfortunately that doesn't work with the Schmitt trigger.

You must power the 339 properly, +Vcc to pin 3 and GND to pin 12, see the image posted to you in post #4.

BTW, R6 in your schematic is not necessary.


FYI

Thanks Larry, appreciate your help. I've connected the GND properly. It's just that Eagle software (I used for the schematics) named the pins differently than on the LM339.
I'll try to remove R6.

js-:
Unfortunately that doesn't work with the Schmitt trigger.

Indeed, but I couldn't see your schematic when I made that suggestion, so I didn't know what the full circuit was.