help reconstructing blinking LED circuit that required GPIO #17 pin low rather than high

I am working through a series of lessons on using the Raspberry Pi 3 Model B with the Osoyoo Raspberry Pi Starter Kit. The first lesson is to build a simple circuit in which GPIO #17 is used to power an LED off and on by toggling the pin low to turn the LED off and high to turn the LED on. A 200 ohm resister is part of the circuit. The lesson is available on the Osoyoo web site, Raspberry Pi Starter Kit Lesson 3: Prepare GPIO Tool-WiringPi Utility.

For the program itself I used C with the wiringPi library to access the GPIO board.

The first time I did the circuit and the program the LED would turn on when the pin was low and turn off when the pin was high. The LED was also very dim and the lit phase was difficult to see without cupping my hand around the LED to make the lighting more visible.

I retried that circuit and now the LED is much brighter and I had to change the program so that the LED is lit when the pin is high and the LED is off when the pin is low. This is the way it is actually supposed to work with the high pin providing 3.3v to the LED circuit to light the LED when the pin is set to high.

So now I am curious about the first circuit that I did and where my mistake was.

I assume that I had some kind of LED polarity problem along with some mistake in the circuit so that when the pin was high the LED was driven to be off. And I assume that when the LED was dimly lit by the pin being low it was due to induced currents with the pin floating because I did not have a pull down resistor to zero it out.

Can someone tell me an LED with 200 ohm resistor circuit that would give the previous behavior?

To make an LED light up when you pull pin 17 low use the following circuit:

3.3 volt -> resistor -> LED -> pin 17

alternatively, you could place the resistor after the LED:

3.3 volt -> LED -> resistor ->pin 17

As to why the LED was so dim, I can only guess but the most likely explanation is that you used a resistor with a value much greater than the stated 200 Ohms. You can confirm this by swapping out the 200 Ohm resistor for larger and larger values and you will see it get dimmer and dimmer (though this will likely not be visible at values close to your 200 Ohm starting point. Do not use a resistor rated less than your 200 Ohm starting point as this may destroy the LED and potentially damage your Pi.

• Ok, so you surmise that I had connected the 3.3v power pin into my circuit? The LED was very dim and the resistor was a 200 ohm resistor from the Osoyoo kit. I used the same resistor when I tried it again when it operated correctly. However I am not sure if I used the same LED since I put the LED back into the plastic baggie with the others. The LED was definitely dim in the first trial. In other experiments with a standalone power supply with a similar circuit and a larger value resistor the LED was definitely dimmer. Nov 19, 2017 at 13:05
• @RichardChambers You might have used the 5 volt pin instead of 3.3 Volts, but that wont make a real difference here. one other option for why the LED was dim is that you used something other than a red led. Nov 19, 2017 at 13:09
• Tinkering around this afternoon I ended up with the same condition using a 200 ohm resistor though pulling power from the 3.3v rail. The LED was dim and not bright. I am wondering if there is some other resistance in the circuit when going from 3.3v power pin to GPIO #17 with a red LED and a 200 ohm resistor and then doing a LOW on GPIO #17 to turn the LED on. See the mention of pull-up and down 50K ohm resistors on GPIO pins here wiringpi.com/reference/core-functions Nov 20, 2017 at 0:30
• @RichardChambers More likely you have a bad led. You can confirm by making the last connection to a ground pin rather than pin 17. Nov 20, 2017 at 0:31
• No the LED is not bad as once I changed the circuit it was bright as normal. I think there is still too little information to come up with an answer at this time. Nov 20, 2017 at 0:32