Motor didnt work.
I use 4 aa battery for driver power source.
Arduino pins still working when i test it for ir sensor.
Motor work when directly connect to power source.
Welcome to the forum
Please do not post pictures of code
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination
https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
Im sorry for the inconvenient
Here's the code
#define IN1 33
#define IN2 35
#define IN3 37
#define IN4 39
void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
}
void loop() {
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
measure the voltage of motor output, it's probably too low for your motor
Thank you for answering. But i dont have voltmeter or multimeter in my posession right now. For additional information, i test the project yesterday and it work when i used arduino board as power source. and because i think it would be bad for the board i change the power source today, but it didnt work. And when i switched it back to arduino board as power source, it still didnt work.
Do you have a ground going from your motor driver board back to your arduino?
Yesterday yes, but in the photo no.
In the i photo used differrent power source for the arduino and driver motor
That gives you about 6V. Your L298 drops about 3 Volts. That leaves you about 3 Volts for the motor. Use a MOSFET driver and your project will work or you need to redesign it to use a higher voltage.
I will take a SWAG and say you are powering through the 5V pin, if so you are at the processor's max voltage.. If you are powering from Vin you do not have enough voltage for it to operate properly. To keep from purchasing another Arduino(s) post your annotated schematic showing how everything is connected. Be sure to show all connections, power sources, power connections and all ground connectors.
Thank you for your advice. i just add another 4 aa battery to the motor driver power source but it still didnt work
That is correct, you need to put them in series to raise the voltage. Red from one connected to black from the other. Then the remaining is your output.
I just checked the IN pin with voltmeter and it didnt show any value. Is that means my IN pins are dead ?
And if it dead, can i fix it ?
You need to run a ground from the motor controller ground to the arduino ground.
The signals sent to the motor controller have no ground reference. (No path back to the arduino) You can share ground amongst different voltages.
Make sure your batteries are also plugged into the corrent terminals on the motor controller. This motor controller has a voltage regulator on it.
Plug the battery wires into ground and vin?
On the photo the positive is wired into 5v.
You can use the 5v output to power the arduino plugging it into the 5v rail pin on the arduino. Just make sure you dont have the arduino plugged into usb and powered by 5v at the same time.
Mengunggah: 17153932793555168668679482685200.jpg…
Thx for your advice.
Plugged it to arduino ground, but still wont work
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.