L293ne wireing help

controlh-bridgemicrocontrollermotorraspberry pi

First real project in many years so please accept my apologies of this is a silly question.

I want to use the L293 to drive a motor (or 2). Using a raspberry pi which I have done using the add on Gert board for the raspberry pi and the single h bridge it supports.

Now to start with I have

2 X 12v motor.
The raspberry pi needs 5v to power it.
And the Gpio pins on the pi are 3v and what I want to control the motors via PWM.

Question is how to wire up the L293 to the power.

12volt goes to vcc2 to power motors.

But vcc1, should this be 5v or the 3volt from the raspberry pi? Or should I have 5volt to vcc1 and the 3volt from the Gpio pins for control. And what about the grounds? Idealy don't want to be pulling any more from the Pi's 3volt rail than needed.

I'm never sure exactly what the vcc1 is for? To power the l293 circuits? as a reference voltage?

Sure this is a basic question but be greatful for some guidance.

Best Answer

VCC2 is the motor voltage, you got that right.

VCC1 is the logical supply voltage. You would like that to be 3.3V, because that is the level at which you are controlling the chip, but the datasheet specifies a minimum of 4.5V, so you'll have to tie it to 5V.

This means that the logic 1 level are somewhat lower than the chip was designed for, but according to the datsheet it accepts > 2.3V as 1 (with VCC1 = 5V), so it will probably work.