Skip to content

A modern React Native mobile app to control an HC-05 Bluetooth-enabled servo door lock and LED. Scan for nearby devices, connect, and toggle the lock or LED with a sleek, interactive interface. Includes robust connection handling and accessibility features for reliable smart home control.

Notifications You must be signed in to change notification settings

Milan323-debug/ReactNative_Bluetooth_Led_APP

Repository files navigation

Bluetooth Servo Door Lock & LED Control App

A modern React Native app to control an HC-05 Bluetooth-enabled servo door lock and LED. Scan for nearby devices, connect, and toggle the lock or LED with a sleek, interactive interface.

📱 App Interface Screenshots


Bluetoothconnection Screen

LED Control Screen

Features

  • Scan and connect to Bluetooth Classic devices (HC-05)
  • Control a servo motor (door lock) and LED remotely
  • Robust connection handling and error feedback
  • Modern, dark-themed UI with accessibility features

Project Structure

BluetoothLEDApp/
├── App.tsx
├── app.json
├── eas.json
├── package.json
├── tsconfig.json
├── useBLE.ts
├── useBluetoothClassic.ts
├── assets/
│   ├── adaptive-icon.png
│   ├── favicon.png
│   ├── icon.png
│   ├── splash-icon.png
│   └── fonts/
│       └── Orbitron-Regular.ttf
├── android/
│   ├── app/
│   │   ├── build.gradle
│   │   ├── proguard-rules.pro
│   │   └── ...
│   ├── build.gradle
│   ├── gradle.properties
│   ├── gradlew
│   ├── gradlew.bat
│   ├── local.properties
│   └── settings.gradle
└── ...

Getting Started

  1. Install dependencies:
    npm install
  2. Start development:
    npx expo start
  3. Build APK (EAS):
    eas build -p android --profile production

Arduino Example Code

#include <Servo.h>
Servo myServo;
char data = 0;
int currentPos = 0;
void setup() {
  myServo.attach(9);
  myServo.write(0);
  currentPos = 0;
  Serial.begin(9600);
}
void loop() {
  if (Serial.available()) {
    data = Serial.read();
    if (data == '1' && currentPos != 90) {
      myServo.write(90);
      currentPos = 90;
      delay(300);
    } else if (data == '0' && currentPos != 0) {
      myServo.write(0);
      currentPos = 0;
      delay(300);
    }
  }
}

License

Educational purpose

About

A modern React Native mobile app to control an HC-05 Bluetooth-enabled servo door lock and LED. Scan for nearby devices, connect, and toggle the lock or LED with a sleek, interactive interface. Includes robust connection handling and accessibility features for reliable smart home control.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published