Everything seems to indicate that I fried my raspberry pi: the green light wouldn't turn on, I changed the SD card for a new one but it still didn't work. That is a shame because I was having a lot of fun! So I will definitely get another one, but I really would like to understand how it happened first (so I don't make the same mistake again.)

My understanding is that there are 2 main ways of frying it:

  • Using it to power something that requires too much energy (like a motor.)
  • Input more voltage than it can handle to one of its pins.

I have always been aware of that and always tried to be very careful with both things, always double checking and such.

When my Raspberry Pi stopped working I was trying to get this to work:

enter image description here

Before running anything I triple checked the whole connection (which is very simple but I still checked wire by wire more than once) and I'm 100% sure that the ground and the 3 pins (23, 24, 25) were connected correctly.

When it stopped working I had the circuit connected but I wasn't running any code (I did it a few times before it) the code also only has outputs:

import RPi.GPIO as GPIO          
from time import sleep

in1 = 24
in2 = 23
en = 25


In that scenario, what kind of mistake could I have made to have my Raspberry Pi stop working?

I did play with the L298N quite a lot to get to understand it, at some point I even put 24V into it (but when it stopped working I had that aforementioned exact configuration.) Still, can you blow up a Raspberry Pi with everything connected as "output?"

My understanding is that the voltage would never "go in."

Could you guys advise if there are more common "blow up" scenarios that I didn't mention?


To add more clarity based on comments:

  • I was following this tutorial
  • I see people asking why nothing is connected to the +5V of the L298N. My understanding is that the orange wire of the image (connected to the pin 25 on the Raspberry Pi and the "Enable A" of the L298N) would make that unnecessary. In any case I was just following the instructions of the aforementioned tutorial. Could someone clarify where would that +5v be connected and why wouldn't it be mentioned/used in there if it is necessary?
  • I bought my L298N on Amazon.

I have a Raspberry Pi 4 arriving today and would hate to be in the same situation (I sure cannot afford this hobby if I keep breaking them) so I'm reading every comment and suggestion with huge interest.

  • \$\begingroup\$ Why is your +5V on the motor driver terminal not connected? \$\endgroup\$
    – Oldfart
    Commented Mar 21, 2020 at 20:30
  • 1
    \$\begingroup\$ The L298N is an IC and I wonder you played with the IC but rather with the PCB containing this IC. Could you please add a link (in your question using the edit link) to this PCB (or "hat" as the call it (so, not the IC)? \$\endgroup\$
    – Huisman
    Commented Mar 21, 2020 at 20:39
  • \$\begingroup\$ Don't forget that the PI is a bare PCB, so it's relatively easy to short it out with a copper whisker etc. \$\endgroup\$
    – Drew
    Commented Mar 21, 2020 at 20:44
  • \$\begingroup\$ "when it stopped working I had the circuit connected but I wasn't running any code (I did it a few times before it) the code also only have outputs" When you don't run your code, it is not relevant what your code does... because you don't run it... Anyway, pins default to inputs at power up, so, without your code running, they were still inputs \$\endgroup\$
    – Huisman
    Commented Mar 21, 2020 at 20:55
  • \$\begingroup\$ Could you us tell where you got the L298N board or provide us with a picture? If there is a 5 volt regulator on there my answer will probably not apply. \$\endgroup\$ Commented Mar 21, 2020 at 21:33

2 Answers 2


First some back ground information:

From the Raspberry Pi GPIO documentation:

Connection of a GPIO to a voltage higher than 3.3V will likely destroy the GPIO block within the SoC.

From the datasheet of the L298 controller board, you can see that there is a 5 volt regulator on board, and that the 5V connection on the controller board is in fact a 5V output. The 5V output is intended to power the connected Arduino.

The logic levels on the L298 are 5V. The Raspberry Pi uses 3.3V levels, and the documentation warns you that connecting a GPIO pin to more than 3.3V could destroy the GPIO ports of the Pi.

This is already outside of specifications - your tutorial has lead you into dangerous territory without warning you.

Furthermore, the datasheet of the L298 module and the tutorial tell you to remove the "5V enable" jumper if using more than 12V with the L298. That will leave the L298 with no power on the logic circuits - you must in that case provide 5V to the L298 for the logic circuit as well as provide the higher voltage for the motor drives.

If you left the "5V enable" jumper on the module while powering it from 24V, then you might well have killed the 5V regulator on the L298 module. The datasheet of the module says it used an LM78M05 regulator, which should be able to withstand 35V on its input. The warning about the 12V makes me wonder if the manufacturer used a compatible part that can't handle the higher voltage.

Another possibility is that powering the L298 module from 24V without the 5V logic supply allowed 24V onto the logic pins - that would have killed the Pi straight off.

You need to make sure your L298 is OK:

  1. Power the L298 from 12V
  2. Install the 5V enable jumper.
  3. Check that there's 5V on the 5V connector.

If that's OK, then check what voltage is present on the logic pins of the L298 module.

Just power up the module from 12V, and use a voltage meter to measure the voltage on the logic pins on the module. Anything over 3.3V means "do not connect to the Pi."

If the logic pins read zero V when the Pi is not connected, then it should be OK to connect the Pi.

  • \$\begingroup\$ I just did and the voltage in one of the controllers (the one I was using) is like 0.6, the other one with exactly the same power supply correctly shows around 5v, so my guess is that you are correct, at some point I blew up this L298N and it used way too much power from the raspberry pi, which ended up in disaster, could you just clarify for me how to measure the logic pins? do I put black on GND and red on the pin itself? (Sorry if it sounds too silly) \$\endgroup\$
    – pau Fer
    Commented Mar 22, 2020 at 16:59
  • \$\begingroup\$ Yep. Just put black on ground, red on the logic pin, and see what voltage shows up. I don't think you drew too much power from the Pi. I think you forced too much voltage (and therefore current) backwards into the Pi. \$\endgroup\$
    – JRE
    Commented Mar 22, 2020 at 17:06
  • \$\begingroup\$ the pins are showing 0 in the broken L298N and around 0.2 en the one that seems to be working fine, but again that broken one is showing 0.6 on the 5V connector while the other one is showing 5V so there is definitely something wrong with that first one. thank you for your time JRE \$\endgroup\$
    – pau Fer
    Commented Mar 22, 2020 at 17:13

As Oldfart mentioned, the datasheet reveals that the +5v is not optional; it is the logic supply of the L298 chip. It is very likely that your raspberry pi was sinking/sourcing way more current than it could handle.

The datasheet does not define the behavior of the chip when the logic supply is not connected but I think it's safe to assume that this caused your RPi to let out the magic smoke.

  • 1
    \$\begingroup\$ The datasheet of the L278N shows the connected pins are gate inputs. If the Raspberry PI pins were configured as outputs, no harm can be done as the L278N allows an Input and Enable Voltage of –0.3 to 7 V. So, it is not likely the PI was "sinking/sourcing way more current than it could handle" \$\endgroup\$
    – Huisman
    Commented Mar 21, 2020 at 21:18
  • \$\begingroup\$ The typical L278N board has a 5V voltage regulator. It is configured with a jumper and can be used if the motor voltage does not exceed 12V. So the 5V input does not need to be connected. \$\endgroup\$
    – Codo
    Commented Mar 21, 2020 at 21:26
  • \$\begingroup\$ The L298 chip expects a logic supply and has undefined behaviour if this is not supplied. That makes the -0.3 to 7 V input point moot. \$\endgroup\$ Commented Mar 21, 2020 at 21:28
  • \$\begingroup\$ Perhaps the typical board has a 5V voltage regulator, but it is unclear whether that applies here. Furthermore from the given information I would say that this seems to be most likely point of failure as the rest of the setup seems appropriate. *Edit: seems like it would be a good question to ask OP for pictures of his board \$\endgroup\$ Commented Mar 21, 2020 at 21:29
  • \$\begingroup\$ I seriously doubt. Wouldn't the absolute maximum ratings be defined like like -0.3V ... Vss +0.3V?. \$\endgroup\$
    – Huisman
    Commented Mar 21, 2020 at 21:37

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.