Digital pin output voltage fall down when driving a relay I'm trying to trigger 8 different 5V relays using arduino atmega 2560. the relays (70Ohm coil) are powered by an external 5V source, and im trying to trigger them through a driving stage which contains for each relay a npn transistor (2N3904) and 1kOhms resistor directly connected to digital pin of the arduino.
the relays in my application are supposed to be drived 2 by 2 not all of them at once.
My problem is that i dont succeed triggering the relay with digital pins of my arduino, once i connect it to the resistor the voltage of the digital pins falls down from 5V to 0.4V or less. The transistor needs only 7mA to be triggered, the output current of the atmega2560 pins is 20mA max.
i tried with an external 5V source, it triggers correctly showing 10mA maximum of current through the driving stage.
Thank you in advance for your help.
Best regards.
If the coil is 70 ohms and it's driven by 5V, it should draw about 5/70 = 71 mA.  That's pushing the 2n3904 a bit hard, and doesn't even account for inductive effects. (It's a small-signal transistor.)  Do you have an NPN power transistor to try, just as a test?  If its current gain (beta) is too low, use a Darlington configuration by combining it with your 2n3904.  (2n3904 base from digital out resistor, emitter drives power NPN base directly, both collectors are connected together to the bottom of the coil, and the power NPN emitter is the effective emitter of the just-created &quot;super transistor&quot; with high beta and power handling.)  Be sure to use an anti-kickback rectifier (1n4001)across the relay coil.