L298 RasPi GPIO - Not working

Discussion in 'The Projects Forum' started by Gnasher, Apr 11, 2014.

  1. Gnasher

    Thread Starter New Member

    Apr 11, 2014
    Hello all,

    As a novice to electronics, I decided to make a circuit which could be controlled by the GPIO pins on my Raspberry Pi.

    My thinking was to opt for the L298 IC rather than make 2 H-bridges following the circuit featured under "Using an H-bridge chip" here and then following Søren's recommendation to remove the 2 grounding resistors (on what appears to be the same circuit) posted here.
    Please see the attached thumbnail, which seemed conducive with the circuit featured in my first link, though I didn't include any capacitors or resistors - what are these here for?

    I wired one input pin (IN1) to GPIO17, and grounded the Pi against the circuit. I used the same 5volts for both the Supply Voltage and Logic Voltage - not drawn from the Pi, but rather a Molex power supply.
    For some reason I can't get PWM to work on my GPIO header, though I'm not certain if there is a greater underlying problem with the circuit, though I am curious if there is a way to just run the motor at full power without using any PWM circuitry?

    My final, and probably densest remarks, are that I don't understand how power doesn't shoot straight across the diodes and bypass the motor altogether, and how any power going towards the motor from the OUTn pins doesn't also take this route?

    Thank you very much in advance for your patience and time reading this, I look forward to any comments or suggestions you may have.
  2. FuzzballJack

    New Member

    Apr 12, 2014

    I have some remarks for you on this project.
    The diodes are there to disable the reverse currents the solenoids in your engine will generate when deprived of power. When a solenoid is cut off from its power it will try to counteract this with a negative spike. The diodes dissipate this.


    If you look closely the diodes are (how do you say this in English) set up to be blocking the regular current/set up in reverse. But reverse current will pass. Be sure not to rotate the diodes or there will be fireworks :) .

    Now. There is a way to test the setup without the PWM. Try this setup.


    Disengage pin 10, 11 and 12 from the PI circuit. Supply HIGH signal to 11 and HIGH 10 and LOW 12. It should run!

    Let me know if this test was successful.
  3. FuzzballJack

    New Member

    Apr 12, 2014

    One last remark ...
    I read the post from Søren you linked to. Indeed the resistors are not needed, ... BUT(!) the value of your's is to big. I have checked the datasheet and they use 0.5 ohms for their setup. https://www.sparkfun.com/datasheets/Robotics/L298_H_Bridge.pdf see page 8! And ... why use 2 resistors if you only use one ouput? Cheers!