Wiring diagramRemovable link (XT30) · IN → 2S LiPo · +; TB6612FNG driver · VM → Removable link (XT30) · OUT; 5 V converter · IN+ → Removable link (XT30) · OUT; TB6612FNG driver · GND → 2S LiPo · −; 5 V converter · IN− → 2S LiPo · −; 5 V converter · OUT+ → Arduino Nano · 5V; TB6612FNG driver · VCC → 5 V converter · OUT+; FS-iA6B receiver · + → 5 V converter · OUT+; 5 V converter · OUT− → Arduino Nano · GND; FS-iA6B receiver · − → 5 V converter · OUT−; TB6612FNG driver · AO1 → Left motor · 1; TB6612FNG driver · AO2 → Left motor · 2; TB6612FNG driver · BO1 → Right motor · 1; TB6612FNG driver · BO2 → Right motor · 2; TB6612FNG driver · PWMA → Arduino Nano · D5; TB6612FNG driver · AIN1 → Arduino Nano · D7; TB6612FNG driver · AIN2 → Arduino Nano · D8; TB6612FNG driver · PWMB → Arduino Nano · D6; TB6612FNG driver · BIN1 → Arduino Nano · D4; TB6612FNG driver · BIN2 → Arduino Nano · D12; TB6612FNG driver · STBY → Arduino Nano · D9; FS-iA6B receiver · CH1 → Arduino Nano · D2; FS-iA6B receiver · CH2 → Arduino Nano · D3; FS-iA6B receiver · CH3 → MG90S lifter servo · SIG; FS-iA6B receiver · + → MG90S lifter servo · +; FS-iA6B receiver · − → MG90S lifter servo · −Arduino NanoD2D3D5D7D8D6D4D12D95VGNDFS-iA6B receiverCH1CH2CH3+−TB6612FNG driverPWMAAIN1AIN2PWMBBIN1BIN2STBYVCCVMGNDAO1AO2BO1BO2Left motor12Right motor12MG90S lifter servoSIGorange+red−brown5 V converterIN+IN−OUT+OUT−2S LiPo+−Removable link (XT30)INOUT

The battery's “+” only goes through the removable link. The servo plugs into the receiver's CH3; the Arduino doesn't drive it. D2 is the board's digital pin 2, GND is ground. Red wires are power, black ground, the other colours signals (on a real servo the ground wire is often brown). In the steps, what a step adds is in colour and what is already connected in grey.

NewRadio control

We haven't added a photo or video of the finished project yet. Meanwhile, here is the wiring: every wire on the pin the instructions use.

The battery's “+” only goes through the removable link. The servo plugs into the receiver's CH3; the Arduino doesn't drive it.

Your First Combat Robot: a Radio-Controlled Lifter

A small antweight-style combat robot: a FlySky transmitter, two N20 motors, a servo-driven lifter and a LiPo with a removable link. Wiring, code, the transmitter's failsafe and the safety rules for Robo Battle.

Difficulty
Advanced
Time
8 h
Age
14+
Parts
13, 9 on the site

Written by the RoboHub team. A question? Write to us.

Variations

Choose a variation and the parts list updates.

