Skip to content

SaugatEDITH/BeamBlaster

Repository files navigation

📡 BeamBlaster – Android IR Universal Remote

BeamBlaster is an open-source Android app that transforms your smartphone with an IR blaster into a universal remote. It supports NEC (including extended 32-bit), classic NEC, and Pronto Hex IR protocols, making it compatible with many generic Chinese TVs, Android set-top boxes, and more.


🚀 Features

  • 🔧 Configure any button with IR address/command or Pronto Hex
  • 💾 Saves multiple remotes in local SQLite database
  • 📡 Supports NEC protocol (standard & extended 32-bit)
  • ⚙️ Uses Android's ConsumerIrManager API for IR transmission
  • 🔍 Debug logs and built-in IR tester using camera
  • 🆓 Fully offline, ad-free, open-source

📦 Installation

✅ Requirements

  • Android 4.4 KitKat or higher
  • Device with built-in IR (Consumer IR)

🔨 Build from Source

  1. Clone this repo:
    git clone https://github.com/yourusername/BeamBlaster.git
    cd BeamBlaster
  2. Open with Android Studio
  3. Build & run on an IR-enabled Android phone

📲 Usage

  • Long press any button to configure:
    • NEC address (e.g. 04FB) and command (e.g. 12ED)
    • Or use full Pronto Hex in the address field
  • Tap to transmit IR code

🔁 IR Protocol Support

✅ NEC Extended (32-bit, MSB-first)

This is the default format used in BeamBlaster.

public static int[] buildNecPattern(int address, int command)
  • Takes full 16-bit device address + full 16-bit command
  • Supports 32-bit command blocks like: 04FB12ED
int addrL = address & 0xFF;
int addrH = (address >> 8) & 0xFF;
int cmdL = command & 0xFF;
int cmdH = (command >> 8) & 0xFF;
int[] bytes = { addrL, addrH, cmdL, cmdH };

IR Pulse Format:

  • Header: 9000, 4500
  • Each bit: 560 + (560 for 0, 1690 for 1)
  • Footer: 560 (final mark)

🧠 Alternative NEC Protocols

▶️ Classic NEC (8-bit + complement)

public static int[] buildClassicNec(int address, int command) {
    int addr = address & 0xFF;
    int addrInv = ~addr & 0xFF;
    int cmd = command & 0xFF;
    int cmdInv = ~cmd & 0xFF;
    int[] bytes = { addr, addrInv, cmd, cmdInv };
    return buildPattern(bytes);
}

Useful for TVs, DVD players, and classic remotes expecting 8-bit + inverse format.


📊 IR Frequencies and Wavelengths

Frequency Usage Approx. Wavelength
38000 Hz Common TVs / Android Boxes ~790 nm
40000 Hz Air conditioners, some remotes ~750 nm
36000 Hz Sony, Philips, older hardware ~830 nm

Change frequency in code:

irManager.transmit(38000, pattern); // Try 36000, 40000 if needed

💬 Example Address/Command

For a generic Android TV box or Chinese board (e.g., Allwinner, Rockchip):

  • Address: 04FB
  • Command: 12ED
  • Combined 32-bit MSB-first: 04 FB 12 ED

🧪 Debugging & Testing

📸 Camera Test

Use phone camera to see IR LED flicker

🧾 Logcat Debugging

Log.d(TAG, "Parsed addr=0x04FB cmd=0x12ED");

Ensure pattern logs are being generated

✅ IR availability

if (irManager != null && irManager.hasIrEmitter())

⚠️ Troubleshooting

Problem Solution
IR not transmitting Check IR permission & hardware
Device doesn’t respond Try changing frequency (e.g., 40000, 36000)
Invalid code format Ensure address/command are valid hex
Button press has no effect Use Logcat to verify transmission
Need raw IR format Use Pronto Hex mode

📂 File Structure

BeamBlaster/
├── app/
│   ├── java/np/com/saikripa/beamblaster/
│   │   ├── RemoteControlActivity.java
│   │   └── ir_utils/
│   │       ├── NecIrBuilder.java
│   │       └── HexConverter.java
│   └── res/layout/activity_remote_control.xml

✍️ Extending Protocols

Add your own builder:

public class Rc5IrBuilder {
    public static int[] buildRc5Pattern(int command) {
        // Implementation here
    }
}

Then call it in sendSignal() based on user config.


📄 License

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction...

🙏 Acknowledgments

  • Creator Saugat Pokharel
  • Android IR documentation – ConsumerIrManager
  • Built to make old TVs and boxes useful again – no remote required

⚠️ Responsible Use & Disclaimer:

This project is for educational and personal use only.
IR technology can be misused, so please do not use this app to interfere with devices you don't own. BeamBlaster is meant to empower users, not cause harm.

My goal was simple: turn an old, unsupported TV into a working second screen — and maybe help others do the same.