Hoping one of you have had a similar issue.
I'm running some relays off a Arduino via a transistor setup and external power supply. When I connect to pin 13 (the one with the onboard LED) it works a treat giving my relay board the signal (~4.8V) to turn on the relay.
However, when connecting to any other output pin (12,11,10,3,2,1 tried so far) i only get a voltage of around 2.2V delivered to the relay board.
Have you any ideas what could be causing this? Is pin 13 rated with a higher output current or something? Have a made a wiring mistake?
Here's a picture of it...
The top LED is lit by pin13, the others by pins 1 and 3. (and yes I've tried all the circuits and they work the same)
Thanks for any help
Did you set the pinMode ?
i.e. pinMode(9, OUTPUT);
Nope! : Thank you very much Don! A newbie mistake! Problem resolved.
If he didn't set it, how did he get a voltage of 2.2V out of it? Is it cause it's averaging the open pin who's voltage is jumping around, or something else?
A digital pin in the input mode, but not wired to anything is said to be 'floating' and the actual voltage is undefined, and performing a digital read on a floating pin can fetch either a high or low depending on the phase of the moon or other unknown force and what you might measure with a DVM would mean little in fact or logic.
One can activate an internal software pull-ups on a input pin and it will then assume the digital HIGH state, typically measuring 4.7-5vdc.
Setting the pin to high while in input mode (default for all digital pins except 13, I believe) will turn on the internal pull-up. This should read as 5v (or close to it), but if a load is connected to it, the pull-up resistor would form a voltage divider with it, which would cause a lower reading (depending on the resistance of the load).