Solenoid won't close

Hey we're making a device that uses solenoids to regulate the flow of fluid. The solenoid opens but doesn't close. Our code is essentially the same as the one listed below with one variable name change:

int solenoidPin = 4; //This is the output pin on the Arduino we are using

void setup() {
// put your setup code here, to run once:
pinMode(solenoidPin, OUTPUT); //Sets the pin as an output
}

void loop() {
// put your main code here, to run repeatedly:
digitalWrite(solenoidPin, HIGH); //Switch Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin, LOW); //Switch Solenoid OFF
delay(1000); //Wait 1 Second

What we don't understand is why (with the provided transistor from the arduino kit) the solenoid will open but not close. We have a power source of 12 V for 120 valves, and we used the project 9 mock up as a schematic (but without the diode or DC motor). When we go HIGH the external power source ceases but when we go LOW it doesn't. Is this a transistor issue? We've tried using different breadboards and wires but nothing has changed.

Thanks

Help the forum help you. Include an as-built schematic of your circuit. Hand drawn is OK, Fritzing is frowned upon. Check out the 'how to use this forum' stickies for tips on how to post code and attach pictures.

I've attached a picture of the breadboard and the transistor layout

int solenoidPin = 4; //This is the output pin on the Arduino we are using
I don't see anything plugged into that connector

I also don't see any resistors or back-emf diodes to protect the mosfets.
What mosfet are you using. Some kits have the (useless) IRF520 in there.
You need LOGIC LEVEL mosfets.

The first section of this page shows you how to properly use mosfets.
Leo..

Tell us about the solenoid valve. Is it spring loaded so it will automatically close if not active? Or does it need a reversed voltage/current to force it closed?

Paul

don't see any resistors or back-emf diodes to protect the mosfets.

... or the Arduino pin!
(I know you knew what you meant!)

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile: