-4

In the following circuit I'm using a Raspberry Pi to power a solenoid. I want to prevent any current from damaging my Pi in case I connect something wrong (like D2). However, I am unsure whether I could damage my Pi via the ground connection.

The Pi runs with on 3.3V-5V while the circuit runs on 19V .

Could I use something like a voltage regulator between the transistor and the ground connection of the Pi to bring the 19V down to 5V. If so, how?

schematic

simulate this circuit – Schematic created using CircuitLab

A J
  • 13
  • 4
  • I'm a bit of a noob at this sort of thing... But instinctively that looks horribly wrong – Makoto May 23 '17 at 10:48
  • 3
    You have a requirement for something and, it seems that this requirement is not at all defined in a way that makes sense to me and, you have a circuit that makes no sense and therefore gives no further clues to what your requirement is. So, you want something that doesn't make sense and you have a nonsense circuit that you think may achieve what you want. Should there be any reason not to close this question? I don't think so. – Andy aka May 23 '17 at 10:48
  • 1
    It IS horribly wrong, I don't know even where to start. For example, the voltage regulator has in and ground tied together? – Bart May 23 '17 at 10:49
  • 2
    What is this circuit supposed to do? If you want separation of voltages, you would better drive the transistor from an opto coupler. – Bart May 23 '17 at 10:50
  • 1
    Possible duplicate of [Which of the following methods should I use to actuate a solenoid from a microcontroller?](https://electronics.stackexchange.com/questions/278101/which-of-the-following-methods-should-i-use-to-actuate-a-solenoid-from-a-microco) – Olin Lathrop May 23 '17 at 11:11
  • 1
    Hallucinogenic stupors and electrical engineering really don't mix. Try again after detox. – Olin Lathrop May 23 '17 at 11:12
  • If you 1) throw out that 5 V regulator, and **promise** to never use a regulator like that ever again. Ever. 2) just connect both grounds together. You don't need the right diode in series with the 220 ohm resistor, remove it. 3) stop worrying about 19 V getting into the Rpi. Then the circuit will probably just work. Assuming relay and NPN are up to the job. – Bimpelrekkie May 23 '17 at 11:31

2 Answers2

2

In most circuits you specifically want the grounds to be shared. If you eliminate the 5 volt regulator in your circuit, it will function fine provided the transistor can handle the 19 volt supply and the current drawn by the solenoid. The diode coming off of the processor is overkill but does provide protection from a shorted transistor.

If you wish to completely isolate the solenoid supply so that they do not even share a ground, then you should look at opto isolator designs.

Glenn W9IQ
  • 5,526
  • 11
  • 17
2

For reference and to protect against future edits, here is your circuit being discussed:

First, add component designators to your schematics. That is something any competent schematic software should do for you automatically.

Second, provide a spec. It's not clear at all what this circuit is supposed to achieve.

Third, What the ... !? D2 (like I said, add component designators) is superfluous. 1N4004 is a power rectifier and not the best choice for catching inductive kickback.

However, the real head scratcher is the 5 V regulator. I can't even guess what you think it does, but it won't do anything useful. Worse, it interferes with the ground connection between the RPi and the return current from the transistor. If you want to drive a solenoid from a digital output otherwise as shown, just connect the two grounds. There is no problem to solve here. The 19 V isn't going to somehow magically "use" the ground of the RPi in a detrimental way, whatever "using" means in this context.

Olin Lathrop
  • 310,974
  • 36
  • 428
  • 915
  • since it seems there is quite some confusion about my question, I'd like to clear it up a bit. Imagine that the cable from the transistor to the 19V supply is removed, the 19V would flow back to the Pi. I am unsure if the pi could handle this so I added this regulator just to be sure. However it would need to be connected back to ground, which looked funny to me. So therefore I asked wether this (voltage regulator idea) was possible at all. From the answers I received it is apperently not the case. On another node, could you explain why it is unclear to you what this circuit does? – A J May 23 '17 at 11:27
  • I think you need to deepen your understanding of how a voltage source works. – Vladimir Cravero May 23 '17 at 11:53
  • @Vlad: I think you meant to address your comment to the OP, not to me? – Olin Lathrop May 23 '17 at 12:05
  • Well, yes of course! @AJ the previous comment was for you. – Vladimir Cravero May 23 '17 at 12:12
  • "Imagine that the cable from the transistor to the 19V supply is removed, the 19V would flow back to the Pi." Do you even know how electricity works? – Bart May 23 '17 at 15:00