0
\$\begingroup\$

I'm putting together this circuit, but am not clear how to wire up the part with the diode. This is what I have so far, but it doesn't seem right (how does the solenoid get power?).

diagram

Components are:

\$\endgroup\$
  • 1
    \$\begingroup\$ The diode goes "backwards" across the coil, not in series with it. And please do not route the power for the coil through a breadboard, buildup something with thicker wires on a piece of solderable proto board. This kind of project is a fairly effective way to kill a pi as all it takes is one slight mistake, granted they aren't expensive, but... Is there a reason this needs to be something as complex and stateful as a pi, and not an Arduino or ESP8266? \$\endgroup\$ – Chris Stratton Sep 24 at 23:27
  • 1
    \$\begingroup\$ The circuit shown on the breadboard doesn't match the circuit in the link you claim to be copying. The schematic in that link clearly shows the diode in parallel with the solenoid, but your breadboard layout shows it in series. \$\endgroup\$ – Peter Bennett Sep 24 at 23:30
  • \$\begingroup\$ @ChrisStratton I'm going to control the GPIO over WiFi, thus the Pi. Thanks for the input on powering the solenoid - I'll definitely make that change. \$\endgroup\$ – Michael Sep 24 at 23:34
  • 1
    \$\begingroup\$ Not what you asked, but the solenoid is rated at 5V and pulls 1.1A -- a PN2222 is capable of maybe 200mA if you heat sink it carefully, and drive it hard (20mA into the base). Moreover, you're showing a supply of 12V. To follow your schematic, you need a solenoid rated for your supply voltage, and a transistor suitable for the task. \$\endgroup\$ – TimWescott Sep 24 at 23:36
  • 1
    \$\begingroup\$ The shematic in your link shows the diode in parallel with the solenoid. One side of the solenoid should go to the positive supply, not to ground. Follow the schematic in your link! As another comment states, if you have a 5 volt solenoid, you need to connect it to a 5 volt supply, not 12 volts. \$\endgroup\$ – Peter Bennett Sep 24 at 23:47
1
\$\begingroup\$

The circuit shown on the breadboard doesn't match the circuit in the link you claim to be copying.

The schematic in your link shows the diode in parallel with the solenoid - your breadboard drawing shows the diode in series with the solenoid. One side of the solenoid should go to the positive supply, not to ground as shown on the breadboard.

Follow the schematic in your link!

As another comment states, if you have a 5 volt solenoid, you need to connect it to a 5 volt supply, not 12 volts.

Also, the 2N2222 transistors you have have an Absolute Maximum current rating of 600 mA (although Adafruit does claim 1 A peak). This is not sufficent as the solenoid draws 1.1 amp at 5 volts.

\$\endgroup\$
1
\$\begingroup\$

1) your solenoid connections are both wrong, this is a low side switch with Red (V+) power applied to load..

2) your component resistances are missing e.g. DCR of solenoid , Rce of NPN transistor ( Rce=Vsat/Isat) and hFE of transistor considering the switched current gain is more like 10% of the linear hFE.

  • take a 12W solenoid.
    • e.g. DCR is 12 Ohms i.e. 12V/1A= 12Ohms
    • a tiny transistor may not be enough
    • if temp rise is 200’C/W, Pt must be < 1/5 W thus Rce< 200mOhm and Ib ~ 10% x Ic = 100mA which you cannot do with (5V -0.7)/2.4K.
    • But could do with an NFET Ron <0.2

This example is not a general solution yet illustrates you must be more careful with connections and double-check (always) and understand how switches work and dont work by not having enough bias or low enough resistance.

\$\endgroup\$
  • \$\begingroup\$ Thanks @Sunnyskyguy EE75 if you can indicate how the solenoid should be connected I can accept this as the answer \$\endgroup\$ – Michael Sep 25 at 11:30
  • \$\begingroup\$ Can you not do this? I gave the root cause , not simply the answer \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Sep 25 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.