SMARS modular robot

by tristomietitoredeituit Nov 22, 2017
Download All Files

Thing Apps Enabled

Please Login to Comment

Why doesn't the wheel spin when the pallet is fitted? Please watch video : https://www.youtube.com/watch?v=7ZAEFHoKQcs

I think there is too much tension

I printed in 3d printer the given files and there are 16 tracks in the palette. How do I reduce tension?

I have the same issue in the past time. then i have mountet 8 tracks by every wheel and then it runs fine.

Thank you for this great design. I'm using mblock (programming with block like scratch) to program the robot. I've also modified the wheels so it uses bearings, it runs smoother now. I've made a video of it onto my youtube channel https://www.youtube.com/watch?v=w6trDkXuTvQ

Could you please share your modified wheels.

Wow, really nice tutorial! It would be great if you could do the same with other modules.

Thank you, that's a good idea. I will try to do so, but I don't have other modules for the moment.

Can anyone tell me how I would be able to use 1-1800 mah 3.7v li-ion battery to power this project?

i think the arduino needs at least 5v.

Greetings tristomietitoredeituit,
My connections are correct, the motor shield works in different applications. But when I connect the 9v battery to the motor shield, the wheels don't move.


i have the Arduino Board "Improved Version UNO R3 ATMEGA328P Board Compatible with Arduino" with "KEYES L293D Motor Control Shield for Arduino - Blue" and this smal code


include Wire.h // I have removed only for here the #, < and > while it is not a MD Document!
include Adafruit_MotorShield.h

//Adafruit_MotorShield AFMS=Adafruit_MotorShield();
Adafruit_MotorShield AFMS=Adafruit_MotorShield();

Adafruit_DCMotor MotorL = AFMS.getMotor(1);
MotorR = AFMS.getMotor(2);

