ATmega2560 Universal
IR Control System
Replacing plastic junk with a custom-engineered, lithium-powered ATmega2560 command module.
Proof of Concept
Before committing to a custom PCB, I validated the concept on the bench while waiting on v2 parts to arrive. The rig reused the v1 keypad, a "Skyboard" microcontroller board (a DIY ATmega-based Arduino), and a separate Arduino wired up as the IR receiver to confirm signals were actually being decoded correctly.
v1 keypad + Skyboard MC (transmit) and Arduino receiver (decode)Once the interrupt-driven scanning and IR protocol were confirmed working here, the design moved to a dedicated PCB for v2.
Custom PCB Design
The core of the SkyRemote is a custom-designed Printed Circuit Board (PCB) built around the ATmega2560. Unlike hobbyist kits, this was designed for daily reliability.
Integrated Lithium-Ion charging circuit with a 5V boost converter, allowing USB-C recharging and consistent logic levels regardless of battery voltage.
3x4 tactile switch matrix directly routed to the ATmega's GPIOs (Pins 22-28), optimized for rapid polling.
PCB Layout, v2
Full Schematic, v2Interrupt-Driven Architecture
To ensure zero latency, I bypassed the standard Arduino loop() polling for the keypad. Instead, I configured Timer 1 to trigger an Interrupt Service Routine (ISR) at exactly 50Hz.
ISR(TIMER1_COMPA_vect) {
// Scan Columns
for (int c = 0; c < NUM_COLS; c++) {
digitalWrite(COL_PINS[c], HIGH);
// Check Rows
for (int r = 0; r < NUM_ROWS; r++) {
int reading = digitalRead(ROW_PINS[r]);
// Software Debounce Logic
if (reading == 1) {
stableCount[r][c]++;
}
// Trigger Command
if (stableCount[r][c] == STABLE_THRESHOLD) {
sendCmdRequest = true;
}
}
digitalWrite(COL_PINS[c], LOW);
}
}This approach allows the processor to sleep or handle other tasks, only waking up to scan the matrix. It also implements software de-bouncing and "Hold-to-Repeat" logic for volume control.
Samsung IR Integration
The system utilizes the IRremote.hpp library to modulate the 38kHz carrier wave required by Samsung televisions.
Target Device Address
Function: Power Toggle
Function: Volume Up (+Repeat)
v2 in Daily Use
The finished v2 board, keypad, and enclosure in action, replacing the original plastic remote.
The onboard Li-Ion charging/boost circuit doesn't power the board correctly: root cause still unconfirmed. The remote works fine on external power, so for now v2 runs with a soldered jumper bypassing the battery circuit entirely. Debugging the charger path is next on the list.