Hi!, I need help with arduino and a relé to switch a bulb .. but I have some problems:
The digital output 13 and ground: Is able to activate a 5 vcd relé, with 3 volts aprox, that allows to turn on a 220 volts bulb by the dry contacts of the relé.
We have tried the digital output 9, 12, 2 and TIERRA, but those not provide voltajes as the last ones. May be there is a programming problem, or arduino has a fail in the other digital outputs.
All mentioned has been tried with the sensor connected.
This problem has been show up in other works also, but now is important.
The question is: When the digital outputs are active, how much voltage are them supous to give?
The pins should be close to 5V when they are high, if you use a "standard" Arduino powered with 5V.
But it is probably not the voltage, but the current that is your problem.
You should not drive a relay directly from an Arduino pin, the relay will most likely draw far too much current and can easily damage the pin or the entire Arduino board.
You need to drive the relay with a transistor AND an extra powersupply, check the second schematic in this page:
And just replace the DC motor in the schematic with your relay.
If it works on pin 13 but not the others then your problem is that you are not defining the other pins to be outputs in the setup part.
Pin 13 is the only pin that comes up as an output from a reset.
So you need:-
pinMode(9,OUTPUT);
in setup() if you want to use pin 9 as an output.