I wanted to control my 12V diode strip with Raspberry, but I am not very confident in my circuit-creating abilities and I don't want to fry my Raspberry. So I created a basic circuit diagram:

enter image description here

I want to change amount of voltage that LED stip recives (between 0V and 12V) by changing output voltage on raspberry. To do that I'd use transistor. Code-wise I'd use for example PWMLED from gpiozero or later RGBLED, when I extend this circuit to all 3 channels of LED diode strip.

If you have any tips on what I should avoid so as not to destroy Raspberry, I would really appreciate them.

  • 1
    Welcome to RPi SE. No one can give you a correct and useful answer to your question unless you provide more information. We need details on your LED diode strip. – Seamus Feb 26 at 23:34

The circuit that you have drawn is correct for the Pi side. For the 1Ω in series with the LED , that would depend a bit on your LED strip. For a LED strip, I would use a 2N2222 (up to 500mA) or a TIP 120 if the current is larger (the TIP120 is a darlington, not a single transistor).

Alternatively, if you are very worried about your Pi, you can use an opto coulpler, for example a 4n25:

enter image description here


The broad approach is correct, although without detail of what you are planning to connect and transistor it is difficult to say.

You are driving the transistor with 3.3mA and it is probable that this would be insufficient to drive the transistor into saturation, which would lead to catastrophic failure at high load currents.

NOTE it is inadvisable to use GPIO0 or 1 as these are reserved.

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.