Hello,
I wanted to make the bot from this Printables page, so I got ESP12E motor shield and N20 motors, but the motor shield can't reverse 2 motors at the same time, either both forward or one of them, the moment I uncomment to reverse one of the motors it works without issues, but otherwise none of them move (it happens both on cable and battery power). The wiring is exactly the same as the one of the original author. Also, here is my code:
/*
Board pin | NodeMCU GPIO | Arduino IDE
A- 1 5 or D1
A+ 3 0 or D3
B- 2 4 or D2
B+ 4 2 or D4
*/
const int pwmMotorA = D1;
const int pwmMotorB = D2;
const int dirMotorA = D3;
const int dirMotorB = D4;
int motorSpeed = 500;
void setup() {
pinMode(pwmMotorA , OUTPUT);
pinMode(pwmMotorB, OUTPUT);
pinMode(dirMotorA, OUTPUT);
pinMode(dirMotorB, OUTPUT);
delay(3000);
}
void loop() {
digitalWrite(pwmMotorA, motorSpeed);
digitalWrite(dirMotorA, LOW);
digitalWrite(pwmMotorB, motorSpeed);
digitalWrite(dirMotorB, LOW);
delay(1500);
digitalWrite(pwmMotorA, motorSpeed);
digitalWrite(dirMotorA, HIGH);
digitalWrite(pwmMotorB, motorSpeed);
digitalWrite(dirMotorB, HIGH);
delay(1500);
digitalWrite(pwmMotorA, 0);
digitalWrite(dirMotorA, LOW);
digitalWrite(pwmMotorB, 0);
digitalWrite(dirMotorB, LOW);
delay(3000);
}
Yeah, it's a variant of ESP8266, which is used for NodeMCU development board (V2) with which is compatible this motor shield. Does it actually change anything in that context? The motor shield just uses 4 pins (2 pwm and 2 for direction) in that case and I'm just confused as to why two motors can't reverse at the same time and thought that maybe someone here knows something about it.
I didn't exactly tried it before, but it would've worked when I flashed the code for web server with a controller considering motors then were stopped before reversing, but after adding the code below to stop it first with a delay there's no change and nothing happens within that delay. I'll go find my old multimeter and check the motor pins to see if maybe there's not enough power (though it's the same issue on both 9v batteries and on cable).
Here's that code in between the forward and reverse:
Posting a link to the technical information on the motors might help. Google tells me this on a N20 motor: "The BMW N20 is a 1.6 and 2.0 L (98 and 122 cu in) turbocharged four-cylinder DOHC petrol engine, I think that does not apply. The motor shield has a L293DD per the documentation I could find. That tells me you will lose about 3V to each motor when running. It appears you are powering via USB so at best the motor will get about 2V. The L293DDIt is an old obsolete design. I could not find a decent schematic. You might want to consider a different approach such as a Bridge driver with MOSFET outputs.
I guess I was a bit too hasty with this project and didn't do much research. I honestly can't find any more information about N20-BT09 micro other than the ones that I have are 100RPM with 6V. I guess I'm gonna give up on this one and try to find some parts from scratch with my own research. Thanks a lot for the help! <3
PS: Also, I don't think the power could be an issue if the same thing was happening with 9V battery.
Before you give up measure the voltage on the 9V battery, I have a feeling it will go to about 5V. Those PP9 batteries do not have much reserve power needed by motors plus the mayby 50+ ma needed by the Arduino. On your next project get the data sheets etc first before investing money, many market place adds and others make a piece of junk sound great until you try to use it.