When I use a 9 V DC battery, it worked fine. But bec of less power solenoid was not generating powerful enough force. I modifies a computer power supply as power source. Now when provide +12 V (15.0 A) power, 36V big solenoid(not using 5V small anymore) valve is pulled once & then it sticks with the body of solenoid. If I pushed it back, & keep pushing so to not touch the body of solenoid, it works. & if it is stick with body, it remains same even after I turn off power & have to push it to seperate. The Serial.print I put in program is not printing.
Whats problem here?
What I guessed is that the inductance of solenoid bec of much current generates magnetism in the body of the solenoid that sticks the valve & it keeps it stck even after power is tuened off so I have to push valve to separate. One more thing is that the solenoid starts moving even if I put 12 V lead to power supply without supplying ground to it.
Here is my code:
int solPin = 13;
void setup() {
Serial.begin(9600);
// initialize the digital pin as an output.
pinMode(solPin, OUTPUT);
}
void loop() {
Serial.println("Loop start");
digitalWrite(solPin, HIGH); // turn the trnsister's BASE on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(solPin, LOW); // turn the trnsister's BASE off by making the voltage LOW
delay(100); // wait for a second
Serial.println("Loop end");
//Serial.print("\n");
}
//It is likely the loop is going to fast for the solenoid to keep up.
I changed it to different values, keeping this fact in mind. Something like 10000, 100000 but same result. Have changed it like giving little value for HIGH like 100 & bigger like 10000 for LOW output so that it has enough time to come back but again same result
// Either lower the power or lubricate the solenoid.
If I use less volt like 9 or 5, it has not enough push power. It's is just opened brand new solenoid, should again I need to lubricate it ?
It has the feel of a mechanical problem. If you move the solenoid plunger by hand, can you make it stick in the same way? Is the return spring present and intact? Are you applying any side load to the solenoid plunger? Your comment about "keep pushing so to not touch the body of solenoid" makes me wonder whether the solenoid is missing a component which is supposed to guide the plunger.
As I mentioned in OP, it works fine with 9 V DC battery. The return spring is intact. I do not get what you mean by applying side load, but it is a bare solenoid bough a week ago & put straight into experiment. When circuit if run, the plunger stick to casing with 1st pull. Part of plunger is outside casing from bottom of solenoid with a nice plastic core over it. If I push from bottom to keep plunger not touching casing from spring side, it keeps vibrating. No, if it is pushed down un-powered, the spring pushed it back when left.
@codlink: OK, it's printing now. Some problem may be. I checked serial print out while attaching small 5V solenoid. As I mentioned in OP, small solenoid works fine. Serial printout printed while small solenoid attached. Then I replace 36V big solenoid & provided 12 V (15.0A). It did same, stick to casing with fist pul & while serial print out continued printing. Then I test my hypothesis of electromagnetism created in the body by inductance by putting small solenoid near to it & it stick to body of big solenoid. When I disconnect power, there was no sticking. This is how understood things by far.
@codlink: can you please describe in words too which pin of which component is connected to what connection following the schematic you mentioned. I am a novice in electronics, so I have a fear of burning my board if nor properly connected. Especially confusion about pins of MOFSET.