• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
Circuits Gallery

Circuits Gallery

All about Electronics and Circuits

  • Home
  • Basics
    • Components
    • Wiring
    • Circuitry
    • Oscilloscope
    • Conductivity
  • Project
    • Using 555 Timer
    • Using Op-Amp
  • MicroController
    • PIC
  • Arduino
  • Simulation
  • Digital
  • Communication
  • How To
  • About Us

Object Detecting Android Mobile Phone Controlled Bluetooth Robot Using PIC Microcontroller 16F877A

April 17, 2022 by Charles Clark Leave a Comment

Today I came up with another engineering project for electronics and communication students. It’s an Android mobile phone controlled Bluetooth robot using a PIC microcontroller with object detecting capability. After installing MikroElectron’s Robot Control App from Play Store you should be able to control the robot with your android phone/ tablet over a Bluetooth signal.

The eye-catching feature of this project is the ‘objects detection’ capability with the help of an Ultrasonic sensor. So you don’t have to worry about the robot hitting any object or wall in front of it. The robot will navigate safely without touching any obstacles. Moreover, it will make beep sounds if any obstacle is found and an LCD screen is used to display the distance to the specified object.

Speaking of the hardware, I’ve used PIC16F877A to control the robot, ultrasonic sensor will generate ultrasonic pulses to detect objects and calculate the distance, an LCD screen to display distance, HC-06 / HC-05 Bluetooth module for communicating to the Robot wirelessly.

Well, let’s see how to make a mobile robot for your academic project.

Components for Android Robot

  1. PIC16F877A
  2. L293D IC
  3. 7805 IC
  4. LCD 16×2
  5. Ultrasonic Sensor HC-SR04
  6. Crystal 20MHz
  7. Transistor BC548
  8. Resistor (10Kx2, 1Kx2)
  9. Capacitor (33pfx2, 10uF/16V)
  10. PCB
  11. DC gear motor (100 rpm x 2)
  12. Robot frame and wheels

Circuit Diagram of Bluetooth Controlled Robot

Working Principle of Obstacle Avoidance robot

For simplicity let’s consider this project has 2 parts- the Bluetooth navigation section and an object detection section.

Bluetooth Wireless Navigation

  • HC-06 / HC-05 Bluetooth module is used to receive data from the android based devices.
  • After pairing (connecting) the Bluetooth module with an android phone or tablet, open the application and connect to the paired device HC-06 or HC-05.
  • Android application will send letters ‘F’, ‘B’, ‘R’, and ‘L’ to move the robot forward, backward, right, and left respectively.
  • These are received by the Bluetooth receiver, those letters are available in the TX pin of HC-06.
  • TX pin of Bluetooth module is connected to RX pin (26) of PIC microcontroller, which receives information from the Bluetooth module.
  • That information is used as an interrupt to switch between user-defined functions that we have specified.
  • We have written different functions to perform assigned tasks viz Move forward, backward, turn left, and right. These functions will change the values of pins RC0, RC1, RC2, and RC3. Wheel rotations are controlled by these pins.
  • Here we are using IC L293D to drive the wheel motor, which is capable of driving 2 motors at a time.

Object Detection

  • HC-SR04 ultrasonic sensor is used to measure the distance between object and robot.
  • HC-SR04 ultrasonic sensor has 4 pins- Vcc, Ground, TRIGGER, and ECHO.

  • ECHO is connected to Pin 23 and TRIGGER to Pin 24 of the PIC Microcontroller respectively.
  • Initially, we may trigger the ultrasonic sensor by applying a TRIGGER pulse via Pin 23 of PIC MCU.
  • This will initiate the sensor to transmit out 8 cycles of ultrasonic burst at 40 kHz and then it waits for the reflected ultrasonic burst. When the sensor detects ultrasonic from the receiver, it will set the ECHO pin to high (5V) and delay for a period (width) which is in proportion to the distance.
  • The time difference between transmitted and reflected ultrasonic burst is calculated using the TIMER1 module of PIC.

Distance Calculation

The distance is calculated by the formula-
distance = speed*time/2
Where,
Speed= Velocity of light.
Time= Time between transmitted and reflected waves.

  • The calculated distance is displayed over an LCD display; LCD is driven by PORT B. (Read more about LCD Interfacing with PIC Microcontroller).
  • If the distance is less than 25 cm, the robot will rotate right 90 degrees and produces a beep sound to inform us that an object has been found. This will help to avoid objects and acquire a safe path.
  • Then you have to code it accordingly.

Conclusion

I have used a 12V /1.2Ah rechargeable battery to operate the robot. If you can use a Li-ion or more advanced battery of quite a close capacity it would be much better. Because it is heavy and loses charge on the go for itself.

Filed Under: MicroController, PIC, Project

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

More To See

How Far Can You Run Low Voltage Lighting

How Far Can You Run Low Voltage Lighting? Exploring the Limits of Low Voltage Lighting Installations

What is the Difference between RC Coupling and Transformer Coupling

What is the Difference between RC Coupling and Transformer Coupling? In-Depth Guide

Oscilloscope Probe X1 X10 Difference

Oscilloscope Probe X1 X10 Difference | Detection and Compensation of Probes

How to Measure Amps on 240V Circuit With Multimeter

How to Measure Amps on 240V Circuit With Multimeter | Step-By-Step Guide

More About

  • Arduino
  • Basics
  • Circuitry
  • Communication
  • Components
  • Conductivity
  • Digital
  • How To
  • MicroController
  • Oscilloscope
  • PIC
  • Project
  • Simulation
  • Using 555 Timer
  • Using Op-Amp
  • Wiring

Footer

QUICK LINKS

  • About Us
  • Privacy Policy
  • Terms and Conditions
  • Contact

AFFILIATE DISCLOSER

Circuits Gallery is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for website owners to earn advertising fees by advertising and linking to amazon (.com, .co.uk, .ca etc) and any other website that may be affiliated with Amazon Service LLC Associates Program

© 2023 · Circuits Gallery | All Rights Reserved