Driving a LED using a transistor RPi - Page 1
Forum section: electronics / beginners

author: Ageir
author_rank: Newbie
timestamp: October 04, 2017, 06:35:03 pm
content: Hi!I'm trying to connect a RPi output pin to a monostable multivibrator which is working perfectly.BUT, I'd also like to show the status of the pin with a LED that's switched with a NPN transistor.I followed the following article:https://www.petervis.com/Raspberry_PI/Driving_LEDs_with_CMOS_and_TTL_Outputs/Driving_an_LED_Using_Transistors.htmlThe problem is that the LED and vibrator are connected in parallel which means the transistor circuit is acting as a voltage divider and the whole circuit is not stable.So my question is. How do I calculate the value of the base resistance (RB) properly for this?Any help welcome

author: danadak
author_rank: Super Contributor
timestamp: October 05, 2017, 10:30:16 am
content: Can you post a schematic. Sounds like your LED and vibrator both drivenby same transistor. If that's the case you need to use two transistorsto drive each load separately.Regards, Dana.

author: CJay
author_rank: Super Contributor
timestamp: October 05, 2017, 11:24:02 am
content: Circuit is necessary to make a valid assessment but it sounds like some resistors might be useful here.As Danadak requested, post a pic of your circuit and the lay out of it if you can.

author: Ageir
author_rank: Newbie
timestamp: October 05, 2017, 01:32:20 pm
content: Quote from: CJay on October 05, 2017, 11:24:02 amSorry that I wasn't clear. A schematic coming up. Did some changes since yesterday, added a TXB bidirectional buffer.The schematic isn't complete, but it is not relevant for my problem (i think)The TXB and 4538 are connected properly and working as they should.The problem is when adding the led/transisor I have a problem.RB is acting as a voltage divider, and therefore the voltage input to CLK- is not high enough to be stable.So my question is how do I calculate RB properly, so that the input voltage on the 4538 is stable, and the brightness on the LED is full.Just to clarify. When the B1 --> CLK- is high I want the LED to be turned on.Hope it's clearer now what I mean.

author: xani
author_rank: Frequent Contributor
timestamp: October 05, 2017, 01:42:32 pm
content: TXB0108 does auto-sensing of direction, I'm guessing a transistor might be messing that up. You dont have a scope to poke it when it works ?.Try to connect base resistor BEFORE level translator, you might also bump base resistor to 4.7k, should be enough to drive the led

author: Ian.M
author_rank: Super Contributor
timestamp: October 05, 2017, 02:35:00 pm
content: TXB0108 datasheet:QuoteReplace the transistor with a small N-channel MOSFET e.g. 2N7000 with a 47K gate resistor to isolate its gate capacitance from the TXB0108 I/O pin.so it doesn't count against the TXB0108's 70pF capacitive load rating.

author: lapm
author_rank: Frequent Contributor
timestamp: October 05, 2017, 02:38:49 pm
content: Did yuo use buffer stage as in that article?

author: Ageir
author_rank: Newbie
timestamp: October 05, 2017, 04:54:34 pm
content: Quote from: Ian.M on October 05, 2017, 02:35:00 pmWill try that. Thanks.Skickat från min SM-G950F via Tapatalk

author: Ageir
author_rank: Newbie
timestamp: October 06, 2017, 06:31:21 pm
content: Quote from: lapm on October 05, 2017, 02:38:49 pmnot sure what you mean.