5V Solenoid Issues

Hello.

I got a recent 5v solenoid (code and wiring done as guide here)

However, the solenoid activates regardless of connection to digital pin.

digitalWrite(pin, LOW);

Could this be an issue with the parts or something else?

Regulator: 7805/5V Regulator/TO-220
Solenoid: One used in guide above
Diode: 1N4001

There's no regulator in that guide and and you didn't mention the other (important) components like the transistor. Please provide a component list and a schematic (hand drawn and photographed is fine) of what you ACTUALLY have?

Steve

The parts were

1N4001 Diode
7805 Regulator/Transistor
220 Ω Resistor
5v solenoid identical to one used in guide
Arduino Uno


OP image. How to post images.

7805 Regulator/Transistor

You cannot replace a transistor with a 7805. They are completely different parts with completely different uses.

Hi.

Did you order the 7805 from the parts list of that site ?
A 7805 is not a transistor, it is an IC to regulate a supply to a "steady" 5 volts.
Steady is dependent on some additional components, quite limited and not too efficient to today's standards.

You cannot use it the way you tried.
You should always check the pin arrangement of your (assumed to be) transistor.
Only if you know you've got the exact same parts that are in your manual, you might consider to blindly follow such instructions.
But to check for yourself is always better.

I'm not sure the recommended transistor 2N3904 really is capable or the best choice for this job.

Thanks for the help!
Any suggestions for what I could use?

How much current does the solenoid draw?

Would a 2n2222 work?

DirtCube:
Would a 2n2222 work?

If you won't answer our questions then we can't really answer yours. Again...how much current does the solenoid draw?

If that current is less than a 2N2222 can comfortably handle then probably yes. Otherwise probably no.

Steve

If you cannot find a specification for the solenoid coil current, you can get an estimated current for the solenoid by measuring the coil resistance and dividing the rated voltage by the coil resistance. So, coil current (A) = rated voltage (V) / measured resistance (Ohms).

slipstick:
If you won't answer our questions then we can't really answer yours. Again...how much current does the solenoid draw?

If that current is less than a 2N2222 can comfortably handle then probably yes. Otherwise probably no.

Steve

groundFungus:
If you cannot find a specification for the solenoid coil current, you can get an estimated current for the solenoid by measuring the coil resistance and dividing the rated voltage by the coil resistance. So, coil current (A) = rated voltage (V) / measured resistance (Ohms).

I'm afraid I do not have a measuring device.

I assume a 2n2222 can handle it as the solenoid is quite low powered.

Assumption and wild assed guessing (WAG) are not good engineering practice. A DMM (digital multimeter) is a necessary tool for anyone doing electronics. An adequate meter can be obtained at low cost.

groundFungus:
Assumption and wild assed guessing (WAG) are not good engineering practice. A DMM (digital multimeter) is a necessary tool for anyone doing electronics. An adequate meter can be obtained at low cost.

Anyone growing up around Sun test gear will remember their slogan:

tdg.jpg

Lol it turns out I had one.
The solenoid draws 0.21 amps

So the 2N3904 is too tight or not capable of driving this (click !), assumed your measurement is accurate.

A 2N2222 can handle 3 times as much current as the 3904, and will have some spare breath.
That will help manage the inrush current these inductive loads have (you can't measure that with a simple multimeter).

Things might change if you decide to put some load to the solenoid.

Thanks for the help!