I made the circuit shown in the attachment to control a 4.5v solenoid with an Arduino Uno. I could not get it to work until I pulled R1 out of the circuit. I started with a 330ohm resistor and it didn't work. I dropped down to 100ohm and could hear the solenoid trying to work. When I removed the resistor (R1) completely the circuit worked fine.
I am still not getting the fast power that I want out of the solenoid. When I switch the solenoid with a push-button switch I really snaps.
I have some N-Channel Mosfet transistors on order. I hope they will switch better than the 2N2222 transistor, but I am wondering what people think of why this only worked for me after removing the resistor and is it bad not to have that resistor protecting the circut.
I hope you ordered Avalanche or UIS rated MOSFETs, then you will only need a gate resistor in the 50 Ohm range. It sounds like your solenoid pulls more then the 2N222 can supply. The schematic made it easy, thanks.
Why are you powering the 4V5 solenoid with 24V?
What is your 24V supply?
Do you have a DMM?
If so can you measure:
The voltage between the emitter and collector of the 2N2222 please, without base drive and then with base drive.
The voltage between the emitter and base of the 2N2222 please, without base drive and then with base drive.
Are you sure you have the 2N2222 pins configured correctly, double check the data sheets.
Make sure your BJT is 2N2222 and not a PN2222.
Can you post a link to data/specs of your solenoid?
Can you please post your code that you are testing the solenoid action with please?
In this case it is much easier to use a mosfet, which can directly replace the transistor. then change the 470r for 4K7, and add 100K from source (GND) to gate).
But I think a relay is a much better solution.
The point here is that using a relay does might not seem as elegant as an electronic switch, but when activating solenoids a relay is being used for precisely the purpose for which it is intended. Cheap, reliable and capable of handing the horrid currents and flyback voltages of solenoids.
Think about replacing the solenoid in your diagram with a relay (and using a cheapo mosfet). And then switch the solenoid with the relay.
As I say, this is precisely the designed function of a relay.
So,
As far as I can see the following sequence of events is possible:.
4.5V coil 24V supply => Activate the transistor and blow it up => Transistor dead (B-C junction alive, B-E junction dead).
Then if Arduino output is high => no current can enter the Arduino.
If Arduino output is low: all current goes through the transistor (C->B) and through the Arduino to GND.
For sure this is not healthy for the processor.
This would explain why a resistor in the B-Circuit spoils the fun.
Best Regards,
Johi.
bezelsanddisplays:
In this case it is much easier to use a mosfet, which can directly replace the transistor. then change the 470r for 4K7, and add 100K from source (GND) to gate).
What is the solenoid's resistance (Ohms)? What voltage is connected to the coil? Some xN2222s have a reversed pinout (C-B-E instead of E-B-C). Make sure yours is correct.