0% found this document useful (0 votes)
31 views6 pages

Smart Robotic Car With Bluetooth Connection

IOT PROJECT

Uploaded by

jaunelia33314135
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)
31 views6 pages

Smart Robotic Car With Bluetooth Connection

IOT PROJECT

Uploaded by

jaunelia33314135
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/ 6

SMART ROBOTIC CAR WITH BLUETOOTH CONNECTION

Introduction:
The SMART Robotic Car with Bluetooth Connection is an advanced project that
combines autonomous navigation, a robust security framework, and wireless communication via
Bluetooth. This project leverages microcontroller technology, sensors, and modern software to
create a robotic car capable of navigating on its own while providing robust security against theft
and unauthorized access, and enabling control and monitoring through Bluetooth connectivity.

Objectives:
 Autonomous Navigation: Develop a robotic car that can move and navigate
autonomously.
 Obstacle Detection and Avoidance: Implement sensors to detect and avoid obstacles.
 Smart Security: Integrate a security system to protect the car from theft and
unauthorized access.
 Bluetooth Connectivity: Enable users to control and monitor the car remotely via
Bluetooth.
Hardware Components:
Microcontroller: The brain of the system, responsible for processing inputs and controlling
outputs. Popular choices include Arduino and Raspberry Pi.

Sensors:
 Ultrasonic Sensors: For obstacle detection and avoidance.
 Infrared Sensors: For line tracking and short-range obstacle detection.
 GPS Module: For location tracking and navigation.
 Motor Drivers: To control the motors that drive the wheels.
 Motors: DC or stepper motors to move the car.
 Power Supply: Batteries or a rechargeable power source to power the entire system.
 Chassis: The body of the car, which houses all the components.
 Alarm System: To alert the owner in case of unauthorized access.
 Communication Module: Bluetooth module (e.g., HC-05 or HC-06) for remote
communication.
 GPS Module: For location tracking.
 Bluetooth Module: For wireless communication with the user's device.

Software Components:
Microcontroller Firmware: Written in languages like C/C++ for Arduino or Python for
Raspberry Pi, this software handles sensor data processing, motor control, and communication
with other modules.

 Obstacle Detection Algorithm: Uses data from ultrasonic and infrared sensors to detect
and avoid obstacles.
 Navigation Algorithm: Integrates GPS data to navigate to predefined locations.
 Authentication System: Manages user authentication via RFID/NFC.
 Alarm Control: Activates alarms based on security breaches.
 Surveillance System: Processes and streams video from cameras.
 User Interface: A mobile app developed using frameworks like React Native or Flutter
to control and monitor the car via Bluetooth.
 Bluetooth Communication Protocols: To establish and manage communication
between the car and the mobile app.

Methodology:
 Design Phase: Define the system requirements and specifications. Select appropriate
hardware components and software tools.
 Development Phase: Assemble the hardware components on the chassis. Write and
upload the firmware to the microcontroller. Develop the mobile app for remote control
and monitoring. Implement the obstacle detection and navigation algorithms. Integrate
the security system.
 Testing Phase: Conduct unit testing for individual components. Perform integration
testing to ensure all components work together seamlessly. Conduct field testing to
validate the car’s performance in real-world scenarios.
 Deployment Phase: Deploy the car for real-world use. Provide documentation and user
manuals for operation and maintenance.

Circuit Diagram:
Code:
import RPi.GPIO as GPIO
import time
import bluetooth

# Motor control pins


MOTOR_PINS = {
'left_forward': 17,
'left_backward': 18,
'right_forward': 22,
'right_backward': 23
}

# Ultrasonic sensor pins


TRIG = 24
ECHO = 25

# Set up GPIO mode


GPIO.setmode(GPIO.BCM)

# Set up motor control pins


for pin in MOTOR_PINS.values():
GPIO.setup(pin, GPIO.OUT)
GPIO.output(pin, GPIO.LOW)

# Set up ultrasonic sensor pins


GPIO.setup(TRIG, GPIO.OUT)
GPIO.setup(ECHO, GPIO.IN)

def move_forward():
GPIO.output(MOTOR_PINS['left_forward'], GPIO.HIGH)
GPIO.output(MOTOR_PINS['right_forward'], GPIO.HIGH)
GPIO.output(MOTOR_PINS['left_backward'], GPIO.LOW)
GPIO.output(MOTOR_PINS['right_backward'], GPIO.LOW)

def move_backward():
GPIO.output(MOTOR_PINS['left_forward'], GPIO.LOW)
GPIO.output(MOTOR_PINS['right_forward'], GPIO.LOW)
GPIO.output(MOTOR_PINS['left_backward'], GPIO.HIGH)
GPIO.output(MOTOR_PINS['right_backward'], GPIO.HIGH)
def move_left():
GPIO.output(MOTOR_PINS['left_forward'], GPIO.LOW)
GPIO.output(MOTOR_PINS['right_forward'], GPIO.HIGH)
GPIO.output(MOTOR_PINS['left_backward'], GPIO.LOW)
GPIO.output(MOTOR_PINS['right_backward'], GPIO.LOW)

def move_right():
GPIO.output(MOTOR_PINS['left_forward'], GPIO.HIGH)
GPIO.output(MOTOR_PINS['right_forward'], GPIO.LOW)
GPIO.output(MOTOR_PINS['left_backward'], GPIO.LOW)
GPIO.output(MOTOR_PINS['right_backward'], GPIO.LOW)

def stop():
for pin in MOTOR_PINS.values():
GPIO.output(pin, GPIO.LOW)

def get_distance():
GPIO.output(TRIG, False)
time.sleep(0.1)
GPIO.output(TRIG, True)
time.sleep(0.00001)
GPIO.output(TRIG, False)

while GPIO.input(ECHO) == 0:
pulse_start = time.time()
while GPIO.input(ECHO) == 1:
pulse_end = time.time()

pulse_duration = pulse_end - pulse_start


distance = pulse_duration * 17150
distance = round(distance, 2)

return distance

# Bluetooth setup
server_sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
server_sock.bind(("", bluetooth.PORT_ANY))
server_sock.listen(1)

port = server_sock.getsockname()[1]

bluetooth.advertise_service(server_sock, "SmartCar",
service_id=bluetooth.SERIAL_PORT_CLASS,
profiles=[bluetooth.SERIAL_PORT_PROFILE])

print(f"Waiting for connection on RFCOMM channel {port}")

client_sock, client_info = server_sock.accept()


print(f"Accepted connection from {client_info}")

try:
while True:
distance = get_distance()
if distance < 20:
stop()
time.sleep(1)
move_backward()
time.sleep(2)
stop()
else:
data = client_sock.recv(1024)
if len(data) == 0:
continue

command = data.decode('utf-8').strip()
if command == 'forward':
move_forward()
elif command == 'backward':
move_backward()
elif command == 'left':
move_left()
elif command == 'right':
move_right()
elif command == 'stop':
stop()
else:
print(f"Unknown command: {command}")

except KeyboardInterrupt:
print("Program stopped")
finally:
GPIO.cleanup()
client_sock.close()
server_sock.close()

You might also like