I want to interface 12 dc motor with Raspberry pi 2. I tried by switching the transistor for forwarding and stopping the motor.How can i do it by doing with L293d ic.By giving 12v in L293d vcc2 pin does it affect my pi.please help me in solving the issue.
The Raspberry Pi pins only outputs 3.3V or 5V. If you need to control a 12V device you need to plug it to another power supply (or a power suply with different outputs for 5v and 12v as a standard PC power supply). Then you can control GPIO with WiringPi.