Problem WIth LED and GPIO and TIP-120

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
NaderH
 
Posts: 24
Joined: Tue Sep 03, 2013 8:07 pm

Problem WIth LED and GPIO and TIP-120

Post by NaderH »

I am trying to create a christmas tree lighting project with a raspberry pi, Darlington TIP-120 and a LED (for test purposes - will be replaced with a light strip)
I have PIN 22 of the GPIO going to the base of the TIP-120 via a 4.7kOhm resistor. I am using a 12 volt supply (these are 12 volt LEDs). I have provided a schematic image
The code I am using is very simple. It is listed below, but the LED doesn't light up.
Lighting_Simple.png
Lighting_Simple.png (724 Bytes) Viewed 263 times
any ideas? Is the 3.3V of the GPIO pins to little to trip the TIP-120? is my resistor value wrong?

Code: Select all

import RPi.GPIO as io

io.setmode(io.BCM)

pin = 22

io.setup(pin, io.OUT)

io.output(pin, io.HIGH)
Lighting_Simple.png
Lighting_Simple.png (724 Bytes) Viewed 263 times

User avatar
fierojo
 
Posts: 6
Joined: Wed May 02, 2012 7:32 pm

Re: Problem WIth LED and GPIO and TIP-120

Post by fierojo »

Couple things come to mind. The +12 and ground on the transistor are backwards and you should have a 680 ohm resistor in series with the LED to keep it from frying.

Fierojo

NaderH
 
Posts: 24
Joined: Tue Sep 03, 2013 8:07 pm

Re: Problem WIth LED and GPIO and TIP-120

Post by NaderH »

Thanks for the tip. unfortunately the image was a mistake not that wiring. I was using ExpressSCH for the schematic and I'm a newbie.

The culprit turned out to be a bad GND wire. When replaced, everything worked as expected.

The only issue was I noticed the final program I was running (written in Python) basically runs a While True loop seeking user input.
if the input is LightsOn it turns the LED on. Likewise LightsOff turns the LED off. this works when you run it

however, if you leave it in LightsOn mode for say 8 hours and then Issue a LightsOff, the LED doesn't go off until you exit program.

Any ideas what is causing this?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Problem WIth LED and GPIO and TIP-120

Post by adafruit_support_mike »

Post the code you're using (between CODE tags please) and we'll see if it gives us any clues.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”