Instructions

  1. The rules and the weight class

    Combat robots fight in weight classes. The most popular for beginners is the antweight: up to 150 g under UK rules and up to 1 lb (454 g) under US rules. Next comes the beetleweight: up to 1.5 kg under UK rules and 3 lb (1.36 kg) under US rules. This guide builds a small robot with wheels, radio control and a servo-driven lifter. Depending on the chassis it comes out at about 150–250 g, so weigh every part. Before Robo Battle or any other event, read the organiser's rules: weight, size, the weapons allowed and the safety requirements are all written there.

  2. The chassis and the weapon

    Make the chassis from a 3D print (PETG or TPU are better than the more brittle PLA), HDPE or polycarbonate: these materials don't shatter when hit. The three common weapon types: Wedge: an angled front plate that gets under the opponent. The simplest and the safest. Lifter: an arm on a servo that lifts the opponent and tips it over. This guide builds this one: a wedge and a lifter together. Spinner: a fast-spinning disc or bar. The most dangerous: it needs a brushless motor, an ESC, a weapon lock and experience, so we don't recommend it for a first robot. Fix the lifter arm to the MG90S's horn and mount the servo so that hits land on the chassis, not on the servo's gears.

  3. The drive

    Fix the two N20 motors with their mounts to the sides of the chassis and push the wheels onto the shafts. The wheels should stand slightly taller than the chassis, so the robot can still drive when it's flipped. Solder wires onto the motors and cover them with heat-shrink: wires get torn off in fights. Solder the header pins onto the Nano and the TB6612 too.

  4. Power and the removable link

    The removable link switches the whole robot off, and most events require one. Mount an XT30 female connector on the chassis where you can reach it. The battery's “+” goes to one of its contacts, and from the other contact a wire runs to the TB6612's VM and the converter's IN+. The link itself is an XT30 male plug with its two pins joined by a short, thick wire: plug it in and the robot is on, pull it out and it's off. The battery's “−” goes to the TB6612's GND and the converter's IN−. Solder an XT30 male connector onto the robot for the battery. Check every polarity twice: a LiPo connected the wrong way round burns the electronics in a second.

    The battery's “+” only goes through the removable link. The servo plugs into the receiver's CH3; the Arduino doesn't drive it. D2 is the board's digital pin 2, GND is ground. Red wires are power, black ground, the other colours signals (on a real servo the ground wire is often brown). In the steps, what a step adds is in colour and what is already connected in grey.

    • Removable link (XT30) IN → 2S LiPo +
    • TB6612FNG driver VM → Removable link (XT30) OUT
    • 5 V converter IN+ → Removable link (XT30) OUT
    • TB6612FNG driver GND → 2S LiPo −
    • 5 V converter IN− → 2S LiPo −
  5. The 5 V rail

    The converter turns the battery's 7.4–8.4 V into a steady 5 V. Connect OUT+ to the Nano's 5V pin, the TB6612's VCC and the receiver's “+”, and OUT− to the Nano's GND and the receiver's “−”. The Nano's VIN isn't used here: its small regulator could not take the servo's current.

    The battery's “+” only goes through the removable link. The servo plugs into the receiver's CH3; the Arduino doesn't drive it. D2 is the board's digital pin 2, GND is ground. Red wires are power, black ground, the other colours signals (on a real servo the ground wire is often brown). In the steps, what a step adds is in colour and what is already connected in grey.

    • 5 V converter OUT+ → Arduino Nano 5V
    • TB6612FNG driver VCC → 5 V converter OUT+
    • FS-iA6B receiver + → 5 V converter OUT+
    • 5 V converter OUT− → Arduino Nano GND
    • FS-iA6B receiver − → 5 V converter OUT−
  6. Motors and driver

    The left motor goes to the TB6612's AO1 and AO2, the right one to BO1 and BO2. Control: PWMA → D5, AIN1 → D7, AIN2 → D8, PWMB → D6, BIN1 → D4, BIN2 → D12, STBY → D9. D2 and D3 stay free for the receiver: they are the Nano's two external interrupt pins.

    The battery's “+” only goes through the removable link. The servo plugs into the receiver's CH3; the Arduino doesn't drive it. D2 is the board's digital pin 2, GND is ground. Red wires are power, black ground, the other colours signals (on a real servo the ground wire is often brown). In the steps, what a step adds is in colour and what is already connected in grey.

    • TB6612FNG driver AO1 → Left motor 1
    • TB6612FNG driver AO2 → Left motor 2
    • TB6612FNG driver BO1 → Right motor 1
    • TB6612FNG driver BO2 → Right motor 2
    • TB6612FNG driver PWMA → Arduino Nano D5
    • TB6612FNG driver AIN1 → Arduino Nano D7
    • TB6612FNG driver AIN2 → Arduino Nano D8
    • TB6612FNG driver PWMB → Arduino Nano D6
    • TB6612FNG driver BIN1 → Arduino Nano D4
    • TB6612FNG driver BIN2 → Arduino Nano D12
    • TB6612FNG driver STBY → Arduino Nano D9
  7. The receiver and the weapon servo

    Each channel on the FS-iA6B has three pins: signal, “+” and “−” (check the label on the receiver). Connect CH1's signal to D2 and CH2's signal to D3. Plug the MG90S's lead straight into CH3 (the orange wire is the signal): the left stick moves the lifter and the Arduino stays out of it. Route the receiver's antennas inside the chassis, away from metal: metal blocks the signal.

    The battery's “+” only goes through the removable link. The servo plugs into the receiver's CH3; the Arduino doesn't drive it. D2 is the board's digital pin 2, GND is ground. Red wires are power, black ground, the other colours signals (on a real servo the ground wire is often brown). In the steps, what a step adds is in colour and what is already connected in grey.

    • FS-iA6B receiver CH1 → Arduino Nano D2
    • FS-iA6B receiver CH2 → Arduino Nano D3
    • FS-iA6B receiver CH3 → MG90S lifter servo SIG
    • FS-iA6B receiver + → MG90S lifter servo +
    • FS-iA6B receiver − → MG90S lifter servo −
  8. The pin table

    Every connection from the steps above, in one table. Key: LINK is the removable link's XT30 socket (1 and 2 are its contacts), BUCK the 5 V converter, RX the receiver, S a signal pin, and M-L and M-R the left and right motors. CH1 steers, CH2 drives forwards and backwards, and PWMA and PWMB set the motors' speed. "-" means the pin isn't used. Check each wire with a multimeter before the first power-up.

    Text
    LiPo 2S +          ->  LINK 1
    LiPo 2S -          ->  TB6612 GND, BUCK IN-
    LINK 2             ->  TB6612 VM, BUCK IN+
    
    BUCK OUT+          ->  Nano 5V, TB6612 VCC, RX +
    BUCK OUT-          ->  Nano GND, RX -
    
    Nano D2            ->  RX CH1 S
    Nano D3            ->  RX CH2 S
    Nano D5            ->  TB6612 PWMA
    Nano D7            ->  TB6612 AIN1
    Nano D8            ->  TB6612 AIN2
    Nano D6            ->  TB6612 PWMB
    Nano D4            ->  TB6612 BIN1
    Nano D12           ->  TB6612 BIN2
    Nano D9            ->  TB6612 STBY
    Nano VIN           ->  -
    
    TB6612 AO1, AO2    ->  M-L
    TB6612 BO1, BO2    ->  M-R
    RX CH3             ->  MG90S (S, +, -)
  9. Set up the transmitter and the failsafe

    An FS-i6X and its FS-iA6B usually come already bound. If not, put the bind jumper on the receiver's B/VCC pins, power the receiver and switch the transmitter on while holding its BIND button. The failsafe is essential: without it the receiver holds the last positions when the signal is lost, and the robot keeps going. On the transmitter open Functions setup → Failsafe. Set CH1 and CH2 with the stick in the middle and CH3 with the lifter down: switch each to On and hold CANCEL to save. If a stick works the wrong way, reverse its channel under Functions setup → Reverse.

  10. Upload the code

    Keep the removable link out while uploading: the Nano runs from USB and the motors can't move. Choose “Arduino Nano” as the board and “ATmega328P” as the processor (“Old Bootloader” if the upload fails). The code only switches the motors on while the transmitter's signal is there and both sticks have been centred, and switches them off when the signal is lost.

    Arduino C++
    // Beginner combat robot (antweight style):
    // FlySky FS-iA6B receiver -> Arduino Nano -> TB6612FNG -> two N20 motors.
    // Right stick (Mode 2, as the FS-i6X ships): CH1 left/right steers, CH2 up/down drives.
    // The weapon servo plugs straight into the receiver's CH3 (left stick); the Arduino only drives the wheels.
    // Safety: the motors stay off until both sticks are centred, and stop when the signal is lost.
    
    const int CH1_PIN = 2;   // receiver CH1 signal (an interrupt pin)
    const int CH2_PIN = 3;   // receiver CH2 signal (an interrupt pin)
    
    // TB6612FNG motor driver
    const int PWMA = 5;      // left motor speed (PWM)
    const int AIN1 = 7;
    const int AIN2 = 8;
    const int PWMB = 6;      // right motor speed (PWM)
    const int BIN1 = 4;
    const int BIN2 = 12;
    const int STBY = 9;      // LOW = both motors off
    const int LED = 13;      // on = armed
    
    const int DEADBAND = 40;   // microseconds around the centre (1500) that count as "stick released"
    const int MAX_PWM = 200;   // 6 V motors on a 2S pack (7.4-8.4 V): keep the average near 6 V
    const unsigned long SIGNAL_TIMEOUT_MS = 100;   // no pulse for this long = stop
    
    // Written by the interrupts, read in loop()
    volatile unsigned long rise1 = 0, rise2 = 0;
    volatile unsigned int width1 = 1500, width2 = 1500;   // pulse widths in microseconds
    volatile unsigned long seen1 = 0, seen2 = 0;          // millis() of the last good pulse
    
    bool armed = false;
    
    void onCh1() {
      if (digitalRead(CH1_PIN) == HIGH) {
        rise1 = micros();
      } else {
        unsigned long w = micros() - rise1;
        if (w >= 900 && w <= 2100) {   // ignore anything that is not a servo pulse
          width1 = w;
          seen1 = millis();
        }
      }
    }
    
    void onCh2() {
      if (digitalRead(CH2_PIN) == HIGH) {
        rise2 = micros();
      } else {
        unsigned long w = micros() - rise2;
        if (w >= 900 && w <= 2100) {
          width2 = w;
          seen2 = millis();
        }
      }
    }
    
    // Both motors at once, -255..255 each (negative = backwards)
    void drive(int left, int right) {
      left = constrain(left, -MAX_PWM, MAX_PWM);
      right = constrain(right, -MAX_PWM, MAX_PWM);
      digitalWrite(AIN1, left > 0 ? HIGH : LOW);
      digitalWrite(AIN2, left < 0 ? HIGH : LOW);
      digitalWrite(BIN1, right > 0 ? HIGH : LOW);
      digitalWrite(BIN2, right < 0 ? HIGH : LOW);
      analogWrite(PWMA, abs(left));
      analogWrite(PWMB, abs(right));
    }
    
    // Stick position from -255 to 255; 0 inside the dead band
    int stick(unsigned int width) {
      int offset = (int)width - 1500;
      if (abs(offset) < DEADBAND) return 0;
      return constrain(map(offset, -500, 500, -255, 255), -255, 255);
    }
    
    void setup() {
      pinMode(STBY, OUTPUT);
      digitalWrite(STBY, LOW);   // motors off from the first moment
      pinMode(PWMA, OUTPUT);
      pinMode(AIN1, OUTPUT);
      pinMode(AIN2, OUTPUT);
      pinMode(PWMB, OUTPUT);
      pinMode(BIN1, OUTPUT);
      pinMode(BIN2, OUTPUT);
      pinMode(LED, OUTPUT);
      pinMode(CH1_PIN, INPUT);
      pinMode(CH2_PIN, INPUT);
      attachInterrupt(digitalPinToInterrupt(CH1_PIN), onCh1, CHANGE);
      attachInterrupt(digitalPinToInterrupt(CH2_PIN), onCh2, CHANGE);
    }
    
    void loop() {
      // Copy what the interrupts wrote, with interrupts paused so nothing changes halfway
      noInterrupts();
      unsigned int w1 = width1, w2 = width2;
      unsigned long s1 = seen1, s2 = seen2;
      interrupts();
    
      unsigned long now = millis();
      bool signalOk = s1 != 0 && s2 != 0 && now - s1 < SIGNAL_TIMEOUT_MS && now - s2 < SIGNAL_TIMEOUT_MS;
      int turn = stick(w1);
      int throttle = stick(w2);
    
      if (!signalOk) {
        armed = false;                       // no radio: stop and disarm
      } else if (!armed && turn == 0 && throttle == 0) {
        armed = true;                        // arm only with both sticks centred
      }
    
      if (!armed) {
        drive(0, 0);
        digitalWrite(STBY, LOW);
        digitalWrite(LED, LOW);
        return;
      }
    
      digitalWrite(STBY, HIGH);
      digitalWrite(LED, HIGH);
      drive(throttle + turn, throttle - turn);   // arcade mixing: stick right = left wheel faster
    }
  11. The first test

    Put the robot wheels-up (on a box, for example). Always switch the transmitter on first and then plug the link in; to switch off, do the opposite: link out first, then the transmitter. Centre both sticks: the Nano's LED lights and the robot is ready. Push the right stick forward: both wheels should turn forwards. If one turns backwards, swap its two wires. Try the lifter with the left stick. Finally switch the transmitter off while the wheels are turning: they must stop and the lifter must drop. Repeat this test before every fight.

  12. If something doesn't work

    The LED doesn't light: is the transmitter on and bound? Are the signal wires on the right pins (CH1 → D2, CH2 → D3)? Has a stick's trim moved so far that the centre is no longer 1500? The robot steers the opposite way to the stick: reverse CH1 on the transmitter (Reverse). The robot creeps with the sticks released: raise DEADBAND (up to 60, say) or re-centre the trim on the transmitter. The Nano restarts during a fight: the battery is flat or a wire is loose. A capacitor across the converter's output (220 µF, for example) helps. The servo buzzes and gets hot: the arm is pushing against something at its end position. Reduce CH3's end points (End points) on the transmitter.

  13. LiPo: charging and storage

    Charge the LiPo only with a balance charger (an IMAX B6AC, for example), in LiPo BALANCE mode, with the right cell count (2S) and at 1C: 0.4–0.5 A for a 450 mAh battery. Never leave it charging unattended, and keep it on a non-flammable surface or in a LiPo fire-safe bag. After a fight, wait until the battery cools down before charging it. Don't let a cell drop below 3.3 V: check the cell voltages with the checker. If the battery won't be used for a few days, bring it to about 3.8 V per cell with the charger's STORAGE mode. Never use a swollen, dented or overheated LiPo.

  14. The arena and match day

    Carry the robot to and from the arena with the link out. Plug the link in only inside the closed arena, when the referee says so, and take your hands away at once. Switch the transmitter on only when it's your turn, and don't use anyone else's channel unless the organiser says otherwise. Wear safety glasses when testing and repairing. At most events the robot goes through a technical check: weight, the link, the failsafe and sharp edges. Read the rules in advance so your robot doesn't fail the check.

  • NewRobotics
    Intermediate4 h12+

    A Mini-Sumo Robot with Arduino Nano

    A small autonomous robot for the mini-sumo class (10 × 10 cm, up to 500 g): it waits 5 seconds after the start, finds the opponent with an ultrasonic sensor and pushes it out of the ring, while sensors underneath watch the white edge so it never drives out itself.

    9/12 parts on the site
  • NewRobotics
    Advanced4 h12+

    A PID Line Follower Robot

    Five infrared sensors measure how far the robot has drifted off the line, and a PID controller corrects the motors smoothly and fast. Built for competitions: the track, the sensor bar, the code and how to tune it.

    8/8 parts on the site
  • Radio control
    Intermediate1 h12+

    Control an Arduino with a FlySky Transmitter

    The FS-iA6B receiver passes every channel of the transmitter to the Arduino over a single wire (i-BUS). That way the transmitter can drive servos, lights or your own robot.

    6/6 parts on the site
4 parts to the cart
258,60 ₾