GirsUIRB (Based on AGirs) |
GirsUIRB is an infrared server for Arduino, specifically adapted for the Universal IR Blaster (UIRB) V0.2 board. It incorporates several enhancements and additional features to enable integration with UIRBcorelib, bringing extended capabilities for IR signal processing and hardware control. It remains compatible with tools like IrScrutinizer and LIRC.
Note: This project uses the MiniCore hardware package. For additional hardware details and an example PlatformIO project, see the UIRBpio repository.
- Adapted AGirs firmware tailored for the Universal IR Blaster.
- Integration with UIRBcorelib for convenient access to board-level functions.
- Configurable baud rates via simple button presses at startup.
- Raw capture mode using a non-demodulating sensor on
PB0
(ICP1
). - Demodulated receive mode for standardized IR signals on
PB4
(or your chosen pin). - Low battery notification with user-configurable intervals.
- Hardware Requirements and Modifications
- Software Requirements
- IR Receiver / Non-Demodulating Capture Sensor
- Project Structure and Environment Configurations
- Uploading Firmware
- Baud Rate Selection at Startup
- Flashing Bootloader and Fuses
- TODO
- License
A Li-Po or Li-Ion battery (capable of delivering ~3A peak) ensures stable power for IR LEDs and other onboard components. A 600mAh drone-style battery works well in most cases.
- ICSP Breakout: For direct programming via a
USBasp
or another ISP tool if you choose not to use theurboot
bootloader. - UART/Serial Connection: For bootloader-based uploading, monitoring, and debugging.
In GirsUIRB, the firmware can handle both demodulated and non-demodulated IR signals:
-
Demodulating Sensor (e.g., TSOP4838)
- Ideal for standard consumer IR protocols (38 kHz carrier, etc.).
- Default input pin is
PB4
(MISO). - The firmware already enables the internal pullup, but make sure to add an external pullup of ~4.7 kΩ if required for signal integrity.
-
Non-Demodulating Sensor (e.g., TSMP58000)
- Captures raw waveforms without relying on a carrier frequency.
- Wired to
PB0
(ICP1
) for Timer1 input capture, usually via a 10 kΩ resistor to protect GPIO drivers. - Useful for analyzing unknown or exotic IR signals.
Tip: For the UIRB V0.2 board, you can route or combine signals to share a connector pin, but be mindful only one sensor should drive the line at a time (raw vs. demodulated). Alternatively, use separate pins and keep both sensors connected if you prefer.
- Visual Studio Code with PlatformIO IDE
- CP210x USB to UART Bridge VCP Drivers (if using onboard USB-UART)
- Local clone of this repository:
git clone https://github.com/DjordjeMandic/GirsUIRB.git
- For detailed hardware instructions and setup using PlatformIO, see the UIRBpio repository.
- platformio.ini: Defines multiple environments (e.g.,
uirb-v02
for bootloader-based uploads,uirb-v02-usbasp
for ISP uploads, etc.). - src/: Contains the main firmware logic (adapted from AGirs).
- include/, lib/, test/, etc.: Standard PlatformIO structure.
Each environment leverages UIRBcorelib and the AGirs library. Different build types (release, debug, simulation) are available.
- Open the Project: In VS Code, load this folder as a PlatformIO project.
- Connect the Board:
- If using
urboot
, connect via USB-UART. - Otherwise, use a
USBasp
(ISP) programmer on the ICSP header.
- If using
- Select the Environment:
[env:uirb-v02]
for bootloader-based uploads.[env:uirb-v02-usbasp]
for direct ISP.
- Upload:
- Via VS Code: Click “Project Tasks” → “General” → “Upload” under the appropriate environment.
- Or via CLI:
platformio run -e uirb-v02 --target upload
- Monitor:
- If using serial (bootloader), open the serial monitor at 38400 (default).
Adjust if you selected a different baud rate at reset (see next section).platformio device monitor -b 38400
- Default:
38400
baud. - Option Switches (held at reset):
- Left (Option 1):
9600
- Middle (Option 2):
19200
- Right (Option 3):
250000
- Left (Option 1):
At reset, the firmware briefly communicates at 38400
to announce BAUD:<chosen>:END
, then switches to the chosen baud rate. Some software might not list 250000
explicitly, but 256000
typically works well.
To burn the urboot bootloader and set the fuses for 8 MHz operation:
- Connect an ISP Programmer (e.g.,
USBasp
) to the ICSP pins. - Choose the
uirb-v02-usbasp
Environment (or similar). - Use the
fuses
target in PlatformIO to set the fuses:platformio run --target fuses --environment uirb-v02-usbasp
- Use the
bootloader
target in PlatformIO to burn the bootloader:platformio run --target bootloader --environment uirb-v02-usbasp
This will upload urboot
to your ATmega328P and configure the fuses appropriately. See UIRBpio repository for more details.
- Write README
- Create library for Universal IR Blaster V0.2 hardware and use it here
- Add low battery indicator
- Separate capture (raw) and receive (demodulated) signals (make them configurable via
platformio.ini
) - Create modules to leverage full UIRB hardware features
- Implement autobaud
- Add status when idle
This project is licensed under GPLv2 or later, just like AGirs & Infrared4Arduino. For more details, see the AGirs License.
Acknowledgment: This firmware is originally based on AGirs and has been enhanced to utilize UIRBcorelib for the Universal IR Blaster board.
Happy hacking with GirsUIRB! If you have questions or suggestions, please open an issue or pull request.