In this experiment, we connect the Raspberry Pi’s GPIO pin 17 to the anode (long pin) of the LED, then the cathode (short pin) of the LED to a resistor, and then connect the other end of the resistor to the GND pin on the Raspberry Pi. To switch on the LED we need to set GPIO17 to high (3.3V). We can get this phenomenon by programming.
The only way I can get the LED to light up is to hook the cathode to pin 17 and the anode to the resistor…
And then, when I attempt to run the code for the program, it fails to blink on and off. I double checked to make sure everything is connected properly, that I am using the right resistor and that the GPIO plug is actually connected correctly to the rpi 5.
The strange thing is, nowhere on the page does the tutorial address the part of the instructions that mentions, “To switch on the LED we need to set GPIO17 to high (3.3V). We can get this phenomenon by programming.” I noticed in the rpi 4 version of this experiment, there is a wire connected to 3v3.
Summary: I think you’ve accidentally connected the end of the resistor to 3V3 not GND
My rationale:
Both circuit diagrams are correct.
The RPI4 circuit uses the 3V3 as a current source and the GPIO as a current sink. Whereas, the RPI5 circuit uses the GPIO as the current source and the GND as the sink.
Therefore:
Setting the GPIO high on RPI4 should turn the LED off, setting it low should turn it on
Setting the GPIO high on RPI5 should turn the LED on, setting it low should turn it off.
Quote: “The only way I can get the LED to light up is to hook the cathode to pin 17 and the anode to the resistor…”
This is then the same as the RPI4 wiring: If your LED lights in this case, then the “other end” of your resistor must be connected to the 3V3 as per the RPI4 schematic, but for the RPI5 variant it needs to be connected to gnd.
In the following I always have the current flowing from left to right
RPI4
3V3 → Resistor → Anode → cathode → GPIO
RPI5
GPIO → Anode → cathode → Resistor → Gnd
Your “debug” wiring with “lighting LED” as quoted above
3V3 → Resistor → Anode → Cathode → GPIO
So the GPIO is providing the GND as per RPI4, and lights up
So I thnik that your wiring with “non lighting LED” must then be like this
GPIO → Anode → cathode → Resistor → 3V3 (current would have to flow from Cathode to anode for LED to light, but it cannot through a diode)
but it should be this
GPIO → Anode → cathode → Resistor → Gnd
Hopefully I’ve interpreted this correctly and it can help you!
wow! That was thorough! I had to disassemble what I had wired so I will try it again, this time paying more attention to where I connect the resistor. I have a new pi 4 to try on. I got it because more of the kit works with pi 4 and it doesn’t hurt to have a spare pi for when I get into making projects with them. Thank you so much for your diagnosis! I will let you know if I have more problems
Doesn’t this indicate the resistor is supposed to be connected to 3V3? I’m sorry if this is a stupid question but that’s what it looks like to me. I’m BRAND new to this. So I apologize.
Also, why does the diagram have a line going horizontally from 3V3 and then one jutting out to the right? Am I supposed to stick another cable in that one hole where they meet? I tried and it doesn’t seem possible. So I must be misinterpreting the diagram. I’m referring to the left circle in the diagram that I circled.
I tried to upload a picture of my breadboard but it won’t let me post more than one picture at a time.
Again, I’m confused by the second part of your question, I don’t own this board so I can’t check, but there is no hole at the wires junction, so I’m not sure where you are trying to connect your wires