The PIR Sensor control in the BlueBot app is a cutting-edge feature designed to detect motion and display real-time data seamlessly. With customizable threshold values and five different alarm sounds, this feature elevates motion detection to a new level of user interactivity. Whether you’re securing your home or monitoring a space, the PIR Sensor control in the BlueBot app ensures convenience and reliability.

Table of Contents
Features of the BlueBot Controller App
- Simple Command Interface: Easily send commands like “ON” and “OFF” to control devices.
- Customizable Buttons: Create custom commands to suit your project needs.
- Real-Time Control: Instantly see the results of your actions.
- Compatibility: Works seamlessly with Arduino and Bluetooth modules like HC-05 and HC-06.
How to Download the BlueBot Controller App
To get started, download the BlueBot Controller App from the official source:
Make sure you have a Bluetooth-enabled smartphone to pair with your project.
What is the PIR Sensor Control in the BlueBot App?
The PIR Sensor control in the BlueBot app uses a Passive Infrared (PIR) sensor to detect motion by measuring infrared radiation changes in its environment. Whenever motion is detected, the sensor sends a signal to the BlueBot app, triggering alerts based on the user-defined threshold values. Users can enjoy real-time feedback, and when motion surpasses a certain threshold, the app activates one of the five pre-set alarm sounds.
Code Implementation for the PIR Sensor Control in the BlueBot App
Below is the code for the implementation of the PIR Sensor control in the BlueBot app, including motion detection, real-time Bluetooth data transmission, and alerts:
#include <SoftwareSerial.h>
// Bluetooth module connections
const int bluetoothTx = 2; // HC-05 TXD to Arduino RX (via SoftwareSerial)
const int bluetoothRx = 3; // HC-05 RXD to Arduino TX (via SoftwareSerial)
// PIR sensor pin
const int pirSensorPin = 4; // The pin where the PIR sensor is connected
// SoftwareSerial for Bluetooth
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup() {
// Initialize Serial Monitor
Serial.begin(9600);
// Initialize Bluetooth communication
bluetooth.begin(9600);
// Initialize PIR sensor pin
pinMode(pirSensorPin, INPUT);
// Initialize built-in LED for status indication
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// Read PIR sensor value (motion detection)
int pirStatus = digitalRead(pirSensorPin);
// Motion detected (sensor HIGH)
String motionStatus = "No Motion Detected";
int fillPercentage = 0;
if (pirStatus == LOW) {
motionStatus = "Motion Detected";
fillPercentage = 100; // Full if motion detected
digitalWrite(LED_BUILTIN, HIGH); // Turn on LED when motion is detected
} else {
digitalWrite(LED_BUILTIN, LOW); // Turn off LED if no motion
}
// Prepare data for Bluetooth (motionStatus and fillPercentage)
String data = motionStatus + ";" + String(fillPercentage);
// Send data to Bluetooth
bluetooth.println(data);
// Print data to Serial Monitor for debugging
Serial.println(data);
// Delay for stability
delay(500);
}
Code Explanation
The code for the PIR Sensor control in the BlueBot app is simple yet powerful. It integrates the PIR sensor with the HC-05 Bluetooth module to send real-time data about motion detection to the app.
Key Components in the Code
- Bluetooth Module Setup
- The HC-05 Bluetooth module communicates with the Arduino via software serial communication.
- Pins
2
(TX) and3
(RX) are used for sending and receiving data. - The
SoftwareSerial
library is used to create an additional serial port for the Bluetooth module.
- PIR Sensor
- The PIR sensor is connected to pin
4
. - It detects motion by sensing infrared radiation changes.
- The
digitalRead
function is used to check the sensor’s output (HIGH or LOW).
- The PIR sensor is connected to pin
- LED Status Indicator
- The built-in LED is configured as an output to indicate motion detection visually.
- When motion is detected, the LED is turned on (
digitalWrite(LED_BUILTIN, HIGH)
); otherwise, it remains off.
- Motion Status and Data Transmission
- When motion is detected, the
motionStatus
is updated to “Motion Detected,” and afillPercentage
of 100% is assigned. - Data (motion status and activity percentage) is transmitted via the HC-05 module to the BlueBot app using the
bluetooth.println()
function. - This data can be displayed on the app in real time.
- When motion is detected, the
- Debugging with Serial Monitor
- The
Serial.println()
function prints the same data to the serial monitor for debugging purposes.
- The
- Delay
- A
delay(500)
ensures the loop runs every 500 milliseconds, giving the system enough time to process each cycle.
- A
Features of the PIR Sensor Control in the BlueBot App
- Real-Time Motion Detection
The PIR Sensor control in the BlueBot app provides instant feedback whenever motion is detected. Users can view the motion status (“Motion Detected” or “No Motion Detected”) and monitor the percentage of activity dynamically. - Custom Threshold Values
With the ability to set specific sensitivity levels, users can tailor the PIR Sensor control in the BlueBot app to their environment. This is especially useful for distinguishing between minor movements and significant motion events. - Five Different Alarm Sounds
When motion exceeds the set threshold, the app triggers one of five customizable alarm sounds, offering flexibility and personalization. - Bluetooth Connectivity
The app integrates with the HC-05 Bluetooth module to relay data from the PIR sensor, ensuring seamless communication between the hardware and the mobile device. - LED Status Indicator
The system includes a built-in LED that lights up when motion is detected, providing a visual confirmation in addition to app notifications.
Applications of the PIR Sensor Control in the BlueBot App
The PIR Sensor control in the BlueBot app is versatile and can be used in a variety of scenarios:
- Home Security Systems
Monitor entrances and detect unauthorized movement to enhance home security. - Office Automation
Detect employee movements and automate lighting or other systems in office spaces. - Smart Lighting Systems
Use the motion data from the PIR Sensor control in the BlueBot app to control lights, reducing energy consumption. - Robotics Projects
The motion detection capability can guide robotic movements or trigger actions based on detected activity. - Pet Monitoring Systems
Track pet movements and receive notifications when they enter or exit a specific area.
Conclusion
The PIR Sensor control in the BlueBot app is a powerful and versatile tool for motion detection. Its real-time capabilities, customizable thresholds, and Bluetooth integration make it an ideal choice for various applications, from home security to smart lighting systems. By combining advanced technology with user-friendly features, the PIR Sensor control in the BlueBot app stands out as a reliable and efficient motion detection solution.
Download BlueBot Controller App and start your journey today!