Can a negative voltage smaller then -5v damage an input pin?

I just used an Arduino Uno to build a simple interface for a vintage calculator (HP48GX). The signal is rs232 with the levels -4.8V / + 4.5V. So far it works fine. The negative voltage is recognized as LOW. The positive as HIGH. I am a bit worried though, that the negative voltage might be bad for the Arduino in the long run?

(Yes, I should probably use a rs232-ttl buffer chip. But I don't have one at hand right now.)

Thanks,
Norbert.

Yes.
Check the data sheet.

From the ATMega datasheet, page 299, for the 328p:

Absolute Maximum Ratings:
Voltage on any Pin except RESET with respect to Ground . . . . . . . . . . -0.5V to VCC+0.5V

Vcc on the Uno is of course +5V.

I'd stop and get a proper logic conversion chip in there.

EDIT: AWOL and I crossed posts in cyberspace.

it depends on the current. Still, you shouldn't feed negative voltage into a pin. This will (sooner or later) destroy your microcontroller.

Here's how a typical pin is protected:

As you can see; if the voltage is less than 0v, current will flow through the diode at in the bottom left corner (note that this diode can only handle a few milliamps)

Good to know. Many thanks for the Infos guys.

You don't need a rigorous level shifter here.
Schottky diode on the arduino input pin to ground, band towards the pin.

Then put a resistor in series with the serial line, say 1-2k or so to limit the current. When the voltage goes negative, the schottky diode will clamp it to -0.3v or so, keeping it in spec.

actually getting -5v into a pin would be deadly but that is highly unlikely to occur with even +-12v rs232.

it is amazing the rube goldberg setups noobs (and many "experts") use in the name of level conversion. most driving devices have output capability well under the couple ma avr input diode or latchup limit. if Iout is unknown or just to be safe a 10k series resistor is more than adequate.

lets not even mention the subject of switching thresholds which can be just as entertaining.

this generally falls on deaf ears but the good news is hooking up max232, 4050, 245, TXB0104, handful of transistors, or other silly contrivances do little harm. and probably keep em out of the bars which is what this hobby is all about. right?

In the mean time I measured the current. Connecting the calculator straight to the input pin causes a current of about -4mA.

Then I added a current limiting resistor. I experimented a bit with the value. I went up to even 100k and added a forward diode in parallel, so the resistor is only effective on the negative voltage. The signal looks still good enough on the scope. The edges started to become a little bit rounded off. But the calculator only operates at 9600 baud. Even after a lot of testing, I didn't get any retransmitted blocks.

The current is now only about -45uA. I guess, that's safe enough.

Many many thanks for all the input guys.

so now we might guess even direct connect will not fry the chip. the diode isnt necessary but dont hurt. fyi i find a 10k is good at 57kbps but to get up to 250k 1k is needed before slew issues raise their ugly head. we must make sure to put that right at the rx not the tx end due to cable capacitance and noise pickup.

john1993, thanks for the hint about where to locate the resistor.

I added the diode only because the rise time of the rising edge was getting worse.

Only the 100k resistor:

A diode parallel to the resistor:

Maybe the resistor adds to the already existing input impedance during the high signal, where it is no problem at the falling edge, because being clamped to ground?

Btw. I found even a technical guide for the HP48 calculator with specifies the operating range of the signal levels. It's amazing how much afford they'd put into documentation for a calculator back then:

HP 48 I/O Technical Interface Guide

i think 1k-10k probably better than 100k for most common baud rates. too high resistance is the reason pin and cable capacitance are having such effect on your signal. scope probe probably aint helping either. even so looking at those traces it should work though. plenty safety margin around the switching threshold.

ps. those specs seem to indicate no resistor at all is ok too.