BLUETOOTH CONTROLLED FIRE ROBOT

Photo of author

By Jackson Taylor

Home » Electronics Topics » Arduino » BLUETOOTH CONTROLLED FIRE ROBOT

As an Amazon Associate we earn from qualifying purchases.

A Bluetooth controlled fire robot is a small wheeled vehicle that you drive from a phone and that can also detect a flame and help put it out. It is a good microcontroller project because it combines motor control, serial communication and sensor input in one build. This version uses a PIC16F877A microcontroller and is programmed in HITECH C.

The video below shows the project in action. The rest of this article explains how the system is put together, so you can build your own or adapt the idea.

How the Bluetooth fire robot works

The robot has three main jobs:

Hardware Hack

Stop Buying New Batteries for Your Tech

Electronics are expensive, but their power sources don't have to be. Discover the simple engineering trick to recondition dead batteries and bring your gadgets back to 100% capacity.

Watch the Free Video
  • Receive commands. A Bluetooth module on the robot connects to your phone and passes the commands you send to the microcontroller.
  • Drive the motors. The PIC16F877A reads each command and switches the drive motors to move forward, backward, left, right or stop.
  • Fight a fire. A flame sensor detects a nearby fire, and the microcontroller switches on a small pump or fan to put it out.

Because the robot is driven by a person, you stay in control of where it goes. The flame sensor and the extinguishing part are extras that make it a fire robot instead of a plain remote car. If you only want the driving part, start with a basic Bluetooth controlled robot and add the fire features later.

Components you need

Exact parts vary from build to build, but a typical list looks like this:

  • PIC16F877A microcontroller with a crystal oscillator and its support parts
  • Bluetooth serial module, such as the HC-05
  • Motor driver, such as an L293D, or an H-bridge of your choice
  • Two DC geared motors with wheels, plus a caster or a third wheel
  • Flame sensor module (these respond to infrared light from a flame)
  • Small water pump or a fan, with a transistor or relay to switch it
  • Regulated 5 V supply for the logic and a battery suited to the motors
  • Android phone with a Bluetooth serial terminal or controller app
  • Programmer for the PIC and the HITECH C compiler, normally used with MPLAB
See also
Arduino ,bluetooth/pc and triac based speed control of ac home fan

Circuit overview

Bluetooth module to the PIC

The PIC16F877A has a built-in hardware USART, which is what makes serial communication simple. The Bluetooth module’s TX pin goes to the PIC’s RX pin (RC7), and the module’s RX pin goes to the PIC’s TX pin (RC6). Share a common ground between the two. Most Bluetooth modules default to 9600 baud, so set the PIC’s serial speed to match.

Check your module’s datasheet for its supply and signal voltage. Many HC-05 breakout boards accept 5 V power but have 3.3 V logic on their RX pin, so a simple resistor divider on that line is a sensible precaution.

Motor driver

Do not connect motors straight to the microcontroller pins. They draw far more current than a pin can supply. Connect the motor driver’s input pins to four PIC output pins, and give the motors their own supply path. Join the grounds of the battery, driver and microcontroller.

Flame sensor and extinguisher

Most flame sensor modules have a digital output that changes state when they detect a flame, and many also have an analog output. Connect the digital output to a PIC input pin. The pump or fan is switched by a transistor or relay driven from another output pin, with a flyback diode across any inductive load.

Before building on a breadboard, you can simulate the circuit in Proteus to check the logic.

Pairing the phone with the robot

Power the robot, then open your phone’s Bluetooth settings and look for the module’s name. Select it and enter its pairing PIN. The usual defaults are 1234 or 0000, but check your module’s documentation. Our guide to pairing the HC-05 module covers the steps in more detail.

Once paired, open a Bluetooth terminal or controller app, connect to the module and send single characters. These characters are what the PIC will read.

Program logic in HITECH C

The firmware is a simple loop. It does not matter which characters you pick, as long as the app and the code agree. For example:

Sustainable Tech

Keep Toxic E-Waste Out of Landfills

Don't throw away your failing laptop, phone, or car batteries. Learn how to recondition them at home in just a few hours. It's better for the planet—and your wallet.

Learn How It Works
  1. Configure the USART for the module’s baud rate and enable receiving.
  2. Set the motor and pump pins as outputs and the flame sensor pin as an input.
  3. Wait for a character from the Bluetooth module.
  4. Use a switch statement to act on it, such as F for forward, B for backward, L for left, R for right and S for stop.
  5. Check the flame sensor. If it detects a flame, switch on the pump or fan, and switch it off when the flame is gone.
  6. Return to step 3.
See also
Monitor and Control of Greenhouse Environment -simulation in proteus using arduino

Check the flame sensor on every pass of the loop, so the robot responds even when no command is arriving. You can also add a command to switch the pump on manually, which is useful for testing.

Testing and troubleshooting

  • No response from the robot: check that the TX and RX lines are crossed correctly and that the baud rates match.
  • Motors twitch or the PIC resets: motors can cause voltage dips. Use a separate supply for them, add decoupling capacitors, and make sure the grounds are common.
  • Wrong direction: swap the two wires of that motor.
  • Flame sensor triggers all the time: sunlight and some lamps give off infrared. Adjust the sensor’s sensitivity potentiometer and test away from direct light.
  • Phone cannot connect: make sure the module is not already connected to another device, then re-pair it.

Safety

Test the extinguishing part only with a small, controlled flame such as a candle, on a non-flammable surface and with a proper extinguisher nearby. Keep water away from the electronics, and mount the pump and its tank so a spill cannot reach the circuit board. This kind of robot is a learning project and does not replace smoke alarms or fire safety equipment.

Ideas to extend the project

  • Add a second or third flame sensor, pointing in different directions, so the robot can work out where the fire is.
  • Make it drive toward the flame on its own, as in a fire fighting robot, with Bluetooth as a manual override.
  • Add an ultrasonic sensor for obstacle detection.
  • Try a different chassis, such as a step climbing robot, for rougher floors.

FAQ

Why use a PIC16F877A for this project?

It has enough I/O pins for the motors, sensor and pump, and a built-in USART for talking to the Bluetooth module. It is also widely documented, which makes it suitable for learning.

Can I use an Arduino instead?

Yes. The design is the same: serial input from the Bluetooth module, motor driver outputs and a flame sensor input. Only the microcontroller and the programming language change.

See also
Printing string ,variable and constant

Which Android app should I use?

Any Bluetooth serial terminal or controller app that can send single characters will work. Just make sure the characters it sends match the ones in your code.

How far does the Bluetooth control reach?

Common modules like the HC-05 are class 2 devices, which are typically rated for around 10 metres in open space. Walls and other obstacles reduce that range.

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works