1st circuit

So when I had all wired as depicted in the first image, it worked fine, no problems. The red LED on the L298N board was illuminated and the dc motor was following commands from my Raspberry Pi.

Where it all went wrong

Now I tried to add an SPST on/off rocker switch to the circuit, and this is where my L298N stopped working. I connected the SPST switch as depicted. When the switch was set to off nothing happened, as I would expect. When I toggled the switch to on, the red led on my L298N flashed, and that was the last time it did. I can confirm that is not only the LED that ceased to function, due to the fact that the DC motor won't respond when I recreated the circumstances of when it was functioning.

Other variables/variations: I was using 4x AA batteries in both cases, however, I used a thicker wire to connect the SPST switch to the L298N than I did in the first situation/image, when it was working.

In the second case, I did not have the wire properly connected to the L298N, I just touched the screw of the L298N wire connection.

The Raspberry Pi was not connected to power in the second case, however, if i remember correctly, it was in the first.

How come my L298N stopped working? I am new to electronics and I would like to learn from this experience.

  • \$\begingroup\$ An L298 or L293 or any Darlington bridge is a horribly lossy part that will barely work on four cells on a good day. It is not appropriate for your project, you likely want an FET bridge, or else you will need more cells in the pack just to overcome the losses. Also, a raspberry pi is probably not a good choice for motor control, especially not in anything that is itself mobile. \$\endgroup\$ – Chris Stratton Mar 25 at 18:13
  • \$\begingroup\$ Alright, thanks for the input and guidance. I've been looking into getting an Arduino, although I am not familiar with C. The only language I am proficient in is JavaScript, which is why I like the Raspberry Pi, as it allows me to program in a language I know. \$\endgroup\$ – Maiki Mar 25 at 18:19
  • 1
    \$\begingroup\$ Makecode and Espurino are both attempts to support simple javascript programming on an MCU (generally targeting those a step or two up from an Arduino, but not more expensive and every bit as suitable for a mobile robot), but such frameworks typically have limitations so it's worth learning about traditional languages too. Syntax isn't all that different, but strong typing will be a new and important subject. \$\endgroup\$ – Chris Stratton Mar 25 at 18:28

Your Answer

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

Browse other questions tagged or ask your own question.