How to make a multifunctional smart car using the Arduino Nano R4 board

Hello and welcome back. In this project, we will learn how to make a multifunctional smart car using the Arduino Nano R4 board. It includes four main features: obstacle avoidance, Bluetooth manual control, Bluetooth gesture control, and Bluetooth voice control. You can control everything using our SriTu Hobby app. For Bluetooth communication, I used the HC-05 Bluetooth module, and for obstacle detection, I used an ultrasonic sensor. For this project, I designed a 2WD PCB chassis with JLCPCB. This PCB chassis is specially created for this project, so we don’t need any additional chassis. Therefore, we can connect the components easily.
Arduino Nano R4 board
This project is based on the Arduino Nano R4 board. It mainly uses the RA4M1 series microcontroller from Renesas (R7FA4M1AB3CFM#HA0). This microcontroller has a 48 MHz Arm® Cortex®-M4 processor, which is more powerful than the older Nano boards. It includes 256 kB of flash memory, 32 kB of SRAM, and 8 kB of EEPROM. Because of these specifications, we can use this board for heavy and multifunctional projects like this one.
The Arduino Nano R4 is that it works with 5V logic, which makes it fully compatible with most common sensors and modules, such as the HC-05, ultrasonic sensor, and motor driver modules. It also comes with a USB-C connector, which is faster and more reliable than the old Mini USB.
- More info about the Arduino Nano R4 board — Click on me
Pin diagram of this Arduino Nano R4

Specifications of this board
- Microcontroller R7FA4M1AB3CFM 32-bit Arm® Cortex®-M4
- Frequency 48 MHz
- Internal Memory 256 kB Flash / 32 kB RAM / 8 kB EEPROM
- USB Connectivity USB-C® port for power and data
- Power Input voltage (VIN): 6-21 V / Power via USB-C® at 5 V
- Digital Inputs GPIO (21x – All exposed I/O can be used as digital), PWM (6x)
- Analog Inputs 14-bit ADC (8x)
- Real-time Clock (RTC) Yes (external crystal oscillator included)
- Communication UART (1x), I2C (2x) (5 V over breakout and 3.3 V over Qwiic), SPI (1x), CAN (external transceiver required) (1x)
- Dimensions 18 mm x 45 mm
- Operating Temperature -40 °C to +85 °C
Ok, let’s do this project step by step. The required components are given below.
- Arduino Nano board x 1 — Our Store / Amazon
- HC-05 Bluetooth module x 1 — Our Store / Amazon
- L293D motor driver IC x 1 — Our store / Amazon
- IC base x 1 — Our store / Amazon
- 5mm white LED x 2 — Our store / Amazon
- 100-ohm Resistor x 2 — Our Store / Amazon
- Male header x 1 — Our Store / Amazon
- Barrel jack socket x 1 — Our store / Amazon
- 5V Active buzzer x 1 — Our store / Amazon
- DIP slide switch x 1 — Our store / Amazon
- Two-pin terminal x 2 — Our store / Amazon
- Female header x 2 — Our store / Amazon
- Gear motor x 2 — Our store / Amazon
- 65mm Robot wheel x 2 — Our store / Amazon
- Cater wheel x 1 — Our store / Amazon
- Li-ion battery x 2 — Our store / Amazon
- Li-ion battery holder x 2 — Our store / Amazon
- Jumper wires — Our Store / Amazon
- Servo motor x 1 — Our Store / Amazon
- Ultrasonic sensor x 1 — Our Store / Amazon
Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.
Step 1
Firstly, identify these components.

















Step 2
Secondly, let’s order PCBs for this project.


- Click the “Instant Quote” button and upload the Gerber file, which you can download from the link below.
- Gerber file – Download
- For this project, I ordered five Black PCBs. Next, select the build time and shipping method. Finally, click “Save to Cart” and complete the payment.




Step 3
Now it’s time to open the PCB package.






Step 4
After that, solder all the components onto the PCB.






Step 5
Next, connect the wheels to the gear motors and install them on the bottom side of the chassis PCB.




Step 6
Afterward, attach the caster wheel to the rear side of the chassis.



Step 7
Next, pass the motor wires through the holes and connect them to the motor terminals.




Step 8
Now, install the servo motor and mount the ultrasonic sensor on top of it. Then, connect these components to the chassis.





Step 9
Afterward, connect the L298N motor driver, Arduino Nano R4 board, and Bluetooth module. Then, install the battery holder and plug in the power jack.






Step 10
After that, connect the Arduino Nano R4 to your PC and paste the following code into the Arduino IDE.
- Program — Download
#include <Servo.h>
Servo servo;
int Spoint = 90;
int Lvalue;
int Rvalue;
int dis;
long duration;
#define ENA 5
#define ENB 6
#define IN1 7
#define IN2 8
#define IN3 9
#define IN4 10
#define LED1 11 // Mode LED 1
#define LED2 12 // Mode LED 2
#define Buzzer 13
#define trig A1
#define echo A0
#define Speed 180
char mode = 'S'; // S = Standby, M = Manual, A = Auto
unsigned long previousBlinkTime = 0;
bool ledBlinkState = false;
void setup() {
Serial1.begin(9600);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(Buzzer, OUTPUT);
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);
servo.attach(3);
servo.write(Spoint);
delay(2000);
setLEDStatus(); // Set initial LED state
start(); // Servo animation
}
void loop() {
if (Serial1.available()) {
bluetoothControl(); // Listen for Bluetooth commands
}
if (mode == 'A') {
obstacle(); // Auto mode
}
// Blink LED2 in Standby mode
if (mode == 'S') {
unsigned long currentTime = millis();
if (currentTime - previousBlinkTime >= 500) {
previousBlinkTime = currentTime;
ledBlinkState = !ledBlinkState;
digitalWrite(LED2, ledBlinkState);
}
}
}
int distance() {
digitalWrite(trig, LOW);
delayMicroseconds(4);
digitalWrite(trig, HIGH);
delayMicroseconds(10);
digitalWrite(trig, LOW);
int t = pulseIn(echo, HIGH);
int cm = t / 29 / 2;
return cm;
}
// === Obstacle avoidance ===
void obstacle() {
dis = distance();
if (dis <= 9) {
Stop();
Backward();
delay(50);
Stop();
Lvalue = leftsee();
Serial.println(Lvalue);
Rvalue = rightsee();
Serial.println(Rvalue);
if (Lvalue < Rvalue) {
Right();
delay(300);
Stop();
} else if (Lvalue > Rvalue) {
Left();
delay(300);
Stop();
}
} else {
Forward();
}
}
// === Bluetooth control ===
void bluetoothControl() {
char value = Serial1.read();
Serial.println(value);
if (value == 'U' && mode == 'M') {
Forward();
} else if (value == 'D' && mode == 'M') {
Backward();
} else if (value == 'S' && mode == 'M') {
Stop();
} else if (value == 'L' && mode == 'M') {
Left();
} else if (value == 'R' && mode == 'M') {
Right();
} else if (value == '1') {
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
} else if (value == '2') {
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
} else if (value == '3') {
toggleMode(); // Mode change on '3'
} else if (value == '4') {
digitalWrite(Buzzer, LOW); // Optional buzzer off
}
}
// === Drive functions ===
void Forward() {
analogWrite(ENA, Speed);
analogWrite(ENB, Speed);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
void Backward() {
analogWrite(ENA, Speed);
analogWrite(ENB, Speed);
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
void Stop() {
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
}
void Left() {
analogWrite(ENA, Speed);
analogWrite(ENB, Speed);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
void Right() {
analogWrite(ENA, Speed);
analogWrite(ENB, Speed);
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
// === Startup servo animation ===
void start() {
servo.write(0);
delay(500);
servo.write(180);
delay(500);
for (byte a = 0; a < 5; a++) {
servo.write(50);
delay(100);
servo.write(110);
delay(100);
}
servo.write(Spoint);
}
// === Look left/right ===
int leftsee() {
servo.write(150);
delay(500);
int dist = distance();
delay(500);
return dist;
}
int rightsee() {
servo.write(30);
delay(500);
int dist = distance();
delay(500);
servo.write(Spoint);
return dist;
}
// === Mode toggle ===
void toggleMode() {
if (mode == 'S') {
mode = 'M';
beep(1);
Serial.println("Switched to Manual Mode");
}
else if (mode == 'M') {
mode = 'A';
beep(2);
Serial.println("Switched to Auto Mode");
}
else if (mode == 'A') {
mode = 'M';
beep(1);
Serial.println("Switched to Manual Mode");
}
setLEDStatus(); // Update LED indicators
}
// === LED status based on mode ===
void setLEDStatus() {
if (mode == 'S') {
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW); // Will blink in loop()
} else if (mode == 'M') {
digitalWrite(LED1, HIGH);
digitalWrite(LED2, LOW);
} else if (mode == 'A') {
digitalWrite(LED1, LOW);
digitalWrite(LED2, HIGH);
}
}
// === Buzzer feedback ===
void beep(int count) {
for (int i = 0; i < count; i++) {
digitalWrite(Buzzer, HIGH);
delay(150);
digitalWrite(Buzzer, LOW);
delay(150);
}
}- After that, copy the Arduino R4 board URL and paste it into the Additional Board Manager URLs.
- http://downloads.arduino.cc/packages/package_renesas_index.json
- Then, go to the Board Manager and install the Arduino R4 board package.





- Now, select the board and port. After, click the upload button.



Step 11
Afterward, remove the USB cable and put the batteries into the battery holder, and power on your smart car.



Step 12
After that, download the SriTu Hobby app from the Play Store and install it on your device.
- SriTu Hobby App — Download
- Now, launch the app, navigate to the Controller section, and choose Remote Control.
- Next, click the gear icon and find your device. In this step, make sure to enable location and location permissions. Then, you will see the green indicator icon.


Bluetooth Manual Remote
You are now in manual mode. Press the Right Function button one time to activate the remote. A beep sound will confirm it, and then you can control the car manually. You can also turn the front lights on and off using the Left Function button.

Bluetooth Gesture Remote
Now, switch to Gesture Mode. To do this, click the arrow icon and select Gesture. Then, reconnect the car and activate the remote by pressing the Right Function button. Once done, tilt your phone carefully to control the car.



Bluetooth Voice Remote
Next, switch to Voice Mode by tapping the arrow icon and selecting Voice. Reconnect the car, press the Right Function button to activate the remote, then tap the mic button and give voice commands like forward, backward, left, right, and stop.



Obstacle Avoidance
Next, press the Right Function button twice on any remote. Once you hear two beeps, the car will be ready for obstacle avoidance mode.



Ok, enjoy your project! The full video guide is below. We hope to see you in the next project. Have a great day!
How to make a multifunctional smart car using the Arduino Nano R4 board