Preator
Posts: 21
Joined: Sat Jun 21, 2014 11:48 am

[Solved]SN754410 not working

Sun Sep 21, 2014 9:30 am

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?
Last edited by Preator on Sun Sep 21, 2014 3:35 pm, edited 1 time in total.

User avatar
joan
Posts: 14674
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: SN754410 not working

Sun Sep 21, 2014 10:30 am

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).

Preator
Posts: 21
Joined: Sat Jun 21, 2014 11:48 am

Re: SN754410 not working

Sun Sep 21, 2014 10:36 am

You can download them

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: SN754410 not working

Sun Sep 21, 2014 10:56 am

Have a look here for a working Arduino example, should be quite straight forward to adapt to the PI.

User avatar
joan
Posts: 14674
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: SN754410 not working

Sun Sep 21, 2014 11:03 am

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).

mikerr
Posts: 2804
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: SN754410 not working

Sun Sep 21, 2014 11:47 am

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
Android app - Raspi Card Imager - download and image SD cards - No PC required !

Preator
Posts: 21
Joined: Sat Jun 21, 2014 11:48 am

Re: SN754410 not working

Sun Sep 21, 2014 1:34 pm

No, it is connected to the 5V of the raspberry pi

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: SN754410 not working

Sun Sep 21, 2014 2:52 pm

Does the motor spin when connected directly to the motor supply (battery pack?) ?

Preator
Posts: 21
Joined: Sat Jun 21, 2014 11:48 am

Re: SN754410 not working

Sun Sep 21, 2014 2:55 pm

Yes

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: SN754410 not working

Sun Sep 21, 2014 3:05 pm

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.

Preator
Posts: 21
Joined: Sat Jun 21, 2014 11:48 am

Re: SN754410 not working

Sun Sep 21, 2014 3:17 pm

Yeah it is because of the pic... but look at the first one. Everything seems to be connected in the right place for me

User avatar
joan
Posts: 14674
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: SN754410 not working

Sun Sep 21, 2014 3:22 pm

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?

Preator
Posts: 21
Joined: Sat Jun 21, 2014 11:48 am

Re: SN754410 not working

Sun Sep 21, 2014 3:24 pm

Which one is the PWM leads?

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: SN754410 not working

Sun Sep 21, 2014 3:27 pm

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

User avatar
joan
Posts: 14674
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: SN754410 not working

Sun Sep 21, 2014 3:30 pm

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.

Preator
Posts: 21
Joined: Sat Jun 21, 2014 11:48 am

Re: SN754410 not working

Sun Sep 21, 2014 3:35 pm

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 !

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: [Solved]SN754410 not working

Sun Sep 21, 2014 3:39 pm

Glad it's sorted, chips need to be flush as the contacts of the breadboard are a few mm below the surface.

Return to “Advanced users”