0% found this document useful (0 votes)
16 views7 pages

Sumo Try

thi is the ultimate guide to make a sumo aurdino robot

Uploaded by

mahe.lemuris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views7 pages

Sumo Try

thi is the ultimate guide to make a sumo aurdino robot

Uploaded by

mahe.lemuris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Components Required:

For the Car (Receiver side):

1. Arduino UNO/Nano (for receiving and controlling the car)

2. Motor Driver (L298N or L293D)

3. 4 DC motors with wheels (for driving the car)

4. 433 MHz RF Receiver Module or NRF24L01 (for receiving signals)

5. Jumper wires

6. Chassis (can be bought or made from plastic)

7. Battery Pack (e.g., 7.4V Li-ion battery or 6 AA batteries)

8. Power Supply for Arduino

For the Controller (Transmitter side):

1. Arduino UNO/Nano (for controlling the car via RF transmission)

2. 433 MHz RF Transmitter Module or NRF24L01 (for sending signals)

3. Joystick Module (for controlling direction: Forward/Backward/Left/Right)

4. Battery Pack (for Arduino)

5. Jumper wires

Step-by-Step Process:

1. Car Receiver Circuit (Receiver Side):

 This circuit will receive commands via the RF receiver module and control the motors
accordingly.

Motor Driver Setup (L298N):

1. DC Motors: Connect the four DC motors to the motor driver.

o Motor A: Connect to OUT1 and OUT2

o Motor B: Connect to OUT3 and OUT4


2. Motor Driver Power: Connect the motor power supply to the motor driver’s VCC (7.4V battery)
and the GND.

3. Arduino to Motor Driver:

o IN1 to pin 2

o IN2 to pin 3

o IN3 to pin 4

o IN4 to pin 5

4. RF Receiver Module (433 MHz):

o Data Pin of the RF module to Arduino pin 6 (or any other digital pin)

o VCC to 5V

o GND to GND

Arduino Code for Car Receiver:

cpp

Copy code

#include <VirtualWire.h>

// Motor Pins

int motorPin1 = 2;

int motorPin2 = 3;

int motorPin3 = 4;

int motorPin4 = 5;

void setup() {

pinMode(motorPin1, OUTPUT);

pinMode(motorPin2, OUTPUT);

pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);

// Initialize RF receiver

vw_setup(2000); // Bits per second

vw_set_rx_pin(6); // Pin for receiving data

vw_rx_start(); // Start receiving

void loop() {

uint8_t msg[4]; // Array to store the incoming message

if (vw_get_message(msg, sizeof(msg))) { // If a message is received

char command = msg[0]; // Get the command (from the transmitter)

if (command == 'F') { // Forward

digitalWrite(motorPin1, HIGH);

digitalWrite(motorPin2, LOW);

digitalWrite(motorPin3, HIGH);

digitalWrite(motorPin4, LOW);

else if (command == 'B') { // Backward

digitalWrite(motorPin1, LOW);

digitalWrite(motorPin2, HIGH);

digitalWrite(motorPin3, LOW);

digitalWrite(motorPin4, HIGH);
}

else if (command == 'L') { // Left

digitalWrite(motorPin1, LOW);

digitalWrite(motorPin2, HIGH);

digitalWrite(motorPin3, HIGH);

digitalWrite(motorPin4, LOW);

else if (command == 'R') { // Right

digitalWrite(motorPin1, HIGH);

digitalWrite(motorPin2, LOW);

digitalWrite(motorPin3, LOW);

digitalWrite(motorPin4, HIGH);

else { // Stop

digitalWrite(motorPin1, LOW);

digitalWrite(motorPin2, LOW);

digitalWrite(motorPin3, LOW);

digitalWrite(motorPin4, LOW);

2. Controller Circuit (Transmitter Side):

 This circuit will send commands (via RF transmitter) to the receiver Arduino, based on the
joystick’s direction.

Joystick and RF Transmitter Setup:

1. Joystick Module:
o X-axis to A0 on Arduino

o Y-axis to A1 on Arduino

2. RF Transmitter (433 MHz):

o Data Pin of the RF module to Arduino pin 12 (or any other digital pin)

o VCC to 5V

o GND to GND

Arduino Code for Transmitter:

cpp

Copy code

#include <VirtualWire.h>

int joyX = A0; // Joystick X-axis

int joyY = A1; // Joystick Y-axis

void setup() {

// Initialize RF transmitter

vw_setup(2000); // Bits per second

vw_set_tx_pin(12); // Pin for transmitting data

pinMode(joyX, INPUT);

pinMode(joyY, INPUT);

void loop() {

int xValue = analogRead(joyX); // Read X-axis of the joystick

int yValue = analogRead(joyY); // Read Y-axis of the joystick


char command = 'S'; // Default: stop

// Forward or backward movement based on joystick X-axis value

if (xValue < 400) {

command = 'F'; // Move forward

else if (xValue > 600) {

command = 'B'; // Move backward

// Left or right movement based on joystick Y-axis value

if (yValue < 400) {

command = 'L'; // Turn left

else if (yValue > 600) {

command = 'R'; // Turn right

// Send the command to the receiver

vw_send((uint8_t*)&command, sizeof(command));

vw_wait_tx(); // Wait for the message to be sent

delay(100); // Small delay

}
3. Final Assembly:

1. Receiver Assembly (RC Car):

o Attach the RF receiver module to the Arduino.

o Connect the motor driver to the motors and the Arduino as described.

o Place the Arduino, motor driver, and receiver on the car chassis.

o Attach the power supply to both the Arduino and motor driver.

2. Transmitter Assembly (Controller):

o Attach the RF transmitter module and joystick to the Arduino.

o Place the Arduino and components in a convenient handheld setup.

o Power the Arduino with a battery pack

You might also like