Introduction: Simple NodeMCU 18 DOF Hexapod
A hexabot robot is a mechanical vehicle that walks on six
legs. Since a robot can be statically stable on three or more legs, a hexabot robot has a great deal of flexibility in how it can move. If legs become disabled, the robot may still be able to walk. Furthermore, not all of the robot's legs are needed for stability; other legs are free to reach new foot placements or manipulate a payload.
Many hexabot robots are biologically inspired by Hexabot locomotion. Hexabots may be used to test biological theories about insect locomotion, motor control, and neurobiology.
Using 18 servos or 18DOF with 3 join per leg is flexible enough for a hexabot robot than 12DOF hexabot robot.
some of Hexabot hobot have a complex mechanism and schematic. in this design i try to make a simple design hexabot using common component that we can found in the market
Step 1: Time to Shoping
Step 2: Print and Assemble the Body Part
all the spider body part and claw can be download from
https://www.myminifactory.com/object/3d-print-7650...
or
https://www.thingiverse.com/thing:3130196
mandatory list of part u have to print :
- 6x shield.stl
- 3x coxa_A.stl
- 3x coxa_B.stl
- 3x tibia_A.stl
- 3x tibia_B.stl
- 3x femur_A.stl
- 3x femur_B.stl
- 1x Hex_body_short.stl
- 1x Hex_cover_short.stl
- 1x Ring.stl
The rest is optional...
Step 3: Connecting the Dot
This is all electronic schematic, basically all servos controlled by 32CH servo controller because it's already have micro controller in it. Just like arduino it's independence and can controlled using serial command from PS2 controller, PC or other device.
Step 4: 32CH Servo Controller
Features:
- Operating voltage: 5v
- Servo motor input voltage: 4.2V~7.2V
- CPU: 32 bit
- Baud Rate (USB):115200
- Baud Rate (bluetooth/UART): 4800 、9600、19200、38400、57600、 115200
- flash storage capacity: 16M
- Red Indicator: CPU power indicator
- Gree Indicator: servo motor indicator
- Yellow Indicator: PS2 Wireless Controller
- Mode Protocol: UART
- Computer protocol: Support Single
- Operating protocol: Support
- Supper servo motor type: 9G~55G (3.3V~7.2V)
- Online Operations Support: C51/ARM/DSP/Buletooth/Computer
- Mode type: USB/UART/Offline Independent/PS2 wireless control
Cabling mapping :
- 5v power out (+) from UBEC
- Ground from UBEC and Mini Stepdown
- 5v power out (+) from mini step down
- to Wemos D1 mini G pin
- to Wemos D1 mini 5v pin
- to Wemos D1 mini RX pin
- to Wemos D1 mini TX pin
- (match the pin color with the servo cable color) to right front leg (pin 1 to coxa, pin 2 to femur, pin 3 tibia servo)
(match the pin color with the servo cable color) to left front leg (pin 5 to coxa, pin 6 to femur, pin 7 tibia servo)
(match the pin color with the servo cable color) pin 9 to claw servos (assemble the claw first)
(match the pin color with the servo cable color) to left middle leg (pin 13 to coxa, pin 14 to femur, pin 15 tibia servo)
(match the pin color with the servo cable color) to right middle leg (pin 17 to coxa, pin 18 to femur, pin 19 tibia servo)
(match the pin color with the servo cable color) to left back leg (pin 25 to coxa, pin 26 to femur, pin 27 tibia servo)
(match the pin color with the servo cable color) to right back leg (pin 29 to coxa, pin 30 to femur, pin 31 tibia servo)
Step 5: NodeMCU AP
The WeMos D1 mini is minimal ESP8266 wifi board
Using wemos D1 mini as WIFI AP we can send serial command to the 32 CH servo controller and independence become Web server AP for controlling the robot.
all we need just flash the nodeMCU board with the code attach and we can connect the smartphone to the nodeMCU AP and using web browser open http://192.168.4.1 and we can see all the command.
ModeMCU Pin mapping:
- to the 32 CH servo controller RX pin
- to the 32 CH servo controller TX pin
- from 32 CH servo controller G pin
- from 32 CH servo controller 5v pin
PS: I have fix (31/4/2019 update) some connection issue that appears before... such as hard to connect or page not render completely...and if u have a alot of error movement, please check your battery current... usually it because it running with not enough battery power...
So Have some fun with it...!! :)
Step 6: Initial Pose
IMPORTANT...!!
we need to set the initial pose for the spider.
- turn on the robot (at the first time maybe all the leg will be miss pose so for this step please release all the servo horn first)
- reattach the servo horn and adjust the coca, tibia and femur pose just like the picture abbove
- turn off and turn on again to make sure that all leg is in the right position
Step 7: Adding More Movement
After all finish, we can add more motion to the arduino code. I using RTrobot servo controller to make some movement and after we have the serial command for the servo, we can put it in the code with some code adjustment.
or here @4shared for windows & linux only
PS Very very IMPORTANT :
all RX and TX from and to Wemos and Servo Drivers have to firmly connected, because looping routine always check "OK respond" from the 32 servo drivers. If servo driver not found and there is no "OK" respond, than program will be loop in "void the wait_serial_return_ok()"
This mistake will cause : - Cannot connect to the AP - Blank web page - Page loading progress not finish
Step 8: Sugestion...
- for power supply we also can use lipo 3s battery, i think 900mah is enough but u need to have lipo battery for charge it.
- if u want to put obstacle sensor and servos, u can connect the sensor to the one of the wemos d1 mini input pin, and the power from 32 CH servo controller G and 5V
Step 9: For Whom Have a Problem With Opening Web Page or Connecting to the AP
I HAVE FIX THIS ISSUE PLEASE DOWNLOAD IT AGAIN FROM STEP 5 ABOVE (fix @ 31-4-2019)
some of Wemos D1 mini clone have a bad or defect ESP, and it causing:
- Hard to connect to the AP
- Fail to open page
- Loading not finish
For more detail check my video above...
Step 10: Cable Organize...
Basically just do the u can do... But I can share I I have do... Here's the picture...
4 People Made This Project!
pathieu.anglade made it!
pachanoid made it!
LuisI33 made it!
MusaW made it!

















