In this case use a p channel mosfet to turn the relay on from the arduino s i o pin.
P channel mosfet high side switch.
Because of how transistors work these can be a little more difficult to use in an arduino or raspberry pi circuit.
Usually the source pin must be more positive than the drain however this isn t true when using a p mosfet to provide reverse polarity protection for instance.
It s a simple circuit that has a input for positive and negative and an output for positive and negative connections.
The opposite of the low side switch is the high side switch.
There are a variety of configurations for driving the two mosfets with many different applications.
The current necessary for the relay coil is too high for an i o pin but the coil needs 5v to work.
No charge pump is required for driving the high side switch.
Used as a high side switch a p channel mosfet in a totem pole arrangement with an n channel mosfet will simulate a high current high power cmos complementary mos arrangement.
To switch v with a p channel mosfet use a p channel mosfet with source connected to v either directly or via a current limiting resistor and the load connected to drain.
P channel mosfets generally have a higher r dson compared to n type mosfets having a similar internal chip size.
The p channel high side switch therefore solves the problem of using an n channel mosfet for high side switching.
This transistor connects between v and the load.
Then the p channel mosfet is used to switch the positive supply to the motor for forward direction high side switching while the n channel mosfet is used to switch the negative supply to the motor for reverse direction low side switching.
It can easily be driven by the mcu via a level shifter.
In this configuration when the high side switch is realized with a p channel mosfet the driver design will be simplified enormously.
P channel mosfet high side switch here s my schematic and board design for a simple high side switch using a p channel mosfet.