Can an output pin set as HIGH give enough power for a 5v relay??
If not what can I do to set up one without buying a module??
No.
What relay ?
And the MOSFET needs to be a Logic level MOSFET.
I was just asking tho
that is just crazy
Why ?
C1 has already been suggested.
Some "quality" relays have the coil that can be activated with 20/30mA, but usually are intended for signals and not for powering loads.
For example, Panasonic has several relay of this type in catalog.
that is way too much I'm just trying to trigger a simple connection
thanks
There are 13 example circuits in the schematic offered.
As mentioned circuit C1 has been given as an example already.
The PDF is a listing of some logic level MOSFETs that work with the Arduino.
The general way to answer such questions is:
looking up datasheets or googling
The datasheet of the microcontroller.
Depending on the microcontrollertype the allowed current per IO-pin is between 2mA and 40 mA.
The datasheet or specs of the relay
depending on the type of 5Vrelay the current varies in the range of 30 mA and 300 mA
depending on the type of device that shall be switched on / off DC
low current 20-500 mA a "classical" transistor
or "medium" high current 0,5-10A the direct use of a MOS-FET is posibble
best regards Stefan
Check this links for example, if suitable for your application
SPNO 5A Panasonic PA-N relay
DPDT 2A Panasonic TQ relay
Thank you so much!!
If you would share what relay you have and perhaps what other electronic components you have, transistors, resistors, diodes . . . we can better give you options.
Also, an external relay power supply may be necessary.
Never mind I just gonna buy a relay module because I don't have any components just an Arduino Leonardo, a cople of jumper wires and a computer. ):
2 seconds of beeing connected to mains voltags (110V) is enough to cause heart fibrillation.
If this would happen you would need an emergency-doctor to do DE-fibrillation of your heart within a few minutes or you die.
So in case you want to switch ON/OFF main-voltage-devices take a solution with ready to use and safety-certified devices.
imagine: how much money would your beloved ones pay (each month) to have you back alive again instead of dead? I'm very sure really a lot of money. So it is worth to spend the money on professional and high secure equipement.
best regards Stefan
A pin of ATmega328P MCU of UNO Board can deliver at best 20 mA current at 4.2V (Fig-1). (Please, have a look at the right top.)
Figure-1: