5V from digital port?

Is it possible to get 5V out of a digital port. I've tried port 6 on the uno and nano and only getting around 1.8v on both using:

 digitalWrite (6, HIGH);

I've tried with 12V coming in with and without usb connected.


Placing my bet on an LED w/o a current limiting resistor.


No, it's a 30amp relay that does not have a signal input. Only VCC/GND. So I'm trying to feed it 5v to activate it.

Link to the relay module specifications?

Yes, the digital pin can provide 5V. At a very low current. If you connect a load to it, then the voltage will go down.

Without a schematic, we're only guessing.

Arduino Uno
12v in

D6 out
Ground out


VCC in
Ground in

That's it. The relay is a 30a with 5v trigger.

It does output 4.96v from d6 when not connected to Relay.

Did you forget to set the pinMode to OUTPUT?

VCC in
Ground in

Whre is the driving transistor in this?

What Arduino board?

For an Uno, Mega, Nano, recommended maximum current for an output is 20mA. Absolute maximum current for an output is 40mA.

I have had no luck finding a schematic for the module. The data sheet for the relay says 185mA coil current. The module does not appear to have a driver transistor. Here is a MOSFET driver.

The relay coil resistance is 27 Ohms, and draws 185 mA at 5V. You MUST NOT use a digital pin to drive the relay, and it is not even safe to use the 5V output of an Arduino to power the relay coil.

Use a separate power supply and a driver transistor as shown in reply #8 above. The required inductive kick diode appears to be included in the relay module.

An alternate driver using a BJT:

I have a S8050 and a 2222. Are either of those what I need?

S8050 data sheet.

What is the exact full part number of the 2222. There are 2 different pinouts depending on the part number.
PN2222 data sheet.
2N2222 data sheet

Either one will work with the BJT schematic.

Is a driver transister similar to a relay?

A transistor (MOSFET or BJT) can be used in place of a relay to switch DC current.

What is the load?

What is the voltage and current of the load?

That is pretty cool!! I'm just a beginner. But, that is neat you can control power like that.

A very real danger is that the obsolete tutorials on the Arduino site and others misleadingly imply that the largely ornamental "barrel jack" and "Vin" connections to the on-board regulator allow a usable source of 5 V power. This is absolutely not the case. It is essentially only for demonstration use of the bare board back in the very beginning of the Arduino project when "9V" transformer-rectifier-capacitor power packs were common and this was a practical way to power a lone Arduino board for initial demonstration purposes. And even then it was limited because an unloaded 9 V transformer-rectifier-capacitor supply would generally provide over 12 V which the regulator could barely handle.

If you are asking this question, it is highly likely that you will wish to connect something else. In which case, the answer is regulated 5 V.

This is because the on-board regulator is essentially capable of powering only the microcontroller itself and no more than a couple of indicator LEDs. The on-board regulator might be able to power a few other things if it had a heatsink, but on the (older) Arduinos, it does not.

Powering via the "barrel jack" or "Vin" connections is asking for trouble. The "5V" pin is not by any means an output pin, if anything a "reference" pin but most certainly the preferred pin to which to supply a regulated 5 V.

A practical power supply for the Nano (or UNO, Pro Mini, Leonardo etc.) is a "phone charger" with a USB output connector for 5 V, generally up to a couple of Amps though you can not feed more than 500 mA through the USB connection.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.