I am creating a solenoid lock system that is controlled by Arduino. I have a circuit set up but it doesn't seem to be working. I have checked and double checked everything but can't seem to find an issue. When I plug in the 12V 2A power supply into the wall the solenoid "turns on" unlocking the lock. It won't unlock and I want to be able to control its state via arduio. I am using a
I attached pictures before in a zip file, but this is the schematic drawn out. The code should output a 4 second cycle, however the lock is staying unlocked in the "HIGH" state.
The zip files are not the best, like small bird nests.
In the code You have defined "Lock" as 3 but Your drawing shows a Connection to Digital pin 13. That is where the onboard LED is connected.
akinsjm:
Neither pin works. If I connect to pin 13 I see the LED flashing as it is supposed to. The lock however does not change state.
Hey. When the code accesses pin 3 You should only connect to pin 3. You can try and attach a resistor of some 10k to 47k between the base and emitter of the transistor. You can also reduce the base resistor to some 330 Ohm.
When I tried the different pins I changed it in my code as well. I tried both adding a 10K between the base and the emitter and reducing the base resistor to 330 and nothing has changed, the problem persists
Ok. Bring up Your multimeter and measure the voltage at the Arduino pin, the voltage at the base of the transistor.
You can also try a test code that outputs a LOW all the time.
akinsjm:
I have tried replacing the transistor and the diode multiple times and to no avail. Any other ideas? Your help is much appreciated!
And no wonder it burns out every time!
You have the diode connected the wrong way round, bypassing your solenoid!
Let me elaborate on that.
The diode bypasses the solenoid; the transistor is subject to the full voltage of your power supply - it burns out, in the process turning into a dead short. In turn this now burns out the diode making it open circuit so your solenoid is now permanently on.
You have the diode connected the wrong way round, bypassing your solenoid!
When I turn the diode the other way the diode only gets REALLY hot and the solenoid won't turn on then. The power supply also has a led that flashes on and off when the diode is switched. If the diode is the way I have it now then the diode doesn't get warm and the power supply led stays on constant.
Hfe is irrelevant for a saturated (switching) transistor.
To properly saturate a darlington transistor, like the TIP120, you need a base current of 1/250 of the collector current.
See the numbers top/right in the saturation graph of the datasheet.
You are driving the base with ~800uA (5volt, 4k7 resistor, ~1.3volt BE drop).
That's be ok for a small ~200mA solenoid.
But for a 1-2Amp door strike you should lower that base resistor to 1k, or even 470 ohm.
Even then the TIP120 will 'loose about 1volt, and could get warm.
It's the 21th century. We now use logic level mosfets instead of lossy bjt darlingtons.
Leo..
Hi,
The diode has a white ring printed on one end of the body, that is the cathode and in your case it should connect to the positive supply side of the solenoid.
If you disconnect the UNO from the protoboard and leave the 12V, transistor and solenoid connected, when you apply 12v to the protoboard, does the solenoid activate?
It is hard to tell from your picture, but is the blue wire going from the UNO to the protoboard gnd, connected to the UNO gnd or 5V?