Hi!!
I am new to arduino and so i started to learn by trying out a simple obstacle avoiding Robot which goes straight when the distance between the obstacle and the bot is greater than 10 cm and turns left when the distance of the obstacle is less than 10 cm. The Robot i made works fine when connected to my computer but when i power it with an external power source only one wheel spins and nothing other than that happens. I have used L293D IC and HC-SR04 to make my Robot. I have also attached my code. please help me.
Hi,
Thanks for the schematic, good.
The 9V battery, is it one of those small batteries you use in a smoke detector?
If so then it will not be able to power your mega and SR-04 for long, you will need a bigger capacitiy.
As you say it works OK on the USB supply, the 9V battery is the weak link.
Tom.....
PS A drawing hint. Because its a pain to draw little skips over non connecting wires, if you draw a dot where crossing wires connect, then you can just draw crossing wires without dots to show that they do not connect.
I have attached the circuit. The thing is i had only one 12v battery so first i tried using the same battery to power up both my Arduino and motor but that didnt work then i tried using a 12 v battery for my arduino and a 9v battery for the motor and even that didnt work. Though my motor is a 12v motor there should atleast be some spinning but as usual only 1 wheel spinned in a fast phase.