I'm just a newbie to Arduino. I've been working on a self-propelled robot, following this instruction: http://communityofrobots.com/tutorial/kawal/how-make-your-first-robot-using-arduino. But I got some problem with the power supply.
The first problem is: when I connected Vs leg (number 8) of the L293D to positive of the breadboard (breadboard had two power supply, from 6V battery pack and USB cable), my servo went wrong, it always tried to rotate 360 degrees and stuck, moreover, my sensor went wrong too (measured distance is 0cm at all). But when I disconnected Vs leg from breadboard, the servo and sensor seem normally worked but the motors didn't run (because of leak of voltage, isn't it?)
The second problem is: following the instruction, the sensor has 3 pins (A0, GND and 5V) but my sensor has 4 pins (Vcc, ECHO, TRIGGER, GND). So I don't know how to connect it to analog pins, I tried to connect it to DIGITAL 13 for TRIGGER and DIGITAL 12 for ECHO and it worked.
I don't know how to combine the servos, L239D, sensor and motors with two power supply (5V and 6V batteries)! Can anyone help me? Thanks in advance!
PS: sorry for my bad English, I'm just a first year student :)