Hello, as a beginner after watching hours of youtube tutorials it seems a commonly recommended transistor to use in my circuit is a IRLZ44N. However, here in Australia I'm having a hard time finding one - without paying exorbitant shipping fees from overseas sellers.
I am attempting to power a 0.4a 12VDC solenoid from a Nano - 5v into the transistor. My question is, are there alternatives I could use which may be easier to source locally? I did find on digikeys a possible alternative of IRLZ44NPBF-ND but this too seems hard to source.
That is a low current solenoid, and a relay or any NPN transistor capable of handling more than 0.5 Ampere collector current will work fine. You can even salvage such transistors from a discarded motorized toy (the S8050 NPN transistor, Ic max = 0.7A, is commonly used in toys). The Darlington TIP120 will handle 5 Amperes.
Also, many NON-logic level MOSFETS like the IRF5xx series, will conduct enough current, with 5V on the gate, to activate that solenoid.
I don't quite follow what you mean by "across". I thought the diode should sit between the middle pin of the transistor and the power-in lead of the solenoid to prevent spikes coming back.
The bloke in this YouTube video powers his 12VDC solenoid from the Arduino VIN (I like the idea of only needing one power source for everything). So the striped end of his diode goes to VIN power + power lead to solenoid. He explains this around the 6minute mark Arduino Lesson 4 - Solenoid control using a Transistor - YouTube
This is how to set it up , swap the motor in the circuit for your solenoid
The diode will absorb the pulse current on the back EMF when the solenoid turns off.