Servidor de Controle Remoto IR
Descontinuado. Ver em ESP8266
Lista de material:
1x Raspberry Pi 1 model B (512 MB)
1x Flash card 32 GB
1x IR LED TSFF5210
1x Fotodiodo IR BPV10NF
1x Resistor 220 Ω
1x Resistor 10 kΩ
Raspberry Pi OS Lite
Arduino Header Pinout:
(Fonte: raspberrypi.com e ChatGPT)
3.3V Power - Provides 3.3V power to the board and connected devices.
5V Power - Provides 5V power to the board and connected devices.
GPIO 2 (SDA) - I2C data pin.
5V Power - Provides 5V power to the board and connected devices.
GPIO 3 (SCL) - I2C clock pin.
Ground - Ground connection.
GPIO 4 - General-purpose input/output pin.
UART TX - Serial transmit (TX) pin for the UART interface.
Ground - Ground connection.
UART RX - Serial receive (RX) pin for the UART interface.
GPIO 17 - General-purpose input/output pin.
GPIO 18 - General-purpose input/output pin.
GPIO 27 - General-purpose input/output pin.
Ground - Ground connection.
GPIO 22 - General-purpose input/output pin.
GPIO 23 - General-purpose input/output pin.
3.3V Power - Provides 3.3V power to the board and connected devices.
GPIO 24 - General-purpose input/output pin.
GPIO 10 (MOSI) - Master Out Slave In (MOSI) pin for the SPI interface.
Ground - Ground connection.
GPIO 9 (MISO) - Master in, slave out (MISO) pin for the SPI interface.
GPIO 25 - General-purpose input/output pin.
GPIO 11 (SCLK) - Serial clock (SCLK) pin for the SPI interface.
GPIO 8 (CE0) - Chip enable (CE0) pin for the SPI interface.
Ground - Ground connection.
GPIO 7 (CE1) - Chip enable (CE1) pin for the SPI interface.
Software:
(com ajuda do ChatGPT)
Depois de instalar e configurar o SO, instale o LIRC. Update the package index and upgrade the installed packages:
$ sudo apt update
$ sudo apt upgrade
Install the LIRC package and its dependencies:
$ sudo apt install lirc
Configure LIRC to work with your IR receiver by editing the LIRC configuration file:
$ sudo vi /etc/lirc/lirc_options.conf
Change the following line:
driver = devinput
to:
driver = default
Edit the LIRC hardware configuration file to match your IR receiver:
$ sudo nano /etc/lirc/hardware.conf
Uncomment the following lines and set the GPIO pin number that your IR receiver is connected to:
LIRCD_ARGS="--uinput --listen"
LOAD_MODULES=true
DRIVER="default"
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"
GPIO_IN_PIN=<GPIO_pin_number>
Restart the LIRC service to apply the changes:
$ sudo systemctl restart lirc
Test the IR receiver by running the following command:
$ irw