void setup() {
// put your setup code here, to run once:

Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Adafruit Motorshield v2 - DC Motor with ultrasonic sensor!");

AFMS.begin(); // create with the default frequency 1.6KHz

// turn on motor


void loop() {
// put your main code here, to run repeatedly:


But i have on all Motor Pins 0.0V on the Power Pins 7V
The car is not moving!
What is my Problem???
Please help me!

Many, many Thanks

I had the same issue, had to use code from this older library https://playground.arduino.cc/Main/AdafruitMotorShield

Hi Igor,
many many Thanks, this was realy helpful for me. Now it works fine.

looks like the IR module has only one pair of LED and receiver? If the car goes off line, how does it know wheather it should turn left or right?

I'm not an expert or i'd go into lots of detail, but usually there are two mounted, one on either side, to detect which direction you should go. I'm sure there are some helpful youtube videos.

Hi, I have just realized that the tracks cause some friction and load the motors, even the motors are running free (around 100mA without tracks and 400mA with tracks under 6V supply). Do you also have similar results (that is the track connections are tight, squeaky and cause friction) with the tracks?

Also due to unequal friction caused by left and right tracks, the robot does not go straight but slightly steering to one direction. Do you use some encoders or any other method to overcome the steering issue?
Edit: I figured out that the steering issue is caused by speed difference of the motors, somehow even under no load, they have quite big rpm difference, when supplied with the same voltage, even though they are both 1:298 HP metal gearmotors.

Thank you

Comments deleted.

Hi, I am new to this, how do I attach the ultrasonic sensor to the robot without using a breadboard?

Edit: I found a tutorial on how to do this.

Can you please share this Tutorial, i have the same problem?

Thank you very much for this great project. I've successfully printed the robot, but in my case, the master wheels are way to loose on the shafts of the N20-Motors. Does anybody have the same problem? I'm thinking about hotglue, but thats the ugly way I guess...

SMARS modular robot - modified wheels found on #Thingiverse https://www.thingiverse.com/thing:2732013

SMARS modular robot - modified wheels

i was just wondering if any one could give me the programming for the robot with the b and the base preses ultrasonic censer

Hi, there are some examples in the doc_lite folder for more sketches, you can ask in our Facebook community

Wow Really Very Nice Nice Project Many Thanks TO You For Your Hard Work For Making This Great Project . i Want To Make It For My Little Baby Girl Can You Please Share Arduino CODE File ...

Hi, there are some examples in the doc_lite folder for more sketches, you can ask in our Facebook community

Very nice work! Would you like to export source file to STEP? I want to make some changes

Thanks! Unfortunately I can't. My software can export only in stl format

Is it just me or the small thing supposed to hold the mechanical tracks together isn't in the folder ?

They are pieces of 1.75mm filament

I get an error, "WARNING: category 'Device' in library Motor Shield V2.0 is not valid. Setting to 'Uncategorized'. The code uploads and I've tried using a 9volt battery two 3.7volt lithium ion batteries in a series; and the motors still will not move. The motor shield LED comes ON but still no movement. I've even swapped motor shields in case it was defective and still no luck. I measured for voltage at the m1 and m2 terminals and I get 0 volts or either a very small amount of voltage. Also I'm not using a ultrasonic sensor or line sensor. If someone knows what might be wrong please let me know.
Anyways the robot looks awesome! Great design!

Hi, actually I don't know exactly how to solve the problem. Join our Facebook group "SMARS Community" there are a lot of people good at coding

Hello i have the same issue, have you a solution?

I am curious about using the 9V battery the instructions call for. The motors are 6v, if you use a 9v battery on the motor driver the motors are going to be getting 9v. Is anyone experiencing a problem with this?

Would 4-AA batteries or 2-3.7V lipo batteries (like micro-drone batteries) in series be better?

Hi, the motors have a power range from 3 to 9v so it's ok. I choose this option for a space reason but if you want to mount some other batteries out of the chassis, you can do it

My local library has a 3D printer, but only allows jobs up to two hours. How long does this take to print? They have a Lulzbot Mini 3D printer using PLA.

Hi, with my witbox the chassis needs something like 3.5 hours. Then you have to print all the other parts. Maybe if you reduce the printing quality and infill, you can gain some time

Hello !
Great project. I did it myself, but I have a problem with wheel skating.
I used a n20 engine with 200 rpm. Do you have any idea how to solve the problem?

Hi! Congrats for this project.
I have successfully printed, assembled, and programmed on your smark robot. Newbie Question: How do I start it up? Mobile application? Thank you

Hi and thanks! What do you mean?

Sorry for my bad english...
How to move robot? Whith app mobile?

The examples in the doc lite folder are for autonomous mode, you can use Bluetooth or other for remote control. Here there is a Bluetooth example SMARS Bluetooth controler found on #Thingiverse https://www.thingiverse.com/thing:2753343

SMARS Bluetooth controler

Thanks! You are so nice :)

Comments deleted.

This looks like a great project, just starting to get into arduino and raspberry PI and this looks like a great starting project. I have ordered the parts and looking forward to introducing my kids to electronics/programming with it.


When compiling the 'Demo 3' code I get the following error:

error: a function-definition is not allowed here before '{' token
void loop() {distancecm=mdistance(); if(distance<5){digitalWrite(lmotorpin1,LOW); digitalWrite(lmotorpin2,HIGH); digitalWrite(rmotorpin1,LOW); digitalWrite(rmotorpin2,HIGH); delay(1000);
ROBOTULTRASONIC:32: error: expected '}' at end of input
exit status 1
a function-definition is not allowed here before '{' token

But there does appear to be a closing bracket where it should be - anyone have any ideas? The code is just copied in, I haven't messed with it at all.

Thanks, and the robot is awesome by the way, great design :)

It would be nice if this code was on github. I could fix it up and put it there but the source code doesn't have a license notice in it so I am unsure what the license is for the source code. The thing itself is licensed as "Creative Commons - Attribution - Non-Commercial - Share Alike ", but I am unsure if that includes the source code.

Yeah, PDF isn't the best way to distribute source code, the problem is when you cut and paste some lines are getting combined with the comments. If you notice at last a couple of variables, some function calls, and some brackets are hiding in the comments.

I cut/pasted and fixed it up. Attached.

hello great project, and it's my first project with Arduino, someone has the code with ultrasonic sensor and Adafruit Motor ShieldV2 that I can not get it to work thanks

Hi! I just uploaded a sketch for ultrasonic navigation and Adafruit motor shield V2, it's called "SMARS_ultrasonic_demo_AFMS_V2"

Thank you!!!!!! works correctly.

I also have the same problem, Adafruit Motor Shieldv2 can't even rotate the motors. Does any one instruct how it should be used?

Look at the last demo and if you have any trouble, have a look to the official page https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino
there are a lot of useful informations and guides

How did you orient the prints for the wheels for no support?

Hi, I oriented it with the outer part of the wheel on the printer plate

Thanks, my son couldn't be more excited to start printing and tinkering once the electronics get here.

Great, hope you will have a great time during the construction of your SMARS!

If any one needs it, I exported the source files to STP format, (what can be imported into many design tools, like Fusion 360, that is the one I use).

You can find those stp files here: https://drive.google.com/drive/folders/1bvnItFQfnovwakqOwyg-3yzbrTZ6wqTs?usp=sharing

Thank you so much! This is exactly what i needed

How much bigger can it get without significant editing to the original files (how much can i zoom it straight up)? And then, what motor will keep up with the weight gain? What about battery power?

Hello, can we use the analogical pin for US Sensor ? A0-5 on Motor shield ?

Also, did you try to use a 3s LiPo battery (12,6v fully charged) to power it ?

Nope, it's totally out of the power range of the motors

I try it :). Just be carreful to reduce the speed value in arduino file to find tension inferior to 9v on motor shied output :)

