The one with hover-text "Insert an Image" just the left of the link button.
You know that Due pins cannot drive a relay directly, you must drive a transistor to drive the relay,
and that some Due pins can only source a tiny amount of current, a few mA, so you have to
get all the details right.
I set output as pin 8. I only know that when u read pin 8 plus ground it should gives you 3.3v. I assume any load like a relay operating at 3v can connect to this pin plus ground and it should be working fine.
Now I know there is a voltage drop. So what can I do to use the voltage at pin 8 to operate the relay.
I set output as pin 8. I only know that when u read pin 8 plus ground it should gives you 3.3v. I assume any load like a relay operating at 3v can connect to this pin plus ground and it should be working fine.
Now I know there is a voltage drop. So what can I do to use the voltage at pin 8 to operate the relay.
My relay show dc 3v to drive 220v lamp.
I will insert a diagram of the relay later.
Thanks.
If you look at the datasheet, that relay consumes approximately 150 mA in the coil of the control circuit. If you connected every output pin of your Due to the relay and put them all HIGH at the same time and shared the load across all the pins at the same time evenly, you would STILL be overloading the Due by 20 mA. At the moment you are WAY overloading pin 8 by itself and if you haven't ruined your Due already, you will very soon.
As said, "what you can do to use the voltage at pin 8 to operated the relay" is connect pin 8 to a power transistor and then have the power transistor turn the power on to the relay. Google. YouTube. Whatever. You will find it if you look.
I calculate 265uA base current with a 10k base resistor.
The transistor will work in it's linear region, and that 3volt/150mA relay will only get 1.5-2volt if you're lucky.
Unwise to load the linear 3.3volt MCU rail with a 150mA relay if you have a 5volt switching supply rail available.
Get a 5volt relay module (includes transistor and diode), and power that from the 5volt pin. 5volt relay modules use about 80mA.
Post a link to the module first. I think not all can be controlled with 3.3volt.
Leo..
sickaporean:
I only know that when u read pin 8 plus ground it should gives you 3.3v. I assume any load like a relay operating at 3v can connect to this pin plus ground and it should be working fine.
sickaporean:
If I direct connect the 3.3v which is on the due board to the relay plus ground, it works. Why?
When you direct connect it, it works because you have enough current availble to activate the relay coil. If you connect it through the Due microcontroller, it doesn't work because the microcontroller has internal resistance in its circuitry which is limiting its output current capability. You will overheat and ruin the Due microcontroller if you keep trying.
My example circuit with the 10k resistor in the schematic above may not work with such high resistance (10k), but it was just an example of one of the first image results from a google search. The point was that there is plenty of information availble online if you look.
sickaporean:
If I direct connect the 3.3v which is on the due board to the relay plus ground, it works. Why?
The relay wants 150 mA. Depending on point of view 150 mA is nothing (i.e. power plant) or it is HUGE current (Arduino's point of view). Whole Arduino needs (much) less than 150 mA. The chip can provide current for small LED or a small servo but it is limited at around 20mA per pin (and it cannot provide so much power from all pins at once). The 3.3V pin on the board is connected directly to power source, does not go through the chip that drives Arduino.
** 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 800 mA.** This regulator also provides the power supply to the SAM3X microcontroller.
you'd also find the answer to your 1st question, just above, in the input/output section :
Each of the 54 digital pins on the Due can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 3.3 volts. Each pin can provide (source) a current of 3 mA or 15 mA, depending on the pin, or receive (sink) a current of 6 mA or 9 mA, depending on the pin. They also have an internal pull-up resistor (disconnected by default) of 100 KOhm. In addition, some pins have specialized functions:
Before you connect anything to an input/output of your board, it is necessary to look at the datasheet of the device, and check that it is OK to connect it - If not, and if you don't know what to do, ask your question here, providing as much details as you can, including the datasheet or the reference of the device.
Sorry if that seems pedantic, I just think that doing that will improve your learning curve, and save you a lot of time, and probably save some boards as well
Is there any relay I can buy off the shelves that does not consume such high current but at 3v and able to operate 220v lamp etc.?
No, not that can be run of a Due's 15mA pin, let alone a 3mA pin.
Relays require mechanical movement through electro magnets, because you are switching mains the mechanical contacts are big and so heavy and need a lot of moving, that equals a lot of current.
sickaporean:
Is there any relay I can buy off the shelves that does not consume such high current but at 3v and able to operate 220v lamp etc.?
The relay COIL should be POWERED by the 5volt power pin of the DUE.
Not the 3.3volt supply, not a 3volt relay.
The 3.3volt supply should be kept "clean" for the micro.
It should be a 5volt relay, with drive transistor, base resistor, and kickback diode across the coil.
All of this is mounted on an off the shelf relay MODULE.
Enter "Arduino relay module" on ebay to see shiploads of them.
The output pin of the micro (0 or 3.3volt) does NOT power the relay.
The output pin only gives a small base current (~2mA) to the transistor.
The relay CONTACTS can be used to switch something.
Leo..