Max Voltage allowable to input pin

Is 5 volts the maximum you can connect to a pin being used as an input? I have a sensor that I would like to use but it’s minimum voltage is 10 volts dc. I believe that if the sensor activates it would send that voltage to the pin. I know that the board only outputs 5 volts but can it handle a higher signal voltage? Here is the sensor I’m trying to use:

http://www.datasheetlib.com/datasheet/866961/qs18ab6af40_banner-engineering.html

Thank you!

BillMurphy:
Is 5 volts the maximum you can connect to a pin being used as an input?

Yes.


Perchance read the datasheet?

From the datasheet of the ATmega328

Voltage on any Pin except RESET with respect to Ground . . . . . . . . . . -0.5V to Vcc +0.5V

So if the Arduino is running @ 5V, 5,5V is the absolute maximum for a pin.

If a sensor outputs 10V when active use a voltage divider to knock it down to 5V.

5 volts max.

But you can still use this.
The instructions are on page 7 of the datasheet, use the 1st method: NPN (Sinking) Outputs.
Get yourself a power supply suitable to the sensor.
If it is 10 volts, you could also power the Arduino out of that, through the barrel jack.
Any way, connect the GNDs of the Arduino board and of that power supply.
Connect the blue and brown wire as shown in the manual.

The trick is to connect either the black (most probable what you want to do) or the white wire to your input pin.
Set that input pin as INPUT_PULLUP
The resistor drawn in the manual is now "generated" internally in the Arduino, but connected to its 5 volts.
That should work.
Now if your sensor is active, the level at the input pin will be LOW.
If it is inactive, it will be pulled HIGH by that internal PULLUP resistor.

MAS3:
use the 1st method: NPN (Sinking) Outputs.

It is not really a method but a choice of model. If you do have the QS18VN6AF40 model it is indeed possible.

If you are receiving voltage a little higher that 5volt on a data pin, put a 10K resistor in series.

So by doing this the sensor is in effect just a switch that is connecting the pin to ground and the operating voltage (10+ volts) just powers the sensor, is that correct? And thanks...that's what I was hoping I could do.

MAS3:
5 volts max.

But you can still use this.
The instructions are on page 7 of the datasheet, use the 1st method: NPN (Sinking) Outputs.
Get yourself a power supply suitable to the sensor.
If it is 10 volts, you could also power the Arduino out of that, through the barrel jack.
Any way, connect the GNDs of the Arduino board and of that power supply.
Connect the blue and brown wire as shown in the manual.

The trick is to connect either the black (most probable what you want to do) or the white wire to your input pin.
Set that input pin as INPUT_PULLUP
The resistor drawn in the manual is now "generated" internally in the Arduino, but connected to its 5 volts.
That should work.
Now if your sensor is active, the level at the input pin will be LOW.
If it is inactive, it will be pulled HIGH by that internal PULLUP resistor.

Which of the three models do you have?

Archibald:
Which of the three models do you have?

I haven't purchased one yet so all options are available. We have one on a PLC based machine that is sensing the exact same part (.065 dia stainless steel tubing) that I need to sense with my Arduino based controller. So I just need to be sure I can interface it with the Arduino.

BillMurphy:
I haven't purchased one yet so all options are available. We have one on a PLC based machine that is sensing the exact same part (.065 dia stainless steel tubing) that I need to sense with my Arduino based controller. So I just need to be sure I can interface it with the Arduino.

So if you purchase model QS18VN6AF40 with has NPN (sinking) outputs, refer to the circuit diagram labelled "NPN (sinking) outputs" at the bottom of page 7 of the datasheet. If you connect the negative supply (pin 3) to ground of your Arduino, you can use the Arduino's pull-up resistors as described by MAS3 in post #3. Note you can use normally-open (pin 4), normally-closed (pin 2) or both. The Arduino's pull-up resistors can be as high as 50kΩ (150kΩ on the Arduino Due) so you may wish to use resistors with a lower value.

Thank you, I just ordered it. :slight_smile:

You need to check that it's OK to earth the negative side of your power supply. If the positive side of your power supply is already earthed there will be a bang and some smoke.

Archibald:
You need to check that it’s OK to earth the negative side of your power supply. If the positive side of your power supply is already earthed there will be a bang and some smoke.

That sounds like a good - affirmative - way to test that sort of thing.

Test the voltage from the earth pin of your AC socket (In the USA it's the round socket), to your ground and positive of the power supply.

I get 0 volts DC both ways.

Are you in the USA?
Did you test that with DC and AC on your meter?
If so, then maybe neither positive, nor ground is connected to earth ground. What do you think?

It's late at night over here, and i have been working and dining late.
So i'm probably missing something.
But what's the purpose of measuring a DC power supply against the wall socket protection ground ?

Archibald:
You need to check that it's OK to earth the negative side of your power supply. If the positive side of your power supply is already earthed there will be a bang and some smoke.

Extremely non-standard, but no harm in checking.

I'm in the USA and I checked using DC. If I had AC voltage going from my DC pos or neg to ground I think it would be time to scrap that power supply, no? :wink:

YES!