Hi,
I am new to using NodeMCU and DRV8838 for DC motor control.
Would you please help me to understand how to use the two components and move the motor in either direction?
When programming those boards using the ESP core in Arduino IDE, the GPIO numbers are used instead of the silkscreen numbers that are printed on the PCB. So, you should probably make the top couple lines of your code:
int enablePin = 5;
int phasePin = 4;
You can find a diagram that shows which GPIO numbers correspond to which silkscreen numbers on this web page.
Also, although your system might work by setting enablePin as an INPUT, whether or not it does depends on a few characteristics of your NodeMCU (e.g. the logic voltage of the microcontroller and the value of the pull-up resistor used when enablePin is connected to logic high). I recommend setting enablePin to OUTPUT, so we can more obviously expect that pin to work.
I appreciate your responses to everyone’s postings in the forum. I am using the ESP01 as my MCU and following the DRV8838 diagram to wire my project (pictures included). However, I’m having trouble programming the ESP01 to control the DRV8838. Am I missing something or do I need to change my pin connections? Currently, enablePin is set to 2 and phasePin is set to 3. Let me know if you have any questions.