Electronic – does a serial port have enough power to drive a comparator circuit

serial

I am trying to use serial port pins to power this circuit. Basically I want to send a voltage high to pin 8 when somebody "opens the box" that this circuit is in. Otherwise, it will send a voltage low when the box is closed. I can detect this in software just fine, my question is with hardware.

Will the serial port be able to power this circuit? I looked at the LM339 datasheet and it seems like the current needed is pretty low, but i dont know the serial port's power capabilities. Any advice would be great, thanks!

Best Answer

Your circuit as drawn won't work properly, at least not with an RS232 serial port. The RTS and CTS signals are bipolar with respect to ground, and are expected to meet RS232 levels.

If the RTS line goes low, it will go negative with respect to ground and play tug-of-war with the LM339's ESD protection diodes. You'd also need to handle the case where the RTS line stays high (positive) but the comparator needs to provide a negative voltage on CTS, and therefore there's no guaranteed source of negative voltage, meaning you need to have a positive-to-negative voltage converter.