Home » Projects » Electronics Projects » L293D NodeMCU Motor Shield Works Fine

L293D NodeMCU Motor Shield Works Fine

nodemcu motor shield

My low cost L293D  Motor Shield will do the trick for remote controlling a new loop antenna. You can use a stepper to tune the antenna with rotation provided by a larger DC motor.

As described last week, I am going to build a two-turn small transmitting loop (STL) with wireless remote control. A small stepper motor will tune the loop. A geared DC motor will be the rotator. Now, to make these work on WIFI, I will use a NodeMCU ESP-12E module.

So, I purchased an L293D NodeMCU motor shield on eBay for around US$2.00. Unlike the Arduino shields which plug into the Arduino, the tiny NodeMCU instead plugs into its shield, as shown center above. You can see that this shield has terminal strips for motor control and power, and brings out a bunch of the GPIO pins from the microcontroller. My DC motor requires 12 volts, while the stepper and NodeMCU run off 5 volts. The NodeMCU motor shield provides separate power connectors for motor and microcontroller.

Shown above is my test set-up for motor control proof of concept. In short order, I was able to write some code in the Arduino IDE to turn and control both motors independently. The L293D chip takes 3.3 V low-current signals from the NodeMCU outputs and ramps them up to 12 V high-current motor drive requirements. At the same time, the NodeMCU digital output pins use the ULN2003 board (lower right) to control the five-volt stepper.

When all is said and done, the NodeMCU in the loop antenna outside will show up on my home network, giving me remote control. All I have to do is feed 12 volts to the antenna, and then regulate some of that power down to 5V for the NodeMCU device and stepper motor. The shield also provide a connection to an analog input pin, enabling me to use a multi-turn potentiometer to read rotation direction.

What I find amazing is the low cost of these components. All told, the motors and electronics come in well under $20. Now, my goal is to make this all work mechanically in the weeks ahead.

NodeMCU Motor Shield Coding

I mentioned previously that it’s been four years since I did any Arduino coding. Fortunately, I did a great job of documenting my previous efforts, so it’s coming back quickly. I downloaded the latest Arduino IDE, which has remained pretty much the same.

However, I had to switch to Visual Studio 2019 community edition in order to use the latest version of Visual Micro. Over the interim, Visual Micro has discontinued free use and now requires a subscription. But I discovered the subscription is only $12 a year, which is very reasonable for a hobbyist. Visual Micro is an extension that let’s you use most of the power of Visual Studio to do your Arduino and NodeMCU coding.

Also, much thanks to Microsoft for maintaining its free edition of Visual Studio.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.