raspberry akash
Posts: 18
Joined: Fri May 20, 2016 7:06 am

software pwm external source

Mon Jun 20, 2016 10:42 am

Hi,
I am using raspberry pi 3 and an external source of 12v to pwm RGB LED strip using transistor PN2222 6E .But when I connect the external source to transistor and LED is remains ON all the time irrespective of the GPIO output connect to base of transistor and emitter grounded and collector with LED. Also I common grounded extrernal source with raspberry pi. Does anyone know what is the problem.

User avatar
Jednorozec
Posts: 809
Joined: Sun Nov 24, 2013 2:17 pm
Location: Deposit, NY

Re: software pwm external source

Mon Jun 20, 2016 11:12 am

What happens if you connect a single LED in series with a resistor instead of the transistor to the pin that you're using?
The most important leg of a three legged stool is the one that's missing.
It's called thinking. Why don't you try it sometime?

raspberry akash
Posts: 18
Joined: Fri May 20, 2016 7:06 am

Re: software pwm external source

Mon Jun 20, 2016 2:07 pm

Jednorozec wrote:What happens if you connect a single LED in series with a resistor instead of the transistor to the pin that you're using?
Then it works fine but I have to control a 12v Led strip hence i am using transistor and an external source

gordon77
Posts: 5036
Joined: Sun Aug 05, 2012 3:12 pm

Re: software pwm external source

Mon Jun 20, 2016 2:11 pm

Have you got a drawing and photo you could show us of what you have wired ?

raspberry akash
Posts: 18
Joined: Fri May 20, 2016 7:06 am

Re: software pwm external source

Tue Jun 21, 2016 7:00 am

raspberry akash wrote:
Jednorozec wrote:What happens if you connect a single LED in series with a resistor instead of the transistor to the pin that you're using?
Then it works fine but I have to control a 12v Led strip hence i am using transistor and an external source

Ahh my bad...without transistor it works fine but with transistor its always ONN

raspberry akash
Posts: 18
Joined: Fri May 20, 2016 7:06 am

Re: software pwm external source

Tue Jun 21, 2016 7:12 am

gordon77 wrote:Have you got a drawing and photo you could show us of what you have wired ?

https://www.google.es/imgres?imgurl=htt ... mrc&uact=8

User avatar
Jednorozec
Posts: 809
Joined: Sun Nov 24, 2013 2:17 pm
Location: Deposit, NY

Re: software pwm external source

Tue Jun 21, 2016 7:23 am

That is what you are copying from, not what you have wired. If you're using bipolar transistors instead of MOSFETs, the pinout is totally different and you need a resistor in series with the base.
The most important leg of a three legged stool is the one that's missing.
It's called thinking. Why don't you try it sometime?

raspberry akash
Posts: 18
Joined: Fri May 20, 2016 7:06 am

Re: software pwm external source

Tue Jun 21, 2016 11:29 am

Jednorozec wrote:That is what you are copying from, not what you have wired. If you're using bipolar transistors instead of MOSFETs, the pinout is totally different and you need a resistor in series with the base.

Now with Mosfet its working but the PWM is not accurate. I know one leg is missing thats why I am asking in the forum otherwise I wouldnt have asked in the first place

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: software pwm external source

Tue Jun 21, 2016 11:48 am

"One leg is missing"

What?

Without an accurate circuit diagram, including part numbers, of what you have actually constructed nobody can help you. Or perhaps a clear photo.
Memory in C++ is a leaky abstraction .

Return to “General discussion”