This project contains a hard- and software solution to control the volume, balance and muting of a stereo line signal.
I was not able to control the volume of my home cinema setup remotely, because I use a Logitech Z4 which has only a wired volume remote:
Fire TV Stick
▼
HDMI to HDMI and Audio Converter
┌─────────┴────────────┐
▼ ▼
Video Projector 2.1 Speaker System
(Logitech Z4)
The main components are a microcontroller (ATmega328P) and a electronic volume controller IC (PT2257). You can find the KiCad files (schema and PCB) in the hardware directory. I used a single layer PCB which I made via direct toner transfer method. The shape of the PCB fits exactly into a TerraTec CINERGY T2 case. The Volume Remote Control is connected between the audio output of the HDMI Converter and audio input of the 2.1 Speaker System.
I used Visual Studio Code and the PlatformIO extension. You can find the PlatformIO project files in the software directory. Thanks to "IRMP - Infrared Multi Protocol Decoder + Encoder" library it provides support for thousands of IR Remotes (I use a Apple Remote 2nd Gen.).
I used an Arduino UNO to flash the ATmega328P via the ISP connector on the PCB. For more details see ArduinoISP
The start of this mode is indicated by alternate green and red flashing LED until the first button is learned.
When the Controller is powered on without having learned successfully a remote before, it starts automatically in this mode. You can also enter this mode after a remote was already learned by power of and on the controller and press a button on the remote within the first 5 seconds (green LED is on). Important: To prevent unintended re-learning (e.g. your remote stuck in the couch and a button is pressed permanently) a pressed button is ignored if this button and the first button to learn (Volume up) is the same!
It expects the learning of remote buttons in this order:
- Volume up
- Volume down
- Mute on/off
- Balance left
- Balance right
- Preset
Each successful learned button is confirmed by flashing the green LED for 1 second. If an invalid IR command was received (e.g. from a second remote which has a different address) the learning mode will be interrupted. In case you don't want define all buttons (e.g. your remote has less buttons) you can press a button which was already assigned. In this case the function will be not supported.
If the last button is learned, the green LED flashes 3 times and the new learned buttons are stored into the non volatile memory of the µC.
Press the learned "Volume up" or "Volume down" button to increase or decrease the volume.
Press the learned "Balance left" or "Balance right" button to shift the balance to the left or right.
Press the learned "Mute" button to toggle mute on and off.
To restore the presets for volume and balance press and release the learned "Preset" button. To store the current volume and balance as presets press and hold the learned "Preset" button for 3 seconds.