Arduino Nano-Controlled Robotic Vehicle with Wireless Communication and Motion Sensing
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates various components to form a system capable of controlling DC motors, interfacing with a motion sensor (MPU-6050), and communicating wirelessly via an NRF24L01 module. An Arduino Nano serves as the central microcontroller, orchestrating the interactions between the components. The L298N motor driver is used to drive two DC motors, and the system is powered by a pair of 18650 Li-ion batteries. Additionally, the circuit includes red and green LEDs, each with a current-limiting resistor, and a rocker switch to control power flow.
Component List
Microcontroller
- Arduino Nano: A compact microcontroller board based on the ATmega328P, featuring digital and analog I/O pins.
Sensors
- MPU-6050: A motion tracking device with a 3-axis gyroscope and a 3-axis accelerometer.
Communication Module
- NRF24L01: A 2.4GHz wireless transceiver module for enabling wireless communication.
Motor Driver
- L298N DC Motor Driver: A dual H-bridge motor driver capable of driving two DC motors or one stepper motor.
Motors
- DC Motor: Two motors that convert electrical energy into mechanical rotation.
Power Supply
- 18650 Li-ion Battery x 2: A pair of rechargeable lithium-ion batteries providing the power source for the circuit.
Indicators
- LED: Two Pin (red)
- LED: Two Pin (green): Visual indicators for signaling the status or events in the circuit.
Resistors
- Resistor (280 Ohms): Two resistors used to limit current through the LEDs.
- Resistor (33k Ohms): A resistor potentially used for pull-up or pull-down configurations.
- Resistor (11k Ohms): A resistor potentially used for pull-up or pull-down configurations.
Switch
- Rocker Switch: A switch to control the power supply to the circuit.
Wiring Details
Arduino Nano
- Digital pins D3, D4, D5, D6, D7 are connected to the L298N motor driver for motor control signals.
- Digital pins D8, D9 are connected to the anodes of the red and green LEDs, respectively.
- Digital pin D10 is connected to the ENB pin of the L298N motor driver.
- Digital pins D11 (MOSI), D12 (MISO), and D13 (SCK) are connected to the corresponding pins of the NRF24L01 module for SPI communication.
- Analog pins A0, A1 are connected to the CE and CSN pins of the NRF24L01 module, respectively.
- Analog pins A4 (SCL), A5 (SDA) are connected to the MPU-6050 for I2C communication.
- Analog pin A3 is connected to a voltage divider network formed by the 33k Ohm and 11k Ohm resistors.
- The 5V pin provides power to the MPU-6050.
- The 3V3 pin provides power to the NRF24L01 module.
- The GND pin is connected to the common ground of the circuit.
MPU-6050
- VCC connected to 5V from the Arduino Nano.
- GND connected to the common ground.
- SCL connected to A4 on the Arduino Nano.
- SDA connected to A5 on the Arduino Nano.
NRF24L01
- VCC (3V) connected to 3V3 from the Arduino Nano.
- GND connected to the common ground.
- CE connected to A0 on the Arduino Nano.
- CSN connected to A1 on the Arduino Nano.
- SCK connected to D13/SCK on the Arduino Nano.
- MOSI connected to D11/MOSI on the Arduino Nano.
- MISO connected to D12/MISO on the Arduino Nano.
L298N DC Motor Driver
- ENA and ENB connected to D3 and D10 on the Arduino Nano for enabling the motor outputs.
- IN1, IN2, IN3, IN4 connected to D4, D5, D6, D7 on the Arduino Nano for motor direction control.
- OUT1, OUT2 connected to one DC Motor.
- OUT3, OUT4 connected to the other DC Motor.
- 5V connected to VIN on the Arduino Nano.
- GND connected to the common ground.
- 12V connected to the positive terminal of the battery through a resistor.
DC Motors
- Each motor has two pins connected to OUT1/OUT2 and OUT3/OUT4 on the L298N motor driver.
18650 Li-ion Battery x 2
- Positive terminal connected to the rocker switch.
- Negative terminal connected to the common ground.
LEDs
- The anode of the red LED connected to D8 on the Arduino Nano, cathode connected to a 280 Ohm resistor to ground.
- The anode of the green LED connected to D9 on the Arduino Nano, cathode connected to a 280 Ohm resistor to ground.
Resistors
- Two 280 Ohm resistors connected to the cathodes of the LEDs.
- One 33k Ohm resistor connected to A3 on the Arduino Nano and to the 11k Ohm resistor, forming a voltage divider.
Rocker Switch
- One terminal connected to the positive terminal of the battery.
- The other terminal connected to the 12V input of the L298N motor driver and the 33k Ohm resistor.
Documented Code
Arduino Nano Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a template and does not contain any functional implementation. It provides the basic structure for an Arduino sketch with setup() and loop() functions. The setup() function is intended for initialization code that runs once, while the loop() function contains code that runs repeatedly, forming the main logic of the program.