bump
i really need some advice please. I have my solenoid and purchased a n type mosfet as the switch.
I have the solenoid connected in parallel to a diode. These are both connected to a 5v source. The other wire is connected to the D on the mosfet. The S is connected to ground and the G is connected to pin6 on the leostick.
i have used the following mosfet.
http://tronixstuff.wordpress.com/2011/12/06/review-freetronics-module-family/
I have uploaded a test solenoid code onto the leostick
const int SOLENOID2_pin=6;
const int LED_pin=13;
void setup() {
Serial.begin(9600);
pinMode(SOLENOID2_pin, OUTPUT);
digitalWrite(SOLENOID2_pin, LOW);
digitalWrite(LED_pin, LOW);
}
void loop() {
delay(500);
digitalWrite(SOLENOID2_pin,HIGH);
digitalWrite(LED_pin, HIGH);
Serial.println("2 high");
delay(500);
digitalWrite(SOLENOID2_pin,LOW);
digitalWrite(LED_pin, LOW);
Serial.println("2 low");
delay(500);
}
however this is not working. Can you please tell me where I may be going wrong???
thanks