nospace
Posts: 1
Joined: Fri May 22, 2020 5:02 pm

Issues with on/off-ing 12v led strip

Fri May 22, 2020 5:30 pm

Hi everyone,

I am new both to the forum and electronics in general, and been stuck on a simple project for days now. I would be very happy to get some help from you and learn what I am doing wrong.

The idea of the project is to power on an LED-strip (12V, external power supply) when motion is detected. I am using a PIR sensor for that purpose. In order to keep things simple however and remove as many parts as I can for an initial MVP, I am ignoring the PIR completely for now and only using the output of GPIO 24 (which I can manually PWM via terminal). I tested this, and indeed I am able to get ~3.3 volts out of GPIO 24.

This is an image taken from the web which shows what I am trying to do. With the mention of course that I am not using a battery and instead of the PIR sensor, I use GPIO 24 output and connecting their grounds.
https://screen.sh/cAaSbZiM

I have initially tried to use a IRLB8721 mosfet, which is logic and n-channel however found out that my GPIO voltage might not be enough to make the switch. I then tried to look for something more suitable and the best I could find is IRF3205, however, this also seems to be a bad choice.

I also have a couple of 2n3904 transistors available, but now sure how I can make this work.

worth mentioning that when using the IRLB8721, the led strip is fully on, regardless of the gate input voltage. Also, I did make sure not to mix up the drain/source of the mosfet

Please help me understand what I am doing wrong and whether there is anything i can do to fix this with the components I currently have...
Thank you! :)

pcmanbob
Posts: 9033
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Issues with on/off-ing 12v led strip

Sat May 23, 2020 12:52 pm

Hi.

You should be able to drive the IRF3205 using the gpio, as it has a gate voltage of less than 3v.

The circuit would look like this assuming you just want to switch the power to the LED strip and not actually provide any control signals to it.

Image

Image

and you don't need to apply a PWN signal to gpio24 to turn the IRF3205 on , just a simple high will turn it on and low will turn it off.
worth mentioning that when using the IRLB8721, the led strip is fully on, regardless of the gate input voltage
this suggests to me that you had it connected wrong.

the circuit for the IRLB8721 would look like this.

Image
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Brandon92
Posts: 829
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Issues with on/off-ing 12v led strip

Sat May 23, 2020 8:54 pm

pcmanbob wrote:
Sat May 23, 2020 12:52 pm
the circuit for the IRLB8721 would look like this.

Image
Just a question about the gate resistor. Why did you chose such high value for the gate resistor? Those values result in that the gate voltage is 1,8V.
nospace wrote: worth mentioning that when using the IRLB8721, the led strip is fully on, regardless of the gate input voltage. Also, I did make sure not to mix up the drain/source of the mosfet
It could be possible that you damaged the MOSFET with by touching the connection of the pins. This is due the ESD damage, or it damaged by connection it wrong or it was a bad one ;p

The IRF3205 has a maximum gate threshold voltage of 4V. So it could be possible that it will not turn on with the Rpi. And the IRF3205 has a maximum threshold voltage of 2,35V so it could be driven by the Rpi with the right gate resistors.

Do you have a multimeter? Then you can measure the MOSFET if it is broken or not. Take the MOSFET out of the circuit and set then multimeter in diode mode. And measure the drain and source of the MOSFET in both directions. And report what you measured :)

pcmanbob
Posts: 9033
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Issues with on/off-ing 12v led strip

Sun May 24, 2020 7:59 am

Just a question about the gate resistor. Why did you chose such high value for the gate resistor? Those values result in that the gate voltage is 1,8V.
From the data sheet the typical gate voltage is 1.8V so that's why I select those particular resistances.

Image


and the IRF3205 has a gate threshold voltage of 2V min to 4V max so the 3.3V of the pi gpio should be able to turn it on.

Image
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Brandon92
Posts: 829
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Issues with on/off-ing 12v led strip

Sun May 24, 2020 10:16 am

pcmanbob wrote:
Sun May 24, 2020 7:59 am
From the data sheet the typical gate voltage is 1.8V so that's why I select those particular resistances.
I would recommand that the gate is driven with the highest voltage possible (but lower than the maximum gate voltage). This ensure that the MOSFET RDSon will become lower with the higher voltage. And the I would always drive the MOSFET with the maximum gate threshold voltage to ensure that it will turn on in every situation.
pcmanbob wrote:
Sun May 24, 2020 7:59 am
and the IRF3205 has a gate threshold voltage of 2V min to 4V max so the 3.3V of the pi gpio should be able to turn it on.
It might not be turning on if the IRF3205 threshold voltage is 4V of that particular MOSFET.

Return to “Beginners”