Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4606

Automation, sensing and robotics • Solenoid + raspberry pi - beginner level!

$
0
0
Hi, I've read that I can connect a solenoid to the 5V supply of a Raspberry Pi using a transistor and a diode, so following the recommendation I've bought:
  • 5V mini push-pull solenoid
    TIP120 Power Darlington Transistor
    1N4001 Diode
Could someone take a look and let me know if the setup I've got here is correct, and my understanding of the circuit too? I'm very much learning on the job... Am I right that the transistor basically connects pins 2 and 3 if it receives a smaller voltage signal to pin 1 (the base / control) - in this case, if it receives a positive voltage, it'll connect the negative pin of the solenoid to the raspberry pi ground. The diode is one-way so the stripy end won't allow the 5V supply back into the solenoid, but if the solenoid discharges quickly back down the ground wire, it will flow back to the 5V line (I think).

A couple of other questions:
  • Do I need the resistor? I've seen some examples with and without. If so why / how large should it be? This is 1k Ohms
    Instead of connecting the 5V Raspberry Pi input to the positive rail of the breadboard, could I keep the Pi just as the controller, and keep the wiring exactly the same as it is but swapping out the 5V to the positive rail and replacing with a battery pack? If so, would the negative side of the battery pack be connected to the ground rail alongside the Raspberry Pi's ground?
Screenshot 2024-11-21 at 12.19.48.png

Statistics: Posted by flipsterino — Thu Nov 21, 2024 12:22 pm — Replies 0 — Views 10



Viewing all articles
Browse latest Browse all 4606

Trending Articles