raschemmel:
do you know how to measure current ?
I think so, from my measurement, the current across the motor terminal is 0.28-0.3A(Motor requires 0.3A) and the voltage is a bit weird. I set the multimeter to 20V DC and sometimes the value varies around 0.2-0.32 and sometimes it goes up to 0.7(And my motor required 3V-6V, so I think this is the problem?). I tried adding an external power source but it's still not running, I'm not sure if it's because the contact of the wire and the battery is loose or the battery isn't supplying enough voltages/current. I didn't have enough hands to press the wire to the battery and measure the current and voltages of the motor so I didn't measure it. I tried with 9V battery, 9V battery + LM7805 5V voltage regulator, 4 x 1.5V AA battery(3 of the battery only have 1.1-1.2V left in it but I measured and the total voltage the battery pack is supplying is 5V). Again I was just holding the wires to the battery pack's terminals
DuaneDegn:
Hey guys, while many h-bridges require two separate power supplies for the logic and the motor, the L293D just needs the motor supply to be equal or greater than the logic voltage. The motor voltage does not have to be higher than the logic voltage.The chip should work when powered with 5V.
My main concern about his setup is the motor is being powered of the computer's USB.
When you add an external supply, make sure to remember to connect the grounds from the two lines together.
One thing I often suggest when people are using a new h-bridge is to test the h-bridge without a microcontroller to make sure you understand the signal logic.
Here's my "L298N" video. The L298N and the L293D use the same control logic.
One reason the L293D chip could be getting hot is because you're using use PWM to reduce the power. You're running the motors full on. These chips can get hot from normal use so if you have the motor running full blast, it's not too surprising the chip is getting hot.
When you're ready to use PWM you'll likely have a cooler chip if you pulse the enable pin rather than a direction pin. If you use PWM on a direction pin the motor alternates between being powered (during the high part of the pulse) and braking (low part of the pulse). If you pulse the enable pin, rather than pulse/brake you get pulse/coast. Pulse/coast has all sorts of advantages over pulse/brake.
The one advantage pulse/brake offers is the it's a bit easier to control the speed of a motor with pulse/brake than when using pulse/coast.
I'm not sure if you're aware of it of not, but that motor won't be very useful. It really needs a gearbox in order to produce any sort of useful torque. My guess is the motor is just there for learning purposes (which is fine).
The 2 lines you're referring to is the ground that's connected to the L293D pin and the ground from the external power supply? And I'm not using any PWM, if you see my code in the first post, I'm only using digitalWrite
Anyway, guys, would it be better if I just used a TIP120 transistor instead? Would the voltage drop across the transistor be lower than the L293D? The L293D is a bit too complicated for a beginner like me