Your EasyEDA usage duration is brief. In order to avoid advertising information, this action is not supported at present. Please extend your EasyEDA usage duration and try again.
# Overview
TinyRemoteXL is a 12-button IR remote control based on an ATtiny13A powered by a CR2032 or LIR2032 coin cell battery.
- Firmware (Github): https://github.com/wagiminator/ATtiny13-TinyRemoteXL
![pic1.jpg](https://raw.githubusercontent.com/wagiminator/ATtiny13-TinyRemoteXL/main/documentation/TinyRemoteXL_pic1.jpg)
![pic2.jpg](https://raw.githubusercontent.com/wagiminator/ATtiny13-TinyRemoteXL/main/documentation/TinyRemoteXL_pic2.jpg)
# Hardware
The basic hardware is similar to the 5-button [TinyRemote](https://github.com/wagiminator/ATtiny13-TinyRemote). The main difference is that the ATtiny13 has to query 12 buttons here. There are various options for using a larger number of buttons with just a few pins. However, most of them do not meet the following conditions:
- there are only four pins available for twelve buttons,
- a keystroke must trigger an asynchronous interrupt to wake the ATtiny from deep sleep mode,
- the circuit must not consume any electricity as long as no button is pressed.
A combination of voltage dividers and a couple of diodes does the trick:
![wiring.png](https://raw.githubusercontent.com/wagiminator/ATtiny13-TinyRemoteXL/main/documentation/TinyRemoteXL_wiring.png)
If, for example, button 4 is pressed, pin PB0 is pulled to ground via the corresponding diode and a pin change interrupt is triggered, which wakes up the ATtiny. The diodes prevent the 4k7 resistors of the voltage divider from shorting out. The voltage that can be measured at PB2 via the ADC results from the supply voltage divided by the 10k resistor on the upper side and two 4k7 resistors (= 9k4) on the lower side. This value depends on the key pressed.
# Software
## IR Protocol Implementation
The implementation for the NEC, SAMSUNG, SONY and RC-5 protocol is taken from [TinyRemote](https://github.com/wagiminator/ATtiny13-TinyRemote). Refer to this project for a complete explanation.
## Setting the IR Codes
Before compiling you have to define the IR commands for each button. Different protocols and device addresses can be used. Several codes can also be assigned to a single key, separated by semicolons.
```c
#define KEY1 NEC_sendCode(0x04,0x08) // LG TV Power: addr 0x04, cmd 0x08
#define KEY2 RC5_sendCode(0x00,0x0B) // Philips TV Power: addr 0x00, cmd 0x0B
#define KEY3 SON_sendCode(0x01,0x15,12) // Sony TV Power: addr 0x01, cmd 0x15, 12-bit version
#define KEY4 SAM_sendCode(0x07,0x02) // Samsung TV Power: addr: 07, cmd: 02
#define KEY5 NEC_sendCode(0xAB04,0x08);SON_sendCode(0xE401,0x15,20)
[...]
```
## Button Detection
If a key has been pressed, a pin change interrupt is triggered and the ATtiny is brought out of sleep mode. The pressed key is then identified via the voltage divider between the individual keys using the ADC of the ATtiny.
```c
// Pin assignments
#define BINT1_PIN PB0 // interrupt pin for buttons 1..6
#define BINT2_PIN PB3 // interrupt pin for buttons 7..12
#define BADC1_AP 1 // ADC port for buttons 1..6
#define BADC2_AP 2 // ADC port for buttons 7..12
// Button ADC thresholds
const uint8_t THRESHOLDS[] PROGMEM = {217, 173, 158, 136, 103, 41, 0};
// ADC read button row and return button number
uint8_t readButtonRow(uint8_t port) {
PRR = 0; // power on ADC
ADMUX = (1
Forked project will be set private in personal workspace. Do you continue?
Clone
Project
The Pro editor is about to be opened to save as. Do you want to continue?
private message
Send message to wagiminator
Delete
Comment
Are you sure to delete the comment?
Report
ATtiny13 TinyRemoteIR XL
12-Button IR Remote Control
Announcer: Stefan Wagner
Creation time: 2021-05-16 13:54:27
Published time:
2022-03-02 07:29:34
*
Report type:
Please select report type
*
Report reason:
Please fill in the reason for your report and the content is 2-1000
words
*
Upload image:
+
Upload image
*
Email address:
Please fill in your email address
Report
*
Report type:
Please select report type
*
Report reason:
Please fill in the reason for your report and the content is 2-1000
words
*
Upload image:
+
Upload image
*
Email address:
Please fill in your email address
Report
Submitted successfully! The review result can be viewed in the personal
center, review notification.
Kind tips
Your EasyEDA usage duration is brief. In order to avoid advertising information, this action is
not supported at present. Please extend your EasyEDA usage duration and try again.
Share
Project
Copy
Copy
Scan the QR code and open it on the mobile terminal