10

As a newbie to the Raspberry Pi and electronics in general, I would like to start hacking around with the GPIO pins but any tutorial around the Internet warn me about frying the Pi one way or the other. I would like to know what are the bare minimum precautions and safety measures to be taken while using the GPIO pins so that I can reduce the chances that I would fry the Pi. I have taken a look at the GPIO documentations on the RPi site (http://www.raspberrypi.org/documentation/usage/gpio/). The only thing mentioned was

If you follow the instructions, then messing about with the GPIO is safe and fun. Randomly plugging wires and power sources into your Pi, however, may kill it. Bad things can also happen if you try to connect things to your Pi that use a lot of power; LEDs are fine, motors are not.

In that case, what would be the things NOT to connect to the RPi and what are the possible "bad things" that can happen?

  • those pins are like 40mu amps watch out not to drive too much current through them! – j0h Oct 17 '14 at 21:05
4

It is reasonably safe if you are sensible. The MOST IMPORTANT thing is NOT to connect anything >3.3V to a pin. Make sure you don't connect the 5V!

In general you should avoid making connections with the Pi running (at least until you get more experience).

You should try running a LED (through a resistor - say 470Ω). Connecting push buttons is pretty safe (using a 1KΩ series resistor is a good idea).

If you look at The MagPi magazine http://www.themagpi.com/ you will find lots of examples.

  • RE MOST IMPORTANT - This includes static and inductive spikes – John La Rooy Nov 17 '14 at 8:33
  • Could be more elaborate? Also, I was not talking about the safety of the components. I was talking about how to safely use the Pi's GPIO without damaging it – gokul_uf Nov 18 '14 at 9:35
4

To further elaborate on the why not for some of the things:

  1. don't plug in an electric motor directly: controlling one is fine, but if it is connected directly, the Pi has nowhere near enough power to run it, and can be destroyed if the motor is spun and acts like a generator, sending power into the pi.

  2. don't plug stuff in while the pi is running - while this can be done, the reasons to avoid this are to make sure you know the state of the GPIOs before connecting stuff to them. It also gives you time to spot mistakes before sending power and potentially breaking stuff.

  3. Don't plug anything with a high (or negative) voltage - the GPIOs are binary and consider 3.3 as "on" - any higher and you will damage the pi. They also take 0 as "off" - any lower and you can damage the Pi again.

  4. power sources - the Pi is not meant to be powered via GPIO, and you bypass the protection polyfuse if you do this - a signal (reduced via a resistor) would be OK.

what you CAN plug in:

  1. control electronics such as transistors (that get their power from elsewhere)

  2. Diodes (low power displays) + a resistor to limit the current

  3. switches + a resistor to limit the current and pull it up/down

if you want to use:

  1. a lightbulb, motor, etc. use a transistor to drive it - for a higher power one, use a transistor to drive a relay to power it.

  2. an analogue input - use an analogue to digital converter (or build one)

1

When you're quite new to electronics, maybe a software simulator to simulate what the electronics would be doing is a good idea. Like user @user2813274 said, its about:

  • the maximum amount of current flowing
  • the voltage levels involved

I found a nice website, where you can fiddle around with electric components and measure the voltage and current going through the leds and switches etc. It even visually shows the voltage and current flow.

This site has a free opensource download. it's a zip file which contains a java program. if you unzip it and doubleclick the .jar file, the simulator apears. Pretty advanced electronics can be simulated as well. This is the site: http://www.falstad.com/circuit/

i'm not sure how much you're into electronics. How a LED works for example; it only allows current to flow in one direction(that direction in which it lights up), but there's a minimum voltage required to get the current flowing. some are 1.7V but there's even LEDS with to 3 Volts. Since the current flowing is dependant on the voltage applied, you could let it conduct so much that the flowing current is essentially a short-circuit(i.e. infinite current). That's why there's resistors involved in switches and LED's.

Have fun

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.