Page 1 of 1

[Solved]SN754410 not working

Posted: Sun Sep 21, 2014 9:30 am
by Preator
Hello,

I'm simply trying to drive a motor in one direction for the moment, to test my SN754410 H-bridge, but it doesn't work.

Here is how the motor and my H-Bridge are connected :

Image

Image

And here is my python code :

Code: Select all

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

motor1p = 17
motor1n = 27

GPIO.setup(motor1p, GPIO.OUT)
GPIO.setup(motor1n, GPIO.OUT)

time.sleep(0.1)

GPIO.output(motor1p, GPIO.LOW)
GPIO.output(motor1n, GPIO.LOW)

time.sleep(0.5)

GPIO.output(motor1p, GPIO.HIGH)
GPIO.output(motor1n, GPIO.LOW)


time.sleep(2)

GPIO.cleanup()
But nothing happens and there is no warning when I launch it.
What did I do wrong?

Re: SN754410 not working

Posted: Sun Sep 21, 2014 10:30 am
by joan
The photos are too small to make out any detail.

If you resize them to something like 600x400 and save then with 80% or so quality they may get under the 64KB barrier. You could also use jhead -purejpg on a Linux system to strip the jpeg header to a minimum (that can strip out 20KBs of junk).

Re: SN754410 not working

Posted: Sun Sep 21, 2014 10:36 am
by Preator
You can download them

Re: SN754410 not working

Posted: Sun Sep 21, 2014 10:56 am
by asandford
Have a look here for a working Arduino example, should be quite straight forward to adapt to the PI.

Re: SN754410 not working

Posted: Sun Sep 21, 2014 11:03 am
by joan
If they are remotely hosted I think you can set the display size within your post to make them bigger on screen.

I can't see anything wrong. You could double check that you are using gpios 17 and 27 (pins 11 and 13).

Re: SN754410 not working

Posted: Sun Sep 21, 2014 11:47 am
by mikerr
You should have 5v connected on the motor enable pin ( I think you have it connected to ground from looking at the first picture)

Image

Re: SN754410 not working

Posted: Sun Sep 21, 2014 1:34 pm
by Preator
No, it is connected to the 5V of the raspberry pi

Re: SN754410 not working

Posted: Sun Sep 21, 2014 2:52 pm
by asandford
Does the motor spin when connected directly to the motor supply (battery pack?) ?

Re: SN754410 not working

Posted: Sun Sep 21, 2014 2:55 pm
by Preator
Yes

Re: SN754410 not working

Posted: Sun Sep 21, 2014 3:05 pm
by asandford
The second pic appears to show the the motor supply connected to nothing and the chip is one hole higher up the board than the wiring.

Re: SN754410 not working

Posted: Sun Sep 21, 2014 3:17 pm
by Preator
Yeah it is because of the pic... but look at the first one. Everything seems to be connected in the right place for me

Re: SN754410 not working

Posted: Sun Sep 21, 2014 3:22 pm
by joan
I'd remove the PWM leads from the Pi and connect one to ground and the other to 3V3 and then 5V. Does that activate the chip?

Re: SN754410 not working

Posted: Sun Sep 21, 2014 3:24 pm
by Preator
Which one is the PWM leads?

Re: SN754410 not working

Posted: Sun Sep 21, 2014 3:27 pm
by asandford
Blown the pic up and the chip seems to be 'riding high', push it flush to the breadboard (bend the pins 90 degrees to the chip if need be).

The channel in the breadboad allows you to get something under the IC to remove it (preferably an IC extraction tool, or failing that a small screwdriver), so it's a good idea to plug them in a few holes up from the end

Re: SN754410 not working

Posted: Sun Sep 21, 2014 3:30 pm
by joan
Preator wrote:Which one is the PWM leads?
The yellowish leads connected to gpios 17 and 27. The ones which you are trying to switch from the Pi.

Re: SN754410 not working

Posted: Sun Sep 21, 2014 3:35 pm
by Preator
Great ! Thanks to asandford, I realized the bridge was not correctly connected to the breadboard (I didn't want to force it, but it really has to "clip" in it)

Thank you everyone !

Re: [Solved]SN754410 not working

Posted: Sun Sep 21, 2014 3:39 pm
by asandford
Glad it's sorted, chips need to be flush as the contacts of the breadboard are a few mm below the surface.