We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

kartable
Posts: 54
Joined: Tue Jun 02, 2020 8:17 am

l293d shield pinout

Fri Jan 22, 2021 10:07 am

Hello,

I will have to drive 2 s90 servo motors in a project and I have purchased a L293d shield for that. Problem is I can't find the pinout to connect to my Raspberry.

The I/O numbers apparently refer to those of an Arduino, but as I have no Arduino and I never had one, it does not help.

Can I use 9 and 10 connected to GPIO 4 and 17 for instance?

Reference 1: https://www.instructables.com/Adafruit- ... hield-Use/
Reference 2 (in French): http://tiptopboards.free.fr/arduino_for ... p?f=2&t=37

pcmanbob
Posts: 13765
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: l293d shield pinout

Fri Jan 22, 2021 10:27 am

If you have purchased the L298D board shown it is specifically design to be plugged directly in to an arduino and is not directly compatible with the pi gpio,

It may be possible to interface it with the pi gpio but it would mean looking up each function of the pins on the board
and then working out if the pi can supply the required interface/signal,

you will also have to do signal level shifting in both directions as the arduino gpio works at 5V were as the pi gpio works at 3.3V and will be destroyed if you connect 5V to it.

So you will probably have to build an interfacing PCB with all the required components on it.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

kartable
Posts: 54
Joined: Tue Jun 02, 2020 8:17 am

Re: l293d shield pinout

Fri Jan 22, 2021 12:41 pm

I did not see it as complicated. A Raspberry can drive one servo motor directly, but here I have 2 so I needed something in between. Would you have suggested something else than a L293d?

Now is it a problem to work with 3.3 V out of the Pi to the L293d? I will probably use 6 or 9 V anyway to the servo motors.

As I said, I don't know Arduino and I can't compare the signals from the Pi. If I install the arduino IDE on the Pi, it should be done easily. Am I wrong?

User avatar
B.Goode
Posts: 18724
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: l293d shield pinout

Fri Jan 22, 2021 12:55 pm

kartable wrote:
Fri Jan 22, 2021 10:07 am

I will have to drive 2 s90 servo motors in a project and I have purchased a L293d shield for that.

How is an H-bridge chip/board necessary or helpful in controlling a servo?
Beware of the Leopard

pcmanbob
Posts: 13765
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: l293d shield pinout

Fri Jan 22, 2021 12:57 pm

The board you have purchased not only controls 2 servos ( which the pi can do directly from the gpio anyway ) but also 4 DC motors or 2 stepper motors which is the L298D bit of its title.

You would not use an L298D to control servos anyway even if you were using the board you have.

The problem is you have purchased an board that is not directly compatible with the pi because its designed to work with an arduino, that's what's making it complicated.

I suggest you do a web search for how to drive a servo using a raspberry pi....

example https://www.youtube.com/watch?v=xHDT4CwjUQE
Last edited by pcmanbob on Fri Jan 22, 2021 1:03 pm, edited 1 time in total.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

ghp
Posts: 4415
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany

Re: l293d shield pinout

Fri Jan 22, 2021 12:59 pm

As kartable already mentioned you can drive a servo direct from GPIO, not needing this board. It will probably help to connect an external power supply for the servo.

The schematic for this specific board is https://cdn-learn.adafruit.com/assets/a ... -schem.png
It matches the image found in your reference.

I would guess that - although logic voltage of the board is 5V - the inputs on the board can be driven by 3.3V GPIO from RPi.

When driving motors, then the following applies:
The board uses a shift register to switch the driver input signals. So you will need to handle the shift operations too. For the shift registers, you need to connect the DIR_EN, DIR_CLK, DIR_LATCH, DIR_SER too

The arduino code for this board is in https://github.com/adafruit/Adafruit-Mo ... d-library/
It will help to match pinouts to the schematics and to understand the shift register.

kartable
Posts: 54
Joined: Tue Jun 02, 2020 8:17 am

Re: l293d shield pinout

Fri Jan 22, 2021 1:05 pm

pcmanbob wrote:
Fri Jan 22, 2021 12:57 pm
The board you have purchased not only controls 2 servos ( which the pi can do directly from the gpio anyway )
[...]
I suggest you do a web search for how to drive a servo using a raspberry pi....
I have already used my Raspberry to drive a servo. That's not a problem... Here I have 2 and I won't drive them directly from my Pi.

User avatar
B.Goode
Posts: 18724
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: l293d shield pinout

Fri Jan 22, 2021 1:08 pm

kartable wrote:
Fri Jan 22, 2021 1:05 pm
pcmanbob wrote:
Fri Jan 22, 2021 12:57 pm
The board you have purchased not only controls 2 servos ( which the pi can do directly from the gpio anyway )
[...]
I suggest you do a web search for how to drive a servo using a raspberry pi....
I have already used my Raspberry to drive a servo. That's not a problem... Here I have 2 and I won't drive them directly from my Pi.



"Here I have 2 [servos] and I won't drive them directly from my Pi."


Why not?

(Knowing what problem you are trying to solve may assist in providing an appropriate solution... )
Beware of the Leopard

pcmanbob
Posts: 13765
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: l293d shield pinout

Fri Jan 22, 2021 1:14 pm

Then I suggest you use an add on board specifically design to drive servos from your pi like this one from pi hut

https://thepihut.com/collections/raspbe ... pi-ada3416
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

kartable
Posts: 54
Joined: Tue Jun 02, 2020 8:17 am

Re: l293d shield pinout

Fri Jan 22, 2021 1:21 pm

pcmanbob wrote:
Fri Jan 22, 2021 1:14 pm
Then I suggest you use an add on board specifically design to drive servos from your pi like this one from pi hut

https://thepihut.com/collections/raspbe ... pi-ada3416
Thanks. That would probably be the best solution if I would stick to using a Pi. But I will switch to a NodeMCU, given that I have one unused in a drawer :)

Return to “Automation, sensing and robotics”