Arduino Mega Digital I/O voltage?

telarium:

Graynomad:
The voltage on a Mega pin is 5v when high, 0v when low, simple.


Rob

I'm new to this. Is this always true? Even when you have an external 9v power supply instead of USB power? And if so, is there any way to get the digital pin to output the full 9v from my power supply, or should I be doing something else?

Always true. The arduino output pins will always reflect the voltage level the processor chip is powered with. On a standard Arduino board the chips are powered by either the USB +5vdc power, or the on-board +5vdc voltage regulator. Your +9vdc voltage source connected to the arduino's external power connector feeds the input to the on-board voltage regulator, not directly to the board's chips. The chips on the board can not work at higher then +5vdc, they would be destroyed.

If you need high voltage logic levels you must use an external switching transistor that the arduino can turn on and off the transistor with +5vdc, but the transistor's collector load can be wired to any desired DC voltage level. That's how an arduino can be made to power 12 volt motors, lamps, solenoids, and other devices requiring higher then +5vdc or more then 20ma of current draw.

Lefty