User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

TIP122 and LED strip, ON/OFF is OK, not PWM [SOLVED/WORKS]

Thu Jul 07, 2016 2:48 pm

Hello guys,
I connected a small LED strip (with 30 single LEDs, type 5630) as depicted below:
TIP122_LED-strip.png
TIP122_LED-strip.png (22.68 KiB) Viewed 2205 times
I'm using 9V instead of 12, because the strip lights well anyway (and I'm actually using a TIP122 instead of the 120, because it's what I found).

Exporting the GPIO pin as output and trigging it 1 and 0, turns the strip ON and OFF ... and that's OK. At least I know that the schematics should be OK too.
But I wanted to dim the strip it via PWM. I have the servoblaster library already installed and working for other applications, so I know it works on this Pi. But trying out some GPIO pins with it doesn't seem to light the strip at all

Does anyone see what could be wrong in this design? I also tried removing the resistor or using different pins...

Thanks in advance.
Last edited by dentex on Thu Jul 07, 2016 3:12 pm, edited 1 time in total.
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac

User avatar
Laurens-wuyts
Posts: 716
Joined: Wed Aug 21, 2013 7:35 pm
Location: Belgium
Contact: Website

Re: TIP122 and LED strip, ON/OFF is OK, not the PWM

Thu Jul 07, 2016 2:52 pm

Can you connect a single led (with resistor) to the pin and see if it dims?
If not, there is probably no PWM coming out of this pin.
Can you post your code? :)

Laurens

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: TIP122 and LED strip, ON/OFF is OK, not the PWM

Thu Jul 07, 2016 3:07 pm

Hello.
Do you mean to connect a small 5mm LED with resistor with no external power, through the GPIO pin and use sevoblaster to dim it?

As for the code, i.e. using the last GPIO pin, it's just:

sudo servod --p1pins=40 --cycle-time=5000us --step-size=5us --min=5us --max 5000us
sudo echo 0=50% > /dev/servoblaster

EDIT:
OMG... Forget it... What a NOOBish error (as I am, no doubt): wrong pin numbering, in regards to what servoblaster accepts...

At least this may help someone else in wiring this thing up. :D
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: TIP122 and LED strip, ON/OFF is OK, not PWM [SOLVED/WORK

Tue Jul 12, 2016 3:35 pm

Hello! ...me again.
Quick question: considering a load of 30 LEDs of the 5630 smd type (1 meter long strip, 10 module with 3 LEDs each), would the above circuit work with just a 2N2222A transistor?
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac

User avatar
Laurens-wuyts
Posts: 716
Joined: Wed Aug 21, 2013 7:35 pm
Location: Belgium
Contact: Website

Re: TIP122 and LED strip, ON/OFF is OK, not PWM [SOLVED/WORK

Tue Jul 12, 2016 6:43 pm

I don't think so. The led's can draw up to 150mA per led. This brings the total up to 4.5A for 30 led's.
The maximum current you can switch using a 2n2222a is about 850mA, so a maximum of 5/6 leds.

Laurens

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: TIP122 and LED strip, ON/OFF is OK, not PWM [SOLVED/WORK

Tue Jul 12, 2016 7:03 pm

Great, thanks for your help!!!

:D
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac

Return to “Interfacing (DSI, CSI, I2C, etc.)”