
How to Assemble M1 Mini Sumo Robot?
In this article, we will assemble M1 mini sumo robot kit together. This robot model is very popular amongst beginner to moderate robot makers with versatility. Based on Arduino nano platform it is highly developable. But before development we need to assemble 🙂 In that article you will find all tips and tricks of M1 assembly and development.
What is included in mini sumo robot kit?
- Genesis Mainboard
- Micro Gear Motors x 2
- M1 Chassis Plates
- QTR1A Line Sensors
- MR45 Opponent Sensors
- Lipo Battery
- Motor Wires (Red & Black)
- Crimping Pins & Shrink Fits
- Assembly Hardware.
- Thin front Blade.
- MicroStart & Remote
What wil you need?
- Soldering tool & solder
- Miniature Plier
- Philips (+) screwdriver
- Double Sided Tape
- Silicone Gun
- Diagonal Cutter Plier
- Power Supply (optional)
For assembling we usually prefer assembling from bottom to top. So first we will attach motors to bottom base. I will solder motor terminals with black & red cables.
For attaching I will use 2 motor brackets and fit motors vertical.
After attaching motors to robot body. We will put QTR1A Line sensors to bottom side of chassis. For this we will cut female jumper pns from one side and solder to the pads. For soldering you don’t need to pass thorugh hole. Just add little solder to both pad and cable. And use tip of soldering tool to piece together.
And for attaching sensor boards to bottom, we are using double sided tapes. As metal surface and sensor backside is flat this double sided tapes hold sensor very strong.
Ater that, we will contiune robot assembly by attaching MR45 sensors with 20mm length M3 screws (6 Pieces) and 5 Standoffs (20mm Length Models).
One small important thing is here, we are attaching sensor screws from bottom, because standoff nuts and sensor holes are very near. For minimizing touch of both parts we reverse place sensor screws.
When sensor and standoff assembly finished, we are attaching SLT20 wheels to robot body. For this purporse we will use allen wrench. This screwing hole should face to motors shafts flat side (Motor shafts are D like section not circular).
Please do not use too much force for tightening.
Now we can go to top plate. This is little thinner body part which attached to bottom plate and also attachs the Genesis Robot Controller.
Before assembling both plates first we need to screw small standoffs to top plate. I am using 4 short standoffs (8mm). Again this standoffs will be placed reverse for making clearence to wheels from bottom.
Now we will assemble both plates.
For this assembly please also add your lipo battery to middle part and close with top plate. Sensor cables can go thorugh front spaces of top plate and motor cables should pass from back middle space.
After that you can screw your Genesis Mainboard with M3 nuts too.
Now we can pass to crimping. This will require little hand skill with miniature pliers.
Now we can connect our motors and power cables to Genesis Mainboard.
Here the table for attaching sensors to Genesis Mainboard, we are using 5 inputs of total 8 free inputs.
Sensors | Pin Number |
Left Bottom Line Sensor (QTR1A) | A0 |
Right Bottom Line Sensor (QT1A) | A1 |
Left Opponent Sensor | A2 |
Middle Opponent Sensor | A3 |
Right Opponent Sensor | A4 |
After looking this table, you may think about why all of them is connected to analog pins.
Actually we are only using line sensors as analog and opponents sensors are read digital. With declaring A2, A3, A4 ad digital input we can use them as same as digital pin of Arduino. Excep A6 and A7 all analog pins can be used as digital I/O too.
If all assembly is ready now we can attach power to robot.
If you have power supply I suggest first attaching power from it not battery. Because if you soldered or attached something wrong. Power supply can limit the current and you can protect your circuit. If you don’t have now please check your all connections again. And be careful to polarity of battery.
Now you can attach your Arduino Nano to computer and program first forward code to robot, below. This code will continously drive motors forward.
In some computers, Arduino nano controller is not recognised when attached to Genesis. If this happens please remove Arduino nano from board, program it and again attach to mainboard.
//MOTOR CONTROL PINS
int RPwm = 11;
int RDir = 13;
int LPwm = 3;
int LDir = 12;
void setup() {
pinMode(RPwm, OUTPUT);
pinMode(RDir, OUTPUT);
pinMode(LPwm, OUTPUT);
pinMode(LDir, OUTPUT);
}
void loop() {
digitalWrite(LDir, HIGH);
analogWrite(LPwm, 255);
digitalWrite(RDir, HIGH);
analogWrite(RPwm, 255);
}