There is no regulation from motor shield ? I currently use a 2s lipo for Otto where servo are 5v powered.

https://learn.adafruit.com/adafruit-motor-shield/power-requirements the voltage you give to the motor driver is the one on the motors then you can use the step-down circuit on the arduino to obtain 5v for the servos and the microcontroller

Hello, can we find a wiring diagram for IR sensor ?

Hi, I don't have a diagram for that but it's really simple. Vcc to 5v, gnd to gnd and dout to A1 or A2 (in the demo sketch there are the exact pins

Awesome! Does anyone know if i can control it with one of those bluetooth/wifi controller (like a PS2 controller)?

I could'nt print the chasis :(

When i printing, under wheel not printing :( Should i use support?

For the chassis SL, the supports are needed, only touching the building plate

Comments deleted.

Can your SMARS robot follow a black line, if so with which sensor, and which piece in 3d.
Thanks you.

Votre robot SMARS peut-il suivre une ligne noire, si oui avec quelle capteur, et quelle piéce en 3d.

Hi, yes it can. You need this sensor http://www.dx.com/p/4pin-ir-infrared-obstacle-avoidance-sensor-module-436279?Utm_rid=95945498&Utm_source=affiliate#.WwGgo6XOM0M, the pieces in the guide for the SMARS_SL and the files ir_sensor_a and ir_sensor_b

I am very excited about this project with my daughter. I have printed almost everything. I just have a simple question.
Can I NOT use the motor shield and connect the dc motor to the arduino UNO directly??

I did one arduino based rover before using 2 continuous servo 9g and I did not use any motor shield and is working fine.
Just wondering if I can do away with the motor shield in the SMARS setup. I will be using the regular 9v battery.

Any input will be appreciated.


Hi, unfortunately with this motors you can't. They need something like 200mA and an arduino IO pin can give maximum 40mA. You can do it with the servos because they have s, +and -. SIGNAL (s) is only a control and doesn't require so much current. Learn how to use a motor shield can be really useful for a lot of projects, so I suggest to use one, the adafruit v1 is enough, it's cheap but allow you to control many motors without current problems.

Thanks for your prompt reply. I will take your advice to learn more about the motor shield.

I don't understand is my uno or l298 is bad. As arduino only works when connected with computer (greend light on) and then robot starts moving. Should it have additional wiring for arduino ? By the way nice desing, added bearings to wheels

Are you using the 9v battery configuration? Is the jumper connected? It gives no signals when you use only the 9v battery as power supply?

Yea, just picked a few of different 9V batteries. What's interesting there is no effect if it's connected or not, it is near the power terminal l298.

Mmh try to ask in the community

Hi, at the moment is not possible. An alternative to the suggested motors, are the 28bjy-48 stepper (but they are slow AF) or the sg90 micro servo motors (you have to cut them, modify for 360 rotation and you lose the space for the battery) so my tip is to chose the N20. All the future mods, will be based on this version of SMARS and the compatibility with alternative chassis will not be guarantee.

I've been looking around for code on programming a Keyes IR remote to this, but have not seen anything about how to tell the motor what to do when certain keys are pressed.. Know where I can find a tutorial for this?

This could help: https://learn.sparkfun.com/tutorials/ir-communication then it depends on what motor driver are you using. For the adafruit motor shield v1 and v2 there are functions like "myMotor.run(FORWARD)", you put it in the condition "if(results.value == 0xC284) //if the button press equals the hex value 0xC284
//do something useful here
and so on

Comments deleted.
Comments deleted.

А нет исходников для SolidWorks?

Не сделано мной, может быть, в сообществе кто-то переработал все

The motors indicated are for 6V, will they be OK with the 9V supply?

How is the ultrasonic sensor connected to the development board? what kind of wires should I buy?

That guide is great. I see on his main photo that he has a black and red on off switch. Do you know I can order that?

Sorry I don't know. Korey is a member of our community on Facebook, you can join us and ask directly to him

Можно использовать моторы на 3v 150RPM?

Да, но вы должны кормить их отдельно

Is there a mod out there for the housing for the slightly larger hy-SRF05 ultrasonic sensor?

Comments deleted.

Hi, where can I find the model for the shovel?

I am not quite sure how to connect the IR sensor. I figured out that the EN can be jumpered but I always get ~1020 to 1023 when GND and +5V are connected. It looks like it even works without GND or +5V connected as long as one is connected? Duh?

It should go to 0, it has a digital output

No luck but it isn´t my day as it looks.
I just tried the ultrasonic version you posted here:
with Demo6
and it doesn´t give me any values either. Changed even the arduino. Nothing.
Though I have slightly different sensors HY-SRF05. With additional "out" pin .... yaw...

Demo 6 has been made by a member of the community, I didn't tested it, maybe there is a software error

Got it working for some seconds Trigger on SER1 rightmost pin (10) and Echo on SERVO_2 rightmost pin (9).
However the L2930 on the shield are pretty much crap. Get hot quick and obviously died because one motor stopped turning.
I swapped them and same thing happened. I guess the L298N would do better.

Are your tracks long enough?

It was running "floating" on a block. No chains on the wheels no track to follow. So absolutely no load. I checked the sensor with my hand then. I have a ton of other motor drivers so I´ll try those instead. I don´t like the shield anyway as it blocks all the pins.

Oh sorry for the mistake. Gotta find a way to use your version with the motor shield.

That's odd, have you calibrated the sensor? (take a piece of black tape, put it on a white sheet and turn the trimmer until the output change when you move from white to black and the other way around)

Sadly no significant value changes when turning the trimmer. Always 1016 to 1023. I have 10 of these sensors here and tried the third now. I doubt it is a poblem of the sensor :-/
I´ll give it a try without the motor shield.

You should see the led on the sensor change its status, if you are unsig the sensor I linked, the calibration is quinte hard because it's basically a distance sensor adapted to detect changes of light

Yes I use the one you linked in the youtube video comments. The LED is always green. Does it work better with matte black marks or glossy? I am just curious because it doesn´t give any significant values. The "flickering" between 1016 and 1023 is probably not caused by the light because it also happens if I don´t change the position or the light. The motor shield is not the problem either.

Comments deleted.

Hi, thanks for the very interesting Project.
I have a problem with the mechanical track. Its to short.
16 limbs are too short and do not get these over the tires. 17 are too far.

Does anyone have the problem too?

Hi, if anyone still has this problem. I suggest to try assemble whole track of 16 limbs to one line and then stretch them with two hands section after section. Worked for me a few times. I printed with PETG so could be the case of shorter limbs

Hi and you're welcome, nice to hear that you like it. There are some people with the same problem, one of the solution is to scale the segments to 102% with Cura or similar and print one or more

Yes I have the same problem. I reconstructed the mechanical track for this and made some new ones. Though still need more to print. I attached a file which includes two extended versions. Problem is too much extension makes the chains slide :-(

Hi thanks for the project. This is my first Arduino build. Can you show the specific wiring using the ultrasonic sensor and the Adafruit motor board? Do I need to solder the jumper wires from the sensor to the Uno board since the shield uses the pins? Is there an easier way? Thanks in advance.

Hi and you're welcome. You can use the two servo connectors if you don't want to soldering. Here a little schematics and a demo (I haven't tested it but it should work)

Thanks, that will work!

I'm using this great little robot to help my 6 year old get into robotics, and he is thrilled.

I would also like to create one that works with a Raspberry Pi. Do you know if anyone has created a version for Raspberry Pi? If not I will try to create one and share if I'm successful.

Q: On the mechanical tracks, why is the single hole on the 0.25mm smaller than the double holes? I can't fit 1.75mm filament there, only in the larger holes.

To block the filament. With my printer it works. All the tolerances are of ±0.5mm

Who would have the code for a L293D controller and a sonar ?

Do you need supports for the chassis? Thank you!

If you print them with the outer part on the plate, they are not necessary

Hi, only the "chassis_SL" needs supports (touching building plate)

Great thank you! Is the screwless version only for the wheels? Thanks

Hi ! First, really nice job !
I make right now my first arduino robot (Otto robot) and next i think i will use your SMARS ! it's look amazing !
Please, i have a question :
Whick type/reference of sensor did you use for the following line function ? (to match with the case)
Is it 2 channel sensor ?
Thank you for your feedback :)

Hi and thanks, nice to hear that you like it! The sensor is this one: http://www.dx.com/p/4pin-ir-infrared-obstacle-avoidance-sensor-module-436279?Utm_rid=95945498&Utm_source=affiliate it's a simple ir sensor with analog and digital output, you can mount one, two or three of that depending on the project.

Hi this is great, well done! Where are the pins to connect the track together? Thanks

Hi and thanks! The pins are simply pieces of 1.75mm filament cutted at the right length

This guy has a video of how to do the filament pins on a different tracked robot.

Perfect thank you! I'll be printing the SL model I think. Cheers!

You're welcome! That's great, share a pic of your SMARS once it will be ready!

Comments deleted.

Has that a meaning or are you just spamming on my page?

Can I find a manual how to write a arduino program for the motor shield and a ultrasonic sensor?

Do I need this Motor driver for the ultrasonic demo program, or is it also possible without it when I have the motor shield?

The demo is made for that driver but if you follow the tutorial I sent you yesterday, you can use the motor shield

All Right - thanks for the fast answers :)

Thanks for this nice project. My prints comes out very nice. The problem is that the hole for the motor shaft are not thight enough. Also the holes for the slave wheel and the tracks. The pieces of filamant comes out when the motor is running. I got this problem on all my 3d-printers (3). I am sure that the printers are calibrated. Do you have any tips please? Sorry for my english.

Hi and thanks, nice to know that you liked it. For the master wheel problem there is this solution SMARS modular robot - modified wheels found on #Thingiverse https://www.thingiverse.com/thing:2732013.
For the tracks you can melt the filament so it becomes like a rivet. I didn't understand what's exactly the problem with the slave wheels, do you have the chassis SL or the chassis S?

SMARS modular robot - modified wheels

Thanks for your reply. I will try your tips soon. The hole diameter of the slave wheel for the chassis S looks a little bit to great, but its okay, it works. I have printed both chassis. I like to use chassis SL first. Keep on your great work. Thanks again.

Comments deleted.

Has that a meaning or are you just spamming on my page?

So I'm thinking of remixing this to use a nodemcu with a motorshield (https://pt.aliexpress.com/item/NodeMCU-Development-Kit-NodeMCU-Motor-Shield-esp-wifi-esp8266-esp-12e-esp-12e-kit-diy-rc/32445659965.html).

I'm really a bit of a newb on robotics and electronics so please apoligise me if I'm saying something dumb...

Other than the node, the shield, a 5V power source(to power the nodemcu instead of the 9V battery. NOTE: just saw that a 9V works if plugged to the VIN pin) what would I need to remix the smars?
Note that by using nodemcu the control would be by wifi instead of bluetooth, so I'm aware that I would have to change the arduino code.

Thanks for the help!

Hi, you can make a simple adapter frame to adapt the Arduino's "rails" to the dimensions of that shield. Then for the power supply, if you don't want to use the 9v, you can mount the "3A battery mod" with a boost circuit to obtain 5 volts. Honestly I never worked with WiFi but I think that internet is full of help.

The software part(bluetooth-wifi) i'll manage!
It's the electrical part that I'm still learning!
I've read on the front page that you have 2x45min lessons? Where can I see them? can't seem to find the link anywhere.

Thank you for the help!

I didn't, it was a tip. The lesson plan that I wrote is thought for a 90min lesson or 2 lessons of 45 min.
I'm not a teacher and I don't know exactly if my lesson plan is suitable.
By the way for that mod you don't need big knowledge of electronics, you just need a booster (it turns 4.5v to 5v or more) and it's done. Batteries --> booster--> shield

Is there a way to adapt 28BYJ motor to the chassis? This geared motor is difficult to find.

hi. you can find this mod here:


SMARS - 28BYJ-48
Comments deleted.

Hello, to begin, I wanted to congratulate you for your amazing work. And I have a few questions,
in your documentation, you talk about two different shields for the motors (the big blue one and the small red one). For the project with the IR sensor, is it okay if i use only the small red one ?
And also, do you think that a raspberry would fit in the robot ? Or should I modify the design ? Because I wanted to add some features to the robot

Hi and thanks. Actually it is a choice between one or the other. The blue one is the "easy way" with the red one you have to soldering some wires. At the moment with the available mods, you can mount an Arduino Uno, 2009 or mini or a raspberry pi zero or zero w.For the IR project you can use both but
If you use the red motor driver, you have to use the 3A mod, otherwise there is no place for the driver or you can mount the red driver on a breadboard shield and use a 9V battery

Здравствуйте! Скажите, пожалуйста, можно ли использовать другие моторчики (например 100 об/мин или 200 об/мин)? Спасибо

привет, двигатели под 150RPM хороши, выше, я не знаю, я пробовал с ними с 400 об / мин, но не имел достаточной силы

а если ниже частота вращения, например 100 об/мин?

в этом случае он работает

Ive printed all the parts and very impressed with how its turned out thank you.

However the tracks seem too tight causing to much friction for the motors to turn them. Whats the best way to free them up a bit?

Hi and you're welcome. The tracks are directionals, have you tried to rotate them of 180°? Otherwise I suggest to scale them with Cura or other softwares and print again one segment or more

This is really outstanding. Thank you for doing this. I cant wait to build one!

Thank you and your welcome. Join us in the Facebook group to be updated and share your ideas!

Hi! this project looks so professional! even the documentations looks like a lego kit :)

Is your Idea to upload the cad files? Are there available somewere?


Hi! Thanks, usually I don't spend much time in the documentation but this time I tried to do my best. The source files are available here on Thingiverse, they are in the "source_files.zip" folder. I designed all the parts with Cubify Design, the file format is odd and I don't know if other CAD softwares could open it. Let me know and have a nice Christmas!

can you upload the pen holder & the shovel models please??
thank you in advance.

Hi, I just uploaded the shovel, unfortunately I can't upload the drawing tool because it's not a free model.

Hi, I couldn't fine the shovel STL file!!!
could you tell me where can I find it please??
thank you in advance..

Can you post an example of the software you wrote to operate SMARS

Hi, the examples are in the doc_lite.zip folder

Could you share any video, or how to program it?

I'll try to record something this weekend. For the programming, you just have to download Arduino IDE software from https://www.arduino.cc/ , open a new sketch and paste there the content of one of the demo files in the doc_lite folder. in the sketches there are some explications about what the code does. There are a lot of examples online, you just have to see where are connected the sensors and install the right libraries