How to Build SMARS Spider Mod Robot - With WiFi and Voice Control!
by DmitryM8 in Circuits > Robots
2459 Views, 49 Favorites, 0 Comments
How to Build SMARS Spider Mod Robot - With WiFi and Voice Control!
SMARS stands for “Screwless/Screwed Modular Assemblable Robotic System”. It's a mouthful, I know. It's a simple robot designed for the educational field, with reduced number of components, the possibility of mount it without screws / soldering any part - it’s really cheap to build.
There are a lot of modifications for SMARS, one that stood out for me was SMARS Quad Mod (the original project link). It makes a blocky car into a no-less blocky spider robot. But to my dissatisfaction, it was surprisingly difficult to find complete and definitive instructions on how to build it, most of the available materials were either incomplete (wiring, but no code OR some code, but no wiring, etc) or outdated.
So I decided to make one myself, figure everything out, upgrade it with Arduino RP2040 and share my work here.
Supplies
First things first, here are the parts that are required:
- 8x SG90 servo
- 1x 3A step-down module
- 2x 18650 batteries (tested | cheaper, but not tested)
- 1x switch
- 1x power connectors
- 1x Ultrasonic Ranging Module HC-SR04 (Optional)
For the control board and the expansion shield I used:
In the video I mention several different options you have available for control board and shield:
Option A (RP2040 Board + ESP32 Cam) - possibility to add video streaming, no voice control
Option B (ESP32 board + ESP32 Sensor Shield) - cheapest option, no voice control
We'll focus on Arduino RP2040 Connect, to make a clear and concise tutorial, but feel free to ask questions here or on my YouTube channel.
You'll also need 3D printing filament - I recommend using eSUN ABS+, which is the material I used myself for printing the parts. You can choose PLA as well, but it tends to be more brittle, than ABS.
Finally, you'll need some tools:
- obviously a 3D printer. All parts are fairly small, so even small desktop printers are okay.
- soldering iron. While original SMARS is meant to be assembled without soldering, here we will need to solder PSU (power supply unit) circuits.
- miscellaneous tools (glue gun, small pliers, screwdriver, wires etc.)
Print the Parts
Download the build files from thingiverse.com. Thanks to Kevin Thomas who was created SMARS and SMARS Quad Mod. My fork of original design basically puts all the necessary files together (they are a bit scattered over different projects) and modifies certain parts. The modifications are explained in details on thingiverse.com.
List of 3D Printed Parts:
- 1x battery_cover.stl
- 1x frame_quad.stl
- 2x foot.stl
- 2x foot_m.stl - orient it the same way as foot.stl (see picture with the finished parts)
- 4x servo_case.stl
- 4x servo_case_m.stl
- 4x servo_arm.stl
- 1x chassis_quad.stl
- 1x psu_holder.stl
- 1x ultrasonic_1.stl (optional)
- 1x ultrasonic_2a_V2.stl (optional)
To print the parts I used 3D Printer Wanhao Duplicator 4S with resolution: 0.2, infill 20%, supports enabled (Touching Buildplate). Almost all the parts were printed in their original orientation, with the exception of battery compartment and foot_m - it took a few tries to figure out the best orientation for the battery compartment, you can see it in the picture above. I used Auto Orientation plugin for Cura.
Postprocessing-wise, I removed the supports and did a little bit of sanding, although the last one is optional, purely for aesthetics.
Assemble the Legs
Install the servos into servo cases. The standard 6g servos should fit snugly inside the cases. Push the servo wires into dedicated crevices.
Push the frame on top of the chassis.
Then mount the servo cases onto the frame - look at the picture with arrows to make sure you mount them correctly. If you see the cases are a bit loose on the frame still, use a bit of glue from the glue gun.
Connect the Main Board
The wiring was a big headache for me to figure out, so I'm leaving a detailed picture for you. And you can always consult the code
Make sure you connect the servos BEFORE installing the servo arms, as servos need to be centered.
Build the PSU
If you have a suitable power supply (5V and at least 3A with barrel jack connector), you can assemble the PSU (power supply unit) later. This is a bit daunting part, that involves quite a bit of wiring and soldering.
I'm assuming that you don't have a suitable power supply, so you need to build the PSU before you can install the servo arms.
Click on the first picture above for wiring, to see the full picture. Two 18650 batteries are connected in series, thus raising the voltage to 3.7*2=7.4V. The positive wire goes from the battery through the switch to positive input of DC-DC step-down module. Negative (ground) wire goes from the battery to negative (ground) input of DC-DC step-down module.
BEFORE you connect the PSU to the expansion board, you need to make sure it outputs 5V. Use multimeter for that - keep turning the potentiometer on the step-down module COUNTER-CLOCKWISE until the voltage on multimeter shows exactly 5V.
Finally, power down the PSU with the switch and solder the input and output of step-down module to the expansion board. See the second picture above. You will also need to connect positive (red wire) wire with 5V pin on the expansion board, this will provide the power to Arduino RP2040 Connect.
Okay, it was not easy, but now we should have both servos and Arduino RP2040 Connect powered up.
Upload the Sketch
Connect your main board (in this case Arduino RP2040 Connect) to your PC with a micro-USB cable. Download the sketches from the Github repository.
Open smars_spider_serial.ino in Arduino IDE.
Install Earle F. Philhower, III RP2040 Arduino core (tested with version 3.9.5, other version are NOT guaranteed to work), following the instructions here.
Upload the sketch while having the Arduino RP2040 Connect inserted into expansion board and the expansion board connected to PSU. If everything is correct, the uploading should succeed and you'll hear whirring of connected servos moving to their default positions.
Install the Servo Arms
Note: you can see that I'm using 5V barrel jack power supply for this step to provide power to servos and the main board.
Mount 3D printed servo arms parts onto the servos in cases attached to the frame. After that install the small white servo arms. Make sure the servo arms installed the 90 degree angle to the frame (so perpendicular, just like in the first picture). There might be 3-5 degrees deviation, but should be no more than that.
Install the Feet
In a similar fashion, install the feet. So first mount the printed parts, then install the small white servo arms. The white servo arms should be parallel to the surface (see the picture).
Put the screws inside the small plastic servo arms, both for hips and feet. Do not tighten them too much! Otherwise it's possible to break the servos.
At this point you can conduct a quick test - with the board connected to your computer, send some commands to it, for example S for standing or F for walking forward. You can find the full list of commands at the bottom of smars_spider_serial.ino sketch.
Finish Up
For assembly, that is mostly it!
Before you finish the robot up, it's best to upload the final sketch, as connecting to the main board is not trivial with the robot cover closed. You have the choice of:
- WiFi control sketch (smars_spider_wifi.ino)
- Voice control sketch (smars_spider_voice.ino)
With WiFi control sketch, the robot creates a new WiFi network, smars_spider. Connect to it with your mobile device and open Arduino Car app. Press on the cog button and set the configuration as in picture above.
For the voice control sketch, you will need to download keyword spotting model from Edge Impulse - or create your own. Here is the public version of the project. Go to deployment, then choose Arduino library as deployment type. Download and unzip, then paste into your Arduino libraries location. Upload the sketch. The robot will react to words: forward, backward, left and right.
Hope you will have fun building it - and do let me know what issues you experience, so I can correct the guide.
P.S. Remember that for other control boards, than Arduino RP2040 Connect your code might differ.