I’m new to Arduino and electrical, and now are trying to make a 2 wheel robot controlled by bluetooth. These are the part that I use:
- Arduino Leonardo Compatible by DFRobot : Link to wiki of the product
- 2 DC motor, each in a gearbox connected to a wheel
- L293D Motor Driver
- HC-05 Bluetooth Module
- 3 1K ohm resistor to make a voltage divider as suggested in this hc-05 tutorial : link
Everything related with the code goes well. The problem is everything related with the power supply. In general, I have 3 question:
Why is the dc motor goes very slow?
I try to connect the motor directly to the battery and it goes quite fast, but when I connect the motor to the the L293D, it goes very slow that often I have to rotate the wheel with my hand first and only then the wheel can run by itself.
Is it because the voltage is not sufficient? Or is it because of something wrong with the L293D? How much voltage do I need to run 2 dc motor using L293D?
Why is the code in the Arduino does not run when the arduino is started with only external power supply?
The Arduino run well when it connected to the computer using micro USB cable. But When I powered it using external power supply (a battery), the LED on the Arduino turned on, but the code inside it is not executed. The only way I can get this to work is, connect the Arduino to the battery, and also connect it to the computer using a micro USB cable. The Arduino will start and execute the code. After that, I unplug the usb cable from the computer so that the Arduino will only get the power from the battery. After I unplug the USB cable, the Arduino will continue to operate.
What is the best scheme for power supply for this project?
I think this might be related with question #2. The problem with this Arduino board I have is it do not have a Vin Pin. I asked the CS from the DFRobot, and they say the only way to power this board is to have a 5V±0.2V battery connected to the 5v pin of the Arduino. So what I’ve try in question #2 is:
Connect a smartphone power bank to the micro usb port of the board (the arduino board turned on, but doesn’t run the code)
Connect a power bank to the 5v port while also connect the board to the computer via usb cable (worked as explained in question #2)
Connect 4 AA batteries to the 5v port (I know this not follow what the DFRobot CS says, but I just curious to try it) while also connect the board to the computer via usb cable (worked as explained in question #2)
The paragraph above is about to power the Arduino. The other thing is to power the motor. What I had in mind, is to separate the power source for the Arduino and for everything in the breadboard. This work well, but still the motor is running very slow. These are the power supply option that I have:
- A smartphone power bank (last checked giving a 5.03v)
- A set of 4 AA batteries (last checked giving a ~5.74v)
- A 9v battery (last checked giving a ~9.28v)
This is the breadboard layout that I use (bigger picture in the attachment or open the image below in the new tab):
I’m sorry if I asked to much with a long question. I hope you guys can help me