After uploading this code, both motors should turn forward. If one of them or both turns backward we will simply reverse motor cables.
And here is the full mini sumo robot code below:
// GENESIS BOARD MINI SUMO ROBOT PROGRAM
//FOR 3 OPPONENT SENSOR, 2 EDGE SENSOR
// JSUMO 01/2020
///////////////////////////////////////
//MOTOR CONTROL
int RPwm = 11;
int RDir = 13;
int LPwm = 3;
int LDir = 12;
//LED & BUZZER
int Buzzer = 9;
int ArduLed = 8;
//EDGE & CONTRAST SENSORS
int Redge = A0;
int Ledge = A1;
//TRIMPOTS
int SPD = A7;
int TRN = A6;
//OPPONENT SENSORS
int LSens = A4;
int RSens = A2;
int MSens = A3;
int LFSens = A5;
int RFSens = 4;
// DIPSWITCH & BUTTON
int Button = 10; // Can be used as start pin too.
int DS1 = 5;
int DS2 = 6;
int DS3 = 7;
//VALUES
int Speed =50;
int MaxSpeed = 80; // Idle Speed while no sensor giving data.
int TurnSpeed = 65; // Left and Right Forward Turning Speed
int EdgeTurn = 150; // Turning Time variable when minisumo sees white line
int Duration; // Turning Time at minisumo starting.
int LastValue = 5; // Last Value Variable for remembering last Opponent sensor sense.
void setup()
{
pinMode(LSens, INPUT); // Left Opponent Sensor Input
pinMode(RSens, INPUT); // Right Opponent Sensor Input
pinMode(MSens, INPUT); // Middle Opponent Sensor Input
pinMode(Buzzer, OUTPUT); // Buzzer Declared as Output
pinMode(ArduLed, OUTPUT); // Buzzer Declared as Output
pinMode(Button, INPUT); // Buzzer Declared as Output
pinMode(RPwm, OUTPUT); // Four PWM Channel Declared as Output
pinMode(RDir, OUTPUT);
pinMode(LPwm, OUTPUT);
pinMode(LDir, OUTPUT);
digitalWrite(Buzzer, LOW); // Buzzer Pin Made Low for Silence 🙂
digitalWrite(ArduLed, LOW); // Arduino Mode Led Made Low
digitalWrite(DS1, HIGH); // 3 Dipswitch Pin Pullups Made
digitalWrite(DS2, HIGH);
digitalWrite(DS3, HIGH);
digitalWrite(LSens, HIGH); // Opponent Sensor Pullups Made
digitalWrite(RSens, HIGH);
digitalWrite(LFSens, HIGH);
digitalWrite(RFSens, HIGH);
digitalWrite(MSens, HIGH);
Serial.begin(9600);
}
//Motor Control Function
void Set_Motor (float Lval, float Rval, int timex){
Lval = Lval*2.5;
Rval = Rval*2.5;
if (Lval >=0) {
analogWrite(LPwm, Lval);
digitalWrite(LDir, LOW);
} else {
Lval=abs(Lval);
digitalWrite(LDir, HIGH);
analogWrite(LPwm, Lval);
}
if (Rval >=0) {
analogWrite(RPwm, Rval);
digitalWrite(RDir, HIGH);
} else {
Rval=abs(Rval);
digitalWrite(RDir, LOW);
analogWrite(RPwm, Rval);
}
//If you want to see Speed Values please uncomment bottom line.
// Serial.print(Rval); Serial.print(“-“); Serial.println(Lval);
delay(timex);
}
void loop() {
digitalWrite(RPwm, LOW);
digitalWrite(LPwm, LOW);
tone(Buzzer, 18, 100); // Pin, Frequency, Duration
//////////////////////////////////////////////
// This function below, used for stopping robot while no button is pushed or Microstart is not triggered.
while (digitalRead(Button)==0) {
Serial.println(“Button Press Waited”);
Set_Motor(0,0,1);
/// Sensor Control While Waiting The Button Press ///
if ( digitalRead(MSens)==LOW || digitalRead(RSens)==LOW || digitalRead(LSens)== LOW || digitalRead(RFSens)==LOW || digitalRead(LFSens)== LOW || analogRead(Redge)< 100 || analogRead(Ledge)< 100 ) { digitalWrite(ArduLed, HIGH);}
else { digitalWrite(ArduLed, LOW); }
}
///////////////////////////////////////////////
if (digitalRead(Button)==1) {
Duration=(analogRead(TRN)/5); // Duration variable based on TRN (A6) trimpot
Duration=205-Duration; //
Serial.println(“5 Sec Routine Started”);
for (int i = 0; i < 5; i++){ digitalWrite(Buzzer, HIGH); digitalWrite(ArduLed, HIGH); delay(100); digitalWrite(Buzzer, LOW); digitalWrite(ArduLed, LOW); delay(900); }
if (digitalRead(DS1)==0 && digitalRead(DS2)==1 && digitalRead(DS3)==1){
Serial.print(“LEFT TURN”);
Set_Motor(-100,100,Duration); //
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==0 && digitalRead(DS3)==0) {
Serial.print(“MIDDLE DIRECT”);
Set_Motor(80,80,2);
}
else if (digitalRead(DS1)==1 && digitalRead(DS2)==1 && digitalRead(DS3)==0){
Serial.print(“Sag”);
Set_Motor(100,-100,Duration);
}
else if (digitalRead(DS1)==1 && digitalRead(DS2)==0 && digitalRead(DS3)==0){
Serial.print(“Left Circle”);
Set_Motor(100,36,650);
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==0 && digitalRead(DS3)==1){
Serial.print(“Right Circle”);
Set_Motor(36,100,650);
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==1 && digitalRead(DS3)==0){
Serial.print(“Reverse 180”);
Set_Motor(-100,100,Duration*2); // One Duration time is for 90 degree, so we multiply by 2.
}
Serial.print(“OK”);
digitalWrite(Buzzer, LOW);
EdgeTurn=(analogRead(TRN)/5); // Raw value comes with 0 to 1023, we divide it for 0 t0 205 mS turning time.
EdgeTurn=205-EdgeTurn; //
}
//Main Loop
while(1) {
/// Edge Sensor Control Routine ///
digitalWrite(ArduLed, LOW);
if (analogRead(Ledge)<300 && analogRead(Redge)> 300) {
digitalWrite(Buzzer, LOW);
digitalWrite(ArduLed, HIGH);
Set_Motor(-100, -100,55); // Backward for 55 mS.
Set_Motor(-100, 100, EdgeTurn); // Left Backward, Right Forward, Turning Time Based on ETRN Trimpot
LastValue=5;
}
else if (analogRead(Ledge)> 300 && analogRead(Redge)< 300) {
digitalWrite(Buzzer, LOW);
digitalWrite(ArduLed, HIGH);
Set_Motor(-100, -100,55); // Backward for 55 mS.
Set_Motor(100, -100, EdgeTurn); // Right Backward, Left Forward, Turning Time Based on ETRN Trimpot
LastValue=5;
}
else if (analogRead(Ledge)< 300 && analogRead(Redge)< 300) {
digitalWrite(Buzzer, LOW);
digitalWrite(ArduLed, HIGH);
Set_Motor(-100, -100,55); // Backward for 55 mS.
Set_Motor(100, -100, EdgeTurn); // Right Backward, Left Forward, Turning Time Based on ETRN Trimpot
LastValue=5;
}else
/// Opponent Sensor Control Routine ///
// Please uncomment below line if yu are using microstart, When microstart gives 0V it will stop motors.
//while (digitalRead(Button)==LOW) {Set_Motor(0, 0, 20); digitalWrite(Buzzer, HIGH); LastValue=3;} digitalWrite(Buzzer, LOW);
if (digitalRead(MSens)==LOW) {Set_Motor(MaxSpeed, MaxSpeed,1); digitalWrite(Buzzer, HIGH); LastValue=5;} else
if (digitalRead(LSens)== LOW) {Set_Motor(-40, TurnSpeed,1); digitalWrite(Buzzer, HIGH); LastValue=7;} else
if (digitalRead(RSens)==LOW) {Set_Motor(TurnSpeed, -40,1); digitalWrite(Buzzer, HIGH); LastValue=3;} else
if (digitalRead(LFSens)== LOW) {Set_Motor(-40, TurnSpeed,1); digitalWrite(Buzzer, HIGH); LastValue=7;} else
if (digitalRead(RFSens)==LOW) {Set_Motor(TurnSpeed, -40,1); digitalWrite(Buzzer, HIGH); LastValue=3;} else
{
digitalWrite(Buzzer, LOW);
Speed=(analogRead(SPD)/10.3); // This raw speed value comes with 0 to 1023 so we divide to 10.3 After that it is 0 to 99 integer.
Speed=100-Speed; // This is used for reversing trimpot dial direction at board.
if (LastValue==5) { Set_Motor(Speed, Speed,1);} else // Forward, Based on SPD (A7) Trimpot
if (LastValue==7) { Set_Motor(-20, Speed,2);} else // Left Turning Based on SPD (A7) Trimpot
if (LastValue==3) { Set_Motor(Speed, -20,2);} // Right Turning Based on SPD (A7) Trimpot
}
}
}
So, What this robot code does?
The code above is mini sumo robot code for 3 opponent sensor (we attached MR45s) and 2 line sensor (QTR1As). First we declare every input, output with special names.And in setup function, we declare this names (dedlared as Arduino Pin numbers) if they are input or output.
Also in the code you will see some special function written as Set_Motor. Normally for controlling speed and direction of DC motors we are using 2 digital pin for every motor. (1 for PWM speed Control, 1 for Direction Control). With that Set_Motor function we are controlling motors more clearly.
For instance when I write Set_Motor(100,100,50); That means Left and Right Motor Speed %100 (Actually 250/255) speed forward for 50 milliseconds (0.05 Second, very short duration). If I write Set_Motor(-30,80,700) means left motor %30 backward, right motor %80 forward for nect 700 milliseconds (0.7 Second). Simple 🙂
Now if we come to main loop, first it waits until button is pressed or start module is triggered (Both option gives logic 1). So while receiving digital 0 we stop motors and also at sametime inside loop, we control sensors with if statement.
When button is pushed or start module triggered it jumps to dipswitch tactics. At Genesis mainboard we are using 3 position red dipswitch for choosing tactics. If you are not certain bout where is tactics, I am pasting below.
if (digitalRead(DS1)==0 && digitalRead(DS2)==1 && digitalRead(DS3)==1){
Serial.print(“LEFT TURN”);
Set_Motor(-100,100,Duration); //
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==0 && digitalRead(DS3)==0) {
Serial.print(“MIDDLE DIRECT”);
Set_Motor(80,80,2);
}
else if (digitalRead(DS1)==1 && digitalRead(DS2)==1 && digitalRead(DS3)==0){
Serial.print(“Sag”);
Set_Motor(100,-100,Duration);
}
else if (digitalRead(DS1)==1 && digitalRead(DS2)==0 && digitalRead(DS3)==0){
Serial.print(“Left Circle”);
Set_Motor(100,36,650);
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==0 && digitalRead(DS3)==1){
Serial.print(“Right Circle”);
Set_Motor(36,100,650);
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==1 && digitalRead(DS3)==0){
Serial.print(“Reverse 180”);
Set_Motor(-100,100,Duration*2); // One Duration time is for 90 degree, so we multiply by 2.
}
Additional Informations
How to clean wheel surfaces?
We are using standart alcohol based cleaners like cologne. Clean wheels dramatically change robot’s performance to better so always use cleaners after every match.
Where can I order M1 Mini Sumo Robot Kit?
We have ready stocks in our JSumo Shop:
https://www.jsumo.com/m1-arduino-mini-sumo-robot-kit-unassembled
soldering robo
It’s a great content !