How to Configure and Use Smart Servos LewanSoul (LX-16A)




Introduction: How to Configure and Use Smart Servos LewanSoul (LX-16A)

The LewanSoul produces where interesting and cheap smart servo (LX-16A) that can be used in different DIY projects.

For example:

It almost 3 times cheaper (~$15) to its close analog the XL430-W250-T (~$50).

And here you can compare it with other Dynamixel servo:

The advantage of smart servos is that they very accurate and provides the feedback about their position, temperature and voltage. Also they has protection from overloading.

The disadvantage is that they uses sophisticated protocol that could be a problem for using them in DIY projects.

Lets try to decrease this a little disadvantage to get the big advantage :)


For that you need:

- LX-16A smart servo(s)

- Controller board

- Power supply (8.4V)

Step 1: Wire the Servo to Controller

To control the LX-16A smart servos you need a special controller board

(you can buy it together with the servo on aliexpress).

The simplest one ($7) that shown on picture can control 8+ servos.

All you need is to connect it to smart servo, attach the power supply and then connect the controller to computer using USB cable.

Then you will able to send the special commands from computer to the controller board to control the servo and get feedback from it.

Step 2: Software

To control the servo from computer you need a special software.

I suggest to use the Python for that purpose since it very easy to setup it can be used on different platforms (Windows/Linux/MacOS).

Install the Python 3:

Download the python scripts for controlling the servo:

Extract it and run the command prompt (cmd.exe), then go to folder where you extracted the script:

cd "C:\Users\Test\Downloads\LewanSoul-master\LewanSoul-master\src"

Now you ready to open the world of smart servos for your DIY projects :)

Step 3: Get the COM Port

Now you need to get the COM port where your controller attached to computer.

The easiest way to do it is to run the Arduino IDE and check it there.

Then adjust it in your local copy of python script (at line 6):


If you have trouble with finding the COM port number then please use these links for help:

Step 4: Get the Servo Status

If you have only one servo attached to the controller board then you can run the following command:


It will show the id of servo (8), its position (0) and temperature (29 °C).

If you already know the servo id then specify the command argument info with servo id (8):

python info 8

(this command is useful when you have several servos attached to the same controller board).

To get the list of all command arguments run:

python help

Step 5: Move Your Servo

Now its time to move your servo.

The LX-16A servo has moving range from 0 to 240 degree that corresponds to position from 0 to 1000.

So, to move the servo you have to set it position by command :

python set_pos 8 500

(to move the servo with id 8 to position 500 that corresponds to 120 degree).

And then check that servo really moved to its new position by running:

python info 8

Step 6: Other Commands

Here the list of some useful commands that may help you to setup the servo.

Scan all servos ids attached to the controlled board:

python scan

Test servo range (move servo to 0, then to 1000 and then to 500):

python test 8

Reassign servo id (from 8 to 3):

python assign 8 3

Reset servo (reset servo internal state to default and set its id to 1):

python reset 8

Step 7: Some Videos and Spec

Some helpful video about LX-16A (found in google):

The LX-16A servo spec:

Step 8: Finally

And when you will be a little bit more familiar with that servo you may want to build something really interesting.

For example, quadruped robot:

The 6DOF robot arm:

Or buy a ready kit (~$240), but it is only 5DOF robot arm :)

Be the First to Share


    • Halloween Contest

      Halloween Contest
    • Fandom Contest

      Fandom Contest
    • Microcontroller Contest

      Microcontroller Contest



    1 year ago on Step 8

    Hello! You are pretty much the only person I have found using these servos (And the reason I know about them haha), I was wondering if you could share how to control them either through Arduino (You mention connecting an arduino but I don't quite see how it is used here) or a Raspberry PI as I am planning out a project that uses a Jetson Nano but I can use either C/C++ or Python. I cannot seem to find anywhere that has example code for communicating with these servos other than an Arduino library that does not work with smaller boards.


    Reply 1 year ago

    Hi, so for the python code I receive an error that 'str' object has no attribute 'write'. As far as I can tell when creating the object for the servo I pass the COM port as the serial however, when I attempt to test it by seeing if I can get_servo_id() I receive that write error (Line 107, self._serial.write(bytearray([ ). I also receive this error when trying to use the move_start() function so I am assuming I am missing something.
    The file "test" is the file
    Screenshot 2021-03-23 100129.png

    Reply 1 year ago

    Try to use the running under Python3:
    There are a lot of error can be easily made, so the better way to take the existing code and modify it step by step until you get what you initially supposed :)


    Reply 4 months ago

    Hi - I have purchased the LX-16a servos and have one plugged into the servo board (with 7V) which is plugged into the RX & TX ports of the Pi4. (the servo works via the control board supplied).
    I've run the python3 command and it brings an error with trying to import lewansoul_lx16s line 11 from serial.serialutil import Timeout....... the error reads "ModuleNotFoundError: No module named 'serial.serialutil' .
    Im pretty new to coding and Python, I don't know where to go to fix this error? Could you please point me in the right direction?

    Many thanks!


    Reply 1 year ago

    The was initially only giving me error!! however now it is working, I didn't realize I needed to use the install command :) .
    How do you control the servo(s) with the control board instead of the debug board. If I try using the control board the COM port doesn't work so I'm assuming there is another way of communicating with the board. You also wouldn't happen to know how to detect when the servo has a larger load (Like in the dog project, when the leg hits the ground the servo knows to stop trying to move)?

    Sorry for all the questions, I haven't used serial bus servos before and haven't been able to find much additional info. I really do appriciate the help though :D


    Reply 1 year ago

    The LX-16a servos has similar principal of controls than other smart servos. So you can try to start first with well documented Dynamixel servos to get an idea of how to control it (it also has better software and UI :):

    To understand that leg hit the ground you can use the difference between actual servo position and its recent goal. In case of load it will be larger than in idle move.


    Reply 1 year ago

    I will definitely check out the dynamixel servos to see how they are used, I am still lost on how I communicate with the servo control board. With the debug board you communicate through a COM port however with the control board it doesn't show up as a COM port, is this why you used an arduino or do I have a faulty board/missing something?


    Reply 1 year ago

    It seems you are using wrong board, the correct one that provides the COM communication (like FTDI) looks like:
    Wire the Servo to Controller
    The COM port will appear after connecting LX-16A servo and attaching the external power (6-8.4v) over Power Interface shown on photo. I didn't use Arduino for communication with servo (the Arduino was used just to help found the COM port number on Windows).


    Reply 1 year ago

    Ohhh okay, yeah that's where I've been confused. I thought the debug board was only for debugging (Hence the name) and the control board was for controlling. I still have no idea what the control board is for but, I suppose either way I saved money buying the bundle that came with it rather than buying everything individually 😅


    Reply 1 year ago

    I figured out what the control board is for (Kinda), from what an Amazon user was able to tell me the control board is a microcontroller for the servos that uses code stored on the servos to control them without being connected to the computer. So I'll be using the debug board to control my servos then haha. Thank you again for all the help!


    Reply 1 year ago

    Yes, If you are talking about the board I supposed then it is a some kind of Arduino board to controll simple projects like robot arms without computer.