enter image description here

This is an image of how I had it routed up, it was working just fine until I attempted to add a rocker switch.

I used the 2 pin on/off rocker switch that came with my smart car kit (https://www.ebay.com/itm/2WD-Smart-Motor-Robot-Car-Chassis-Battery-Box-Kit-Speed-Encoder-for-Arduino-W7H7/263186900317?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649). I connected the red wire to one of the pins, and another wire to the other pin. The rocker switch was "on" and i connected the wire to the L298N, the red LED flashed and now it wont work anymore.

How i connected my rocker switch


  • 1
    When i google "rocker switch circuit" i see that Ground is connected, is this where i went wrong?
    – Maiki
    Mar 23 '19 at 17:27
  • No idea. You mention two pins but give no clue as to which pins you mean.
    – joan
    Mar 23 '19 at 18:37
  • @joan I am referring to the two pins on the on/off rocker switch, maybe they are not pins?
    – Maiki
    Mar 24 '19 at 15:10
  • So you have two wires coming from the rocker switch. Where did you connect them? Please don't say you connected them to the Pi, or the L298N, where? Which red LED flashed and won't work anymore?
    – joan
    Mar 24 '19 at 15:20
  • @joan The red LED that flashed was on the L298N board. I connected the red wire from the battery pack to the rocker switch, and another wire from the other pin on the rocker switch to L298N +12V input. Added an image, i guess it would be easier if i added it in the original post.
    – Maiki
    Mar 24 '19 at 15:44

It seems your L298N is damaged. A switch can never cause this much problem. Try to power raspberry and the module seperately. You r circuit shows that the power of raspberry is drawn from the module thorugh the regulator on the module.

  • 1
    Ah, let me see. SA noticed that (1) Rpi gets its power from the module's regulator. (2) OP commented that (one end) of rocket switch is connected to ground". Now (2) might mean that the OP carelessly shorted switch to ground (should correctly connect to battery 3V and 298N power input). If my guess is correct, the following might happen: (a) battery connected to ground, therefore runs out power dead, but should not be that "dead" as "ground". So perhaps something is still shorted. I vaguely remember module power input should be 9V to 12V (80% sure). / to continue, ...
    – tlfong01
    Oct 30 '19 at 3:16
  • 1
    So using 3V battery to power to Rpi through 40 pin header's 3v power rail can barely power up Rpi, but when battery is running out, no matter with switch or no switch, Rpi gets power less than 3V and will not work. So I would suggest to replace 3V battery by 6V or 9V, then problem should disappear (20% sure, no harm trying! :)
    – tlfong01
    Oct 30 '19 at 3:21
  • 1
    This tutorial gives more details: projects.raspberrypi.org/en/projects/build-a-buggy/2. The tutorial shows that Vcc is from battery 6V. After regulation, should give 5V for motor. Now if OP's Vcc is battery 3V, then only gives 3V to Rpi, ...:(
    – tlfong01
    Oct 30 '19 at 3:28

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.