70 Discussions
2 months ago
I created a remix version with a camera and all the code is in python on a raspberry pi zero w
PS : for all those who have a freeze problem, this comes from the driver card, you have taken the Chinese version USC 7.7 which does not work with speeds higher than 9600 bauds (this is the one I use in the video)
I can share my python code as well as the 3D plans for the camera if it interests people
I also created a software in C # allowing to control the servos with the Chinese driver card usc 7.70, I can also send you the code sources
there are still slight bugs to fix but please be indulgent I am a student I am not the level of mrusaW
Reply 8 days ago
that's is very impresive...
Reply 9 days ago
Меня очень заинтересовал ваш проект, а можно поделится версией ремикса с камерой, и весь кодом написаного на python для Raspberry Pi Zero W !!!!!!!
1 year ago
Hello. I have a problem with connecting to the AP. I'm going to upload the program pretty well to wemos. But if I connect with my smartphone and press a command, the AP stopped ... why? Servo board is well, servos too,... but communication between board=wemos=smartphone... no ... :( i tried cables and others... and nothing :/
Reply 11 months ago
do u separate between servo driver power and nodemcu board power?
Reply 11 months ago
yes, everything has divided power. I even bought another servo board for sure if the previous one was damaged. But there's nothing wrong with that either.
Reply 2 months ago
Hello Tomi, I have the same problem with you. Did you fix it? If so, pls share it with me.
Reply 2 months ago
nooo :( I still have this problem :( ...
Question 5 months ago
Hello my friend, Sorry again for the inconvenience, i was wondering If It ia normal to click on any Cell Key the BLUE wemos light goes out? Thankful
Answer 2 months ago
I have the same problem with you. Did you fix it, if so, pls share it with me.
Question 3 months ago
Thanks for sharing the project. Is it possible to use only a 5V power source and bypass the UBEC and the stepdown converter?
Question 3 months ago on Step 9
donde encuentro el ap
Question 5 months ago
Hello
Thank you very much for sharing wonderfull project. I made it. I have some problems:
I don't use wemos. I want to use ps2 remote control
So how can it walk I cud not understand can you please help me?
5 months ago
Hi, what board you chose from the list in arduino ide, then importing the code to wemos? I'm getting web page with control buttons, but robot not moving then pushing them. What arduino ide libraries I should install? Do I need to do something with 32 ch servo controller board? Is this code the same as your v1 hexapod robot code? V1 hexapod robot code is not working at all for me, not opening web buttons. But still with this code I see buttons can push them but nothing happening.
6 months ago
very much informative,i appreciate your work!thanks for providing this awesome project!
can I ask a question?can I use ESP8266 node mcu and pca9685 instead this 32CH servo controller.and can I upload this same code which you provided in this post??
WAITING FOR YOUR REPLY,THANKS IN ADVANCE
Question 7 months ago
Hii!
Realy nice project. I am trying to build my hexapod with my own code.
I am not running an ESP, I run an arduino mega and a bluetooth module and x2 16 ch servo controller. I have some questions about power supply. The servo controllers can go up to 6V, and with 18 servos (I am not using claw), do I need 6 Amps, right? Will a lipo 6V battery do the job if i connect it in parallel to the servo controllers and a standart 9V battery to my arduino?
7 months ago
hey im having trouble finding the code for the servo controller do you think you could post it again? all i can get to download is the bug fix which dose not seem to be all the code??
Reply 7 months ago
this file (Hexapod310319_fix_connection_issue.ino) is not only the bug fix but all code include bug fix...
8 months ago
And tell me please. I really want to make such a robot but that it would be controlled from the remote from the PS. Is it hard to implement ? I found this controller https://ru.aliexpress.com/item/32948999773.html?spm=a2g0o.cart.0.0.100f3c00D1yrtI&mp=1
Reply 8 months ago
i don't know for sure, it might have same protocol with the one i use or not... but it probably have the same way...