Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
I do have a DMM.
I picked up a TIP32C transistor, as TIP120's are hard to find in my area.
This is my circuit drawing - I've labeled the rows along my breadboard:
The TIP31C worked - plenty of power coming through and the 3 pins of the transistor became so hot it melted the plastic around the breadboard.
Having said that, it wont turn off - I put the LED PIN on 13 to mark when it should go off and on.
This is my code:
const int SOL_PIN = 2; // the Arduino's input pin that connects to the solenoid
const int LED_PIN = 13;
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
// initialize the Arduino's pin as output
pinMode(SOL_PIN, OUTPUT);
pinMode(LED_PIN, OUTPUT);
}
void loop() {
// turn on
digitalWrite(SOL_PIN, HIGH);
digitalWrite(LED_PIN, HIGH);
delay(5000);
//turn off
digitalWrite(SOL_PIN, LOW);
digitalWrite(LED_PIN, LOW);
delay(5000);
}
My guess is that your solenoid is drawing too high a current causing the NPN transistor to go short circuit.
Can you measure the resistance of your solenoid, or measure the current it draws when connected directly across the power supply?
The LED certainly does, 5 seconds on, 5 second off. The magnet's strength remains largely the same - do I need a stronger resistor?
Keeping in mind, I want to solenoid to release not on a timer but at a sudden break in a reed sensor or a light sensor, I would want it to be quite quick.
Hi,
Measure the voltage at the solenoid pin, pin 2, see if it is going high and low.
Measure the voltage at the TIP31 base, it should go 0.7V to 0V.
Can you please post some pictures of your project?
Make sure you have gnd of the UNO and gnd of the 12V supply connected.
Check if you remove the base resistor, leave the base open circuit, the solenoid should not activate, you still have the back EMF diode in circuit I hope.
That relay appears by the specs to pull 100mA.
Thanks.. Tom....
PS. Can you please measure the resistance of the solenoid?
Voltage at pin 2: when high - 5.14V, when low: 1.2V
Voltage at TIP31 base (pins 3 and 2): when high: 132mV, when low: 40mV)
Voltage at TIP31 base (pins 1 and 2): when high: 0.84V, when low: -180mV)
Voltage at TIP31 base (pins 3 and 1): when high: -0.7V, when low: 160mV)