When I set digitalWrite to HIGH, I am only measuring 1.9 volts from the declared pin. I am running pinMode set to OUTPUT upon setup. I am trying to run a relay from this pin, which needs 5 volts. I can plug the relay into the dedicated 5 volt output pin and it switches no problem, but when it is connected to the digital (or analog) pins it does not switch with just 1.9 volts present. I have tried it running from USB power and from a wall power supply with no difference.
When I set digitalWrite to HIGH, I am only measuring 1.9 volts from the declared pin. I am running pinMode set to OUTPUT upon setup. I am trying to run a relay from this pin, which needs 5 volts. I can plug the relay into the dedicated 5 volt output pin and it switches no problem, but when it is connected to the digital (or analog) pins it does not switch with just 1.9 volts present. I have tried it running from USB power and from a wall power supply with no difference.
Let me know if anyone has any thoughts. Thanks
Yes, most likely your relay coil requires more current then can be supplied safely from a digital output pin. The limit is around 40ma max and the voltage will drop as you try and draw more current. There is real possibility of damaging a output pin if trying to draw more current then it's rated for. The arduino 5V pin can supply much more current, around 500ma to 700ma depending on if USB or external power connector is used and that is why it works connecting to that.
Anyway, most times when needing to control a relay from an arduino output pin, one uses a switching transistor between the pin and the relay coil and use an external voltage source rated for the relay's coil voltage and current specs.
I thought I had checked the coil current requirements for this relay, but I must have made a mistake, the relay does turn out to need more than 40mA.
It seems that they do make relays that will switch what I need (120volt AC power), using 40mA or less @ 5 volts. I am going to order one up and Ill let you know if I have any problems.
If you're measuring only 1.9 volts from the pin when it is set to HIGH, with nothing else connected to it (ie, the meter is connected between the pin and ground), then it is likely you have burned out that pin.
Rather than looking for a lower current relay, you should instead be using a transistor or mosfet driver between the pin and the relay (and also a diode across the relay coil for kickback), as this tutorial shows:
Quit trying to find a way around it - just learn it, and do it. You'll save time, money and frustration that way.