0

I am an absolute beginner with the Raspberry pi and also know only basic electronics, so please excuse me if this is a very basic question.

I wired my Raspberry pi 4 like this to control an RGB LED.

enter image description here

When I connect everything, and dont configure any of my GPIO pins, the LED still glows very lightly. When I set up all GPIO pins I use to HIGH, the LED goes completely out.

I understand that the LED is out as soon a s I set the GPIO pins to high, because they output 3.3V, so so there shouldn't flow any electricity.

My question here is, why the LED also dimly lights up when I do not configure any GPIO pins. Does this mean that the "default/standard" current of the GPIO pin is something between 0 and 3.3V?

Furthermore, I was wondering if there is a benefit of wiring the LED like this, e.g. HIGH voltage output -> LED goes out.

My amateur intuition would say that it would make more sense to wire it so that a HIGH output would turn the LED on.

Also: is it dangerous to directly connect the 3.3V output with one of the GPIO pins? Should I always include a resistor?

If anyone could answer any of my questions, I would be very thankful!

Cheers!

1
  • Perhaps because all those GPIO's are pulled down inputs unless set otherwise Jan 24, 2021 at 21:53

1 Answer 1

1

This is expected behaviour.

The weak pull-downs may provide sufficient current to glow dimly ~ 50µA.

You could disable pull-downs in your code.

It is normal practice to wire this way.

You would need different LED to use otherwise.

"Should I always include a resistor?" Strictly NO - but you do need some form of current limiting, and this is usually provided by a resistor.

You could use a single resistor in the common anode but this is only effective if lighting LED one at a time e.g. traffic light.

1
  • do you mean pull-downs? Jan 24, 2021 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.