ESPresso Lite V2.0 is a Wi-Fi development board based on the ESP8266 chipset that also supports the Arduino environment. With this board, users can build systems capable of transferring data wirelessly through internet. In this tutorial, we will demonstrate a method of controlling geared DC motors’ rotation with MQTT Websockets Panel to create a wheeled robot. The command entered on the panel will commands the robot to move in the desired direction. Our robot uses two differential wheels one castor wheel, meaning its movement and steering is based on varying the relative rate of rotation of its two separately driven wheels placed on either side of the robot body; while a third castor wheel keeps the robot balanced.




1. We will use Dual Channel 10A DC Motor Driver to drive two DC geared motor. OLED display will be used to facilitate configuring Espresso Lite V2.0 to have internet access.
2. Referring to the following figure, do the wiring to connect all the hardware. Power will be supplied to the circuit after all the wiring is done.

3. Connect left motor to M1A and M1B port and right motor to M2A and M2B port.
4. Connect the battery to the MDD10A. Make sure the battery is connected with correct polarity. It is important to check and double-check any wiring before adding any power source to your project.
5. To check the movement of the left motor and right motor,
Press button M1B and M2B, the motor should rotate forward.
Press button M1A and M2A, the motor should rotate backward.
If the motor move in opposite direction, just change the polarity of the wire motor on MDD10A.
6. After all of the connection is completed, build a simple robot using this two DC Geared Motor, MDD10A and Espresso Lite V2.0 based on your creativity.



1. Espresso Lite V2.0 board configuration to have Internet access in AP mode.
a) To switch between the modes, press the button of GPIO13 for a few second until the Espresso Lite v2.0 restart.
b) When the board is in ‘AP mode’, the LED will produce an intermittent burst of short blinks. OLED display will show the board information.

c) The Espresso Lite v2.0 now became as an access point, so connect to the access point.

d) Open Internet browser and insert the IP address

e) A box will appear, choose your WiFi network and press Submit.
f) When the Oled screen show “connected”, that mean the board is successfully connected to the network.

2. Creating Cloud Account.
a) ESPert provides a free cloud service account with selected features for anyone who wants to build their own IoT applications.
b) Go to and register to create account.
c) Try logging in to the website to make sure user account is activated.

3. MQTT Broker.
a) MQTT (message queue telemetry transport) handles the transfer of data from the ESPresso Lite to
b) Go to and click on Connect to start connection with the MQTT broker via MQTT Websockets Panel.
c) Please ensure that the host will be and port is 8000.

d) For example, to rotate the motor that control by ESPresso Lite, key in {“DIRECTION” : <state>} in the message box and press Publish.
e) Please type ESPert/xxxxxxxx/Command in the Topic box where xxxxxxxx is your board id.

f) To display a message on MQTT Websockets Panel, click Subscription.
g) A dialog box will appear where you need type in topic in the format below: ESPert/xxxxxxxx/#
Where xxxxxxxx is the ID of your board.

h) Once the correct topic is entered and subscribed, a series of messages will appear.



DIR1 and DIR2 of MDD10A are connected to GIO2 and GIO14 of Espresso Lite V2.0 respectively. The purpose of these connections is to control rotation direction of DC Geared Motor. DIR1 represent the rotation direction for motor 1 and DIR2 for motor 2. For example, if GIO2 give HIGH signal, motor 1 will rotate clockwise (CW) and vice versa. PWM1 and PWM2 of MDD10A are connected to PWM pins of Espresso Lite board to generate different value of PWM to vary the speed of the DC motors. When the PWM value is 0, the connected DC motor will stop. By programming, the PWM values from 0 to 1023 to control the rotation of DC Geared Motor from fully stop to full speed. Here the procedure to write sample source code for this project:
1. Firstly, open the Arduino IDE and configure some setting which we set the board under (Tools) as Espresso Lite 2.0.

2. After that, open example “_2000_ESPert_workshop” under (File>Examples>ESpert) as shown below:

3. We modified the original code by deleted the unnecessary code that are not related to rotate DC Geared Motor when command is given through MQTT Websockets Panel.
4. Since there are no buzzer is used, the following code can be removed.

5. Same goes to the code related to DHT sensor.

6. Next, we write the setup code to set the pins as input or output in void setup() function. Also, declare temp variable as integer to put initial value of DC Geared Motor (Initial value should be between 0 and 1023) after “Espert.h” library. The sample code is as shown below:

7. Now, we can replace the code to control the rotation direction of each DC Geared Motor with the original code that control LED. The following sample code shows that it will have 5 characters to move the wheeled robot which are “F” for move forward, “B” for move backward, “R” for turn right, “L” turn left and “S” to stop the wheeled robot. The wheeled robot move forward when right motor rotates clockwise while left motor rotates counter-clockwise with full speed and backward when both motors rotate in reverse direction from previous with lower speed. To turn the robot to the right, we just simply rotate left DC Geared Motor counter-clockwise and if only right DC Geared Motor rotate clockwise will results wheeled robot to turn left. “String outString = “{\”WHEELED ROBOT\”:\”TURN LEFT\”}”;” code cause the movement status of wheeled robot is displayed on Messages dialog box of MQQT Websockets Panel. The table simplified the wheeled robot movement and sample code as shown below:

Ok, that’s all. If you have any question, feel free to ask in our technical forum as we seldom check the tutorial’s comment section. Thank you.



1. Espresso Lite V2.0: Wheeled Robot Basic Movement Control With MQTT Websockets Panel completed sample code, download here.



Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

BLTouch Installation for Ender 3 with 32-bit V4.2.2 Board
Pick and Send Random Meal’s Option and Locations through Telegram Bot Using Grove WiFi 8266 on micro:bit
DIY Automated Vacuum Cleaner Using REKA:BIT With Micro:bit
Rainbow Spark in Mini House using Maker Uno.
TinyML on Arduino using Edge Impulse
Tutorials of Cytron Technologies Scroll to Top