minimum voltage that has to be applied to arduino pin in input mode

I know this question has been asked too many times to be counted. but i still have doubts

what is the minimum voltage that has to be applied to an arduino pin in input mode for:
a) it to be considered active high
b) it to be considered active low

am using the most commonly used arduino uno.

and some background info, if it helps:
I need to switch on an AC motor using a relay thats controlled by the arduino. the arduino itself is battery powered, and it'll need to check(using a while loop) if external power supply to run the motor is available, before the relay is switched on. and this checking is done by probing an arduino pin, connected to a wall wart providing 3v input. when there is a power failure, there is 0V at the input pin.
so will 3V be considered high and will 0V be considered low?

Have a look at table 30-1, Common DC Characteristics on page 313 of the datasheet for the ATmega328P(the microcontroller used in the UNO): http://www.atmel.com/images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf
The minimum value for Input High Voltage, except XTAL1 and RESET pins for VCC = 2.4V - 5.5V is 0.6VCC. If the Uno is running at 5v:
0.6 * 5v = 3V
That means 3V would be at the very lowest range of what is considered a high input. The wall wart may not be providing exactly 3V.

Use the wall supply for the input of an optoisolator. The output can then be used to gnd an input of the Arduino. The wall supply 3v will easily switch on the optoisolator LED (use a current limiting R).

Weedpharma

pert:
That means 3V would be at the very lowest range of what is considered a high input. The wall wart may not be providing exactly 3V.

thanks pert, so it had better be comfortably more than 3V for it be be considered as active high...and am hoping 0V is active low

That was just an example assuming you are running at 5V. I don't know what your actual application is, if the Vcc is lower then the minimum high input voltage is also lower. In that same table in the datasheet you'll see that Input Low Voltage for Vcc = 2.4V - 5.5V is -0.5V minimum to 0.3Vcc maximum which means that for 5V operation anything up to 1.5V is a low input.

weedpharma:
Use the wall supply for the input of an optoisolator. The output can then be used to gnd an input of the Arduino. The wall supply 3v will easily switch on the optoisolator LED (use a current limiting R).

Weedpharma

thanks weedpharma, so the pin-to-ground circuit breaks when power goes out. that's how to use the optoisolator. right?

The optoisolator output acts as a switch to gnd when the supply has power. When the power fails, the LED does not light and the optoisolator output transistor turns off. The pull up R (don't forget to use one!) puts a HIGH on the Arduino input rather than a low. That is your trigger.

Weedpharma

weedpharma:
The optoisolator output acts as a switch to gnd when the supply has power. When the power fails, the LED does not light and the optoisolator output transistor turns off. The pull up R (don't forget to use one!) puts a HIGH on the Arduino input rather than a low. That is your trigger.

Weedpharma

alright. got it :slight_smile:

pert:
In that same table in the datasheet you'll see that Input Low Voltage for Vcc = 2.4V - 5.5V is -0.5V minimum to 0.3Vcc maximum which means that for 5V operation anything up to 1.5V is a low input.

hmm.. 0.3Vcc= 1.5V, but what is -0.5V. (how can it be negative?)

0.5v is the lowest voltage that will not destroy the input. If the input source swings negative this can happen.

Weedpharma

weedpharma:
0.5v is the lowest voltage that will not destroy the input. If the input source swings negative this can happen.

Weedpharma

thanks. understood :slight_smile:

one thing i should've made a bit more clear is that when i said my arduino is battery powered, what i actually meant is that its powered via a power bank(the one used to charge mobiles,smartphones etc). the power bank outputs 5V at 1A. and power is provided via the usb port of the arduino using the usb cable. hence its akin to the arduino being connected to a pc. so Vcc is not even being utilized for any purpose at all.
hope that all the above discussions still stand relevant in light of this new info