# Searching Transistor which transforms 3.3v to 12v (level shifting problem)

#### noname1234

Joined Feb 20, 2021
8
Hello there,
I am trying to control my ws2811 led strip with my raspberry pi 4. But unfortunately the strip requires 12v and the gpio pins of the raspberry pi can only provide 3.3v. Thats why I am looking for a transistor that can take 12v (I have a 12v powersupply) and switch it on and off with 3.3v. I am pretty new to this electronics thing so please be patient.

#### ericgibbs

Joined Jan 29, 2010
18,661
hi 1234,
Welcome to AAC.
What is the current or wattage rating of your 12V LED strip.?

Update:
https://ledstrip.netlify.app/

E

Last edited:

#### DickCappels

Joined Aug 21, 2008
10,123

The selection of the transistor depends upon how much current it will have to supply to the LEDs (you can use the calculator to which Eric linked to find the total current for a string of LEDs) and the base resistor can be calculated from the transistor's datasheet. Vss is +12V

#### Papabravo

Joined Feb 24, 2006
21,020
Hello there,
I am trying to control my ws2811 led strip with my raspberry pi 4. But unfortunately the strip requires 12v and the gpio pins of the raspberry pi can only provide 3.3v. Thats why I am looking for a transistor that can take 12v (I have a 12v powersupply) and switch it on and off with 3.3v. I am pretty new to this electronics thing so please be patient.
Just to put a fine pedagogical point on the TS question. The transistor is not transforming anything in the sense that it can't make a 3.3 V supply produce +12 V all by itself. If you have a 3.3 V supply and a +12 V supply, then a 3.3 volt signal can control a transistor that allows current to flow from the +12V supply through the load (LED string) to ground. No transformations, just control.

There is a circuit called a "DC-DC Boost converter" that will perform that transformation, but it requires more than a single transistor and has certain tradeoffs. That is a topic for another day.

#### ericgibbs

Joined Jan 29, 2010
18,661
(I have a 12v powersupply) and switch it on and off with 3.3v
Hi Papa,
The TS states that he has a 12v power supply and he wants control the 12V using a transistor.

E

#### Papabravo

Joined Feb 24, 2006
21,020
Hi Papa,
The TS states that he has a 12v power supply and he wants control the 12V using a transistor.

E
It was the thread title that made me think he had something else in mind. There was a bit of a disconnect on first reading.

#### crutschow

Joined Mar 14, 2008
34,055
Depending upon the LED current, you may need a Darlington transistor configuration or a logic-level MOSFET to drive the LEDs.

#### MrChips

Joined Oct 2, 2009
30,501
IRLZ44 or IRL510 N-channel logic level MOSFET is always handy to have in stock.

#### BobaMosfet

Joined Jul 1, 2009
2,108
Hello there,
I am trying to control my ws2811 led strip with my raspberry pi 4. But unfortunately the strip requires 12v and the gpio pins of the raspberry pi can only provide 3.3v. Thats why I am looking for a transistor that can take 12v (I have a 12v powersupply) and switch it on and off with 3.3v. I am pretty new to this electronics thing so please be patient.
Here are a few vendors you can peruse as you continue along your electronics adventure:

Code:
+-------------------------------------------------+------------------------------------------------------------------------------+
| vend_name_                                      | vend_weburi_                                                                 |
+-------------------------------------------------+------------------------------------------------------------------------------+
| All Electronics                                 | https://www.allelectronics.com/                                              |
| Allied Electronics, Inc.                        | https://www.alliedelec.com/                                                  |
| AND Technologies Co. Ltd                        | http://http://and-global.com/                                                |
| Arrow Advantage                                 | https://www.arrow.com/                                                       |
| Arrow NAC                                       | https://www.arrow.com/                                                       |
| Circuit Specialists                             | https://www.circuitspecialists.com/                                          |
| Clockworks                                      | http://www.clockworks.com                                                    |
| Future Electronics                              | https://www.futureelectronics.com/                                           |
| HEBEI INTERNATIONAL TRADING (SHANGHAI) Co. LTD. | http://www.ledz.com                                                          |
| Hobby World                                     | https://www.aliexpress.com/store/833384?spm=a2g0s.9042311.0.0.45ef4c4dO5Hl9b |
| icmarket2009                                    | https://www.ebay.com                                                         |
| Jameco Electronics                              | https://www.jameco.com/                                                      |
| KingTech                                        | https://kingtechlcd.com/                                                     |
| Meritage Sales, Inc.                            | https://www.meritagesales.com/                                               |
| MicroChip Direct                                | https://www.microchipdirect.com/                                             |
| MPJA Electronics                                | https://www.mpja.com/                                                        |
| Newark / Element4                               | https://www.newark.com                                                       |
| Pololu                                          | https://www.pololu.com/                                                      |
| ScanTool.net LLC                                | https://obd2cables.com                                                       |
| Sparkfun                                        | https://www.sparkfun.com/                                                    |
| SRA Soldering Products                          | https://sra-solder.com                                                       |
| Surplus-Electronics-Sales                       | https://www.surplus-electroncs-sales.com                                     |
| Tayda Electronics                               | https://www.taydaelectronics.com/                                            |
| The Electronic Goldmine                         | https://www.goldmine-elec-products.com                                       |
| Unusual Electronics                             | http://www.unusualelectronics.co.uk                                          |
+-------------------------------------------------+------------------------------------------------------------------------------+

#### ApacheKid

Joined Jan 12, 2015
1,459
Hello there,
I am trying to control my ws2811 led strip with my raspberry pi 4. But unfortunately the strip requires 12v and the gpio pins of the raspberry pi can only provide 3.3v. Thats why I am looking for a transistor that can take 12v (I have a 12v powersupply) and switch it on and off with 3.3v. I am pretty new to this electronics thing so please be patient.
I came across this:

Its discussed in detail here.

This is using a MOSFET (perhaps a "power" MOSFET, not sure what it takes to make one a "power" MOSFET though).

These devices are attractive because they draw close to zero current into their Gate, so easy to drive right from weak sources.

There are people here far more expert than I so they may have more information on this.

#### noname1234

Joined Feb 20, 2021
8
Thanks a lot for the lot of great answers! Unfortunately i couldn’t figure out how much curent one ws2811 led consumes but I know that my strip is around 3m in length and it is 30 Leds per meter.

#### DickCappels

Joined Aug 21, 2008
10,123
Are all the LEDs the same color?

Do you have any other information, like what connections are available and any voltage specifications.

Do you have some basic electronic tools like a voltmeter or current meter?

Through a little experimenting we can probably figure out a good drive scheme.

#### ericgibbs

Joined Jan 29, 2010
18,661
hi 1234,
This should be able to drive the strip.
The MOSFET is high power, with a Logic Gate voltage.
E

#### Attachments

• 45.2 KB Views: 7
• 189 KB Views: 3
• 10.2 KB Views: 5

#### noname1234

Joined Feb 20, 2021
8
No I don’t have any „basic electronic tools“ but I can tell you the details I know about the strip and send you a picture: It is an addressable RGB Led strip with 3 inputs: 12v, Din, Gnd -> power, data, ground. Each 3 Leds have an own controller so you can control the colors of always 3 together (for ex. first 3 Leds: red, second 3 leds blue and so on.)

#### Attachments

• 1.7 MB Views: 9

#### noname1234

Joined Feb 20, 2021
8
hi 1234,
This should be able to drive the strip.
The MOSFET is high power, with a Logic Gate voltage.
E
Hi Ericgibbs,
Thanks for your advice I am still new to electronics so could you please explain how I should connect the 3 inputs on my strip to a GPIO port on my pi and my 12v powersupply? Do I need any other components? Like resistors?

#### noname1234

Joined Feb 20, 2021
8
hi 1234,
This should be able to drive the strip.
The MOSFET is high power, with a Logic Gate voltage.
E
I also have some TIP 122Gs laying arround. Would they do the job too? Or do they need a higher voltage to activate? Thanks

#### MrSalts

Joined Apr 2, 2020
2,767
I was able to control a ws2811 strip with a Raspberry pi using Python code directly from 3.3v pins. No need for 5-volt logic.
Connect the 12VDC power to the power pins on the ws2811, connect the ground of the Raspberry pi to the (-) pins of your 12VDC supply and then drive the logic pin of the strip from your pi.

#### noname1234

Joined Feb 20, 2021
8
I was able to control a ws2811 strip with a Raspberry pi using Python code directly from 3.3v pins. No need for 5-volt logic.
Connect the 12VDC power to the power pins on the ws2811, connect the ground of the Raspberry pi to the (-) pins of your 12VDC supply and then drive the logic pin of the strip from your pi.
Really? I‘ve read that you have to feed 12v into all pins in order for it to work.

#### djsfantasi

Joined Apr 11, 2010
9,151
Really? I‘ve read that you have to feed 12v into all pins in order for it to work.
The data pins are logic level and not necessarily Vdd. As long as the LED common is tied to the logic common, it should work.