2

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!

antony.trupe
  • 371
  • 2
  • 9
  • 24

3 Answers3

5

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.

Jason S
  • 14,038
  • 3
  • 42
  • 70
  • In practice, I would expect that the current supplied by a typical RS232 port wouldn't damage a chip, though adding a supply diode would certainly seem like a good idea. Also, while the RS232 specification would suggest that one should drive CTS negative for a marking condition, in practice most serial ports will pretty reliably interpret a steady zero volts as marking. They may be slower to react to zero volts than to a negative voltage, which means that use of zero-volt-marking for data will not necessarily be reliable, but for many (not all) ports, a steady-state zero voltage is fine. – supercat Mar 12 '12 at 18:29
0

If your signal destination implements RI (Ring Indicator), you can get away with it if you use DTR set to true (around -10V) for your negative rail and RI for your output. You will need a pull-up resistor on the comparator output too. The LM339 requires up to 2.5mA supply current at a minimum of 2V supply voltage which is within the capabilities of most RS232 drivers (10mA Isc typ). I have used this technique in the past with PC serial ports which can generate an interrupt on RI change of state.

You will also need reverse polarity protection in case the flow control lines power-up in the wrong states as per Jason S's answer.

MikeJ-UK
  • 5,378
  • 16
  • 20
0

Many computers today have no serial port or do not fully implement to RS232 specifications. Especially those USB-Serial dongles are called serial for a reason: They don't implement RS232. Where a true RS232 port may often be able to drive a little circuit, modern ports often don't.

Would a little device like http://fabiobaltieri.com/2011/12/17/usb-sensors-avr/ be an option? It uses USB, which has proper power and most modern day PC's / servers have a USB port.

jippie
  • 33,221
  • 16
  • 95
  • 161