In a recent conversation with Nuts & Volts Editor, Bryan Bergeron, he suggested I might apply my knowledge and fondness for the ESP8266 to robotic applications. That got me thinking. I had never built an electronics
project that actually moved, so this might be a good
opportunity to do so. Could a NodeMCU Amica module be
the brains of a robot? I decided to find out. Of course,
since this would be my first robotics project, I needed to
keep things simple. I viewed this challenge more as a
testbed for the technology than an attempt to build a full
featured robot. However, after getting my robot to work, I
realized how extendable the robotics platform I will
describe in this article is. It could be used as the basis for
any number of robot designs that would be much more
powerful than what I present here.
In a nutshell, this is what I have done. On the front of
the robot, I have coupled the NodeMCU Amica module to
an L293D H-bridge motor controller chip connected to an
inexpensive two-motor robot chassis from makershed.com.
On the robot controller side, I have coupled the
NodeMCU Amica module to a joystick and an RGB LED.
Using the joystick, you can wirelessly drive the robot around
(presently, that is all you can do). The LED provides a visual
indication of the status of the wireless communication link
between the robot and the robot controller. Limiting as this
is, it does prove the NodeMCU Amica module can be the
brains of both a robot and its accompanying controller.
Both the robot and the robot controller’s electronics
are built using point-to-point wiring on perfboard. Figure 3
shows the results of my effort.
The Robot Controller
The robot controller (shown in Figure 4) controls the
robot via its joystick. While the controller could have been
powered with batteries, I chose to power it via USB as this
was only a prototype. As mentioned, the RGB LED displays
the controller’s status. If the LED blinks red, it means the
controller could not connect to the robot. If it blinks blue, it
means that the link-up handshake carried on between the
robot and the controller has gotten out of sync. If the LED
glows green, the controller and the wireless network are
The position of the joystick controls the speed of the
robot’s motors. Whenever the joystick is in the center or
released position, the robot comes to a stop. The forward
position of the joystick is towards the NodeMCU module on
the circuit board. Joystick positions above center drive the
robot forward, while positions behind center drive it
backward. If the joystick is moved left of center, the robot’s
left motor is slowed down so the robot turns towards the
left. Conversely, if the joystick is moved to the right of
center, the right motor slows down making the robot veer
to the right. The speed of the robot is controlled by how far
the joystick is pushed in any direction. With a little practice,
the robot can be driven smoothly and is responsive enough
to be driven around obstacles. Text tokens are passed
wirelessly between the robot controller and the robot to
manage its operation. The controller sends out a ping token
about once a second that the robot should receive and
echo back to confirm link status. The controller expects to
receive these ping messages and will go into an error state
if they are not received. The ping token is just the string
“ping” followed by carriage return (ASCII code 13) and line
feed (ASCII code 10) characters.
Robot motor speed is controlled by two other text
tokens — “lm:speed” and “rm:speed” — that are passed
from the robot controller to the robot; “lm” stands for left
motor while “rm” stands for the right motor. Speed is a
signed entity that sets the corresponding motor’s speed.
Speed ranges from zero or stopped through 1023, which
corresponds to the maximum speed of the motor. Currently,
the robot controller software limits
maximum motor speed to make driving
slower but easier. If speed is positive, the
motor runs forward; if negative, the
motor runs backward.
By Craig Lindley
SERVO 05.2016 43
Figure 3. Robot and robot controller. The little module on the
back of the robot is the adjustable voltage regulator.
Figure 4. Robot controller close-up.
Post comments on this section and find any associated files and/or downloads at
(NOTE: See http://esp8266.github.io/Arduino/versions/2.0.0/doc/installing.html
for instructions on how to install the ESP8266 development software on your
computer. Make sure you select NodeMCU 1.0 as your board type and 160
MHz as the CPU frequency if you try to reproduce my results.)