Hello guys I am currently working on a project. and I would like to turn on a GPIO pin when my LED on the circuit below turns on. I'm lost to where I should tie my input GPIO pin. please help. Thanks!
Asked
Active
Viewed 1,025 times
1
-
I don’t know where you got this but it is unlikely to work – Milliways Apr 23 '19 at 03:59
-
@Milliways I made it my self. So it is not possible to control a GPIO using a transistor switch? – Rikku Apr 23 '19 at 04:04
-
I don’t know what you are actually trying to accomplish. Are you trying to use GPIO to turn LED on? – Milliways Apr 23 '19 at 04:06
-
No. What I am trying to achieve is.. I would like to use the NPN transistor as switch for turning on GPIO Pin – Rikku Apr 23 '19 at 04:15
-
And what is supposed to turn the LED on? – Milliways Apr 23 '19 at 04:18
-
@Milliways Nope.. Just to detect the signal coming from transistor – Rikku Apr 23 '19 at 04:19
1 Answers
2
Question
How to use a NPN transistor to "turn on" a Rpi GPIO pin?
Answer
Ah, you cannot "turn on" a Rpi GPIO pin. She won't listen to you, but you can ask her to behave as input or output! :)
In geek English:
A Rpi GPIO pin can be in "input mode" or "output mode".
An "input" pin can input/read a signal which can be High or Low.
An "output" pin can output/switch a LED, eg, High to switch on, Low to switch off, (or vice versa, depending on circuit).
I have drawn a circuit showing how to convert a loud (5V) signal to a soft (3V3) signal. The fair lady prefers a soft voice - loud voice can kill her! :)
/ to continue, ...
References

tlfong01
- 4,665
- 3
- 10
- 24
-
-
I followed your digram above but it seems that I am not getting the expected output. – Rikku Apr 23 '19 at 07:34
-
Ah, perhaps you use the wrong resistors - not any resistor will do! Is the left most box working? – tlfong01 Apr 23 '19 at 07:41
-
yep it worked fine.. I replace it with another base voltage as trigger.. this is still somehow connected to the pump I ask about in the other question.. What I did was I used the voltage across the pumps wires run it throug a voltage divider circuit with 3V output and connected it to the transistor base as trigger. what resistor values should I use. – Rikku Apr 23 '19 at 07:53
-
I am confused. Perhaps you can update your question with a schematic. – tlfong01 Apr 23 '19 at 08:27