I have received a RPi 3 kit as a gift with tons of sensors, cables, resistors, etc.

I have managed to get the typical LED demo working by following literal instructions but I don't understand how to e.g. connect of the sensors.

How do I know which resistor to use, and to which GPIO pins to connect them?

  • 3
    Welcome to Raspberry Pi! Please take the tour and visit the helpcenter to see how things work here. This question is pretty broad and thus likely a bad fit for Stackexchange. However I would like to recommend to check the MagPi for some inspiration and plenty of tutorials. Really worth a look! – Ghanima Aug 28 '17 at 19:23

To calculate the resistor you need to know some parameters regarding the LED.

Normally a red LED has a forward voltage of approx 2volt and a current of 20mA and the output from the Raspberry Pi is 3,3volt.

This means that 1,3volt (Raspberry voltage - LED voltage) and 20mA is the values for the resistors. then lets take 1,3v/0,02A = resistor (65ohm).

And what GPIO pin to use, well that's up to which pin you fancy in the programming.

Take a look at this video series, that will explain a lot: https://www.youtube.com/watch?v=OR5h0UnMcUE

Table for LED,voltage vs. color


  • There is also a some well written books, search for "electronics for makers" – MatsK Aug 28 '17 at 19:17
  • Thank you, those are the figures I was looking for to get started. – Bob Dem Aug 28 '17 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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