Skip to main content

Arduino VLC Media Player Control Using DIY IR Remote and Python

In the previous tutorial, we controlled VLC Media Player using sensors and serial communication. In this version, we will take the project a step further and build a DIY infrared (IR) remote controller using Arduino.
By the end of this project, you will be able to sit back and control VLC Media Player just like a TV using your own custom-built remote.
This tutorial also introduces an important concept in embedded systems and human-computer interaction:
Using IR communication to control a computer application via Arduino and Python.

This project is ideal for beginners who want to learn:
  • IR communication with Arduino
  • Decoding remote control signals
  • Serial communication between Arduino and Python
  • Automating PC applications using Python
IR remotes are widely used because they are cheap, simple, and reliable for short-range wireless control of electronic devices.

Project Overview

We are building a two-part system:

Part 01: Arduino Remote

  • Reads button presses from a DIY IR remote transmitter
  • Sends commands to the computer via USB serial

Part 02: Python Automation Script

  • Receives serial data from Arduino
  • Converts commands into VLC keyboard shortcuts
  • Controls VLC Media Player automatically
This architecture is commonly used because Arduino cannot directly control desktop software, but Python can act as the bridge between hardware and software.

How the System Works

Step-by-step workflow
  1. A button on the IR remote is pressed
  2. IR transmitter sends infrared signal
  3. Arduino IR receiver decodes the signal
  4. Arduino sends command via Serial (USB)
  5. Python script reads the command
  6. Python sends keyboard shortcuts to VLC
  7. VLC executes the media action
This creates a full hardware → software automation pipeline.

Required Components

Hardware

  • Arduino Uno/Nano
  • IR Transmitter Module (KY-005)
  • IR Receiver Module (KY-022)
  • Push buttons (for remote)
  • Resistors (220Ω, 10kΩ)
  • Breadboard
  • Jumper wires
  • USB cable

Software

  • Arduino IDE
  • Python 3
  • PySerial library
  • PyAutoGUI library
  • VLC Media Player

Understanding IR Communication 

Infrared remotes transmit data using 38 kHz modulated light pulses. Each button sends a unique digital code which the receiver decodes.
Common IR protocols include:
  • NEC
  • Sony
  • RC5 / RC6
Arduino can decode these signals using the IRremote library, which simplifies capturing and interpreting remote button codes. 

Wiring

IR receiver module (KY-022)

  • S - D11
  • (+) - 5V
  • (-) - Ground (GND)

IR transmitter module (KY-005)

  • S - D3
  • (-) - Ground (GND)

Push-buttons

  • Play/ Pause - D13
  • Mute - D12
  • Volume up - D11
  • Volume down - D10
  • Toggle - D9
  • Fast forward - D8
  • Rewind - D7
  • Stop - D6
  • Time (Remaining and Elapsed) - D5
  • Next - D4
  • Previous - D3

Step 01: Install Required Arduino Library

Install the IRremote library from the Arduino Library Manager. This library allows Arduino to:
  • Capture IR codes
  • Decode remote signals
  • Identify which button was pressed

Step 02: Capture IR Button Codes

Before writing the final program, we must discover the IR codes for each button.
  1. Upload a simple IR receiver sketch and open the Serial Monitor.
  2. Press each button and note the HEX code displayed.
  3. These codes will be used to trigger VLC actions.

Step 03: Arduino Program Logic

The Arduino program performs two tasks:
  • Wait for IR signal
  • Send corresponding command via Serial

Example logic

If IR code == PLAY
    send "P"
If IR code == NEXT
    send "N"
If IR code == PREVIOUS
    send "B"
Arduino is now acting as a USB remote control.

Step 04: Python Automation Script

Python acts as the bridge between Arduino and VLC.
The script:
  • Reads serial data
  • Sends keyboard shortcuts using PyAutoGUI

VLC Default Hotkeys

Action                    Shortcut
Play / Pause                    Space
Next                    N
Previous                    P
Volume Up                    Ctrl + Up
Volume Down                    Ctrl + Down
Fullscreen                    F
Python converts Arduino commands into these keystrokes.
This method is widely used to automate desktop software using hardware inputs.

Step 05: Running the System

  1. Connect Arduino to PC
  2. Upload Arduino code
  3. Run Python script
  4. Open VLC Media Player
  5. Press remote buttons
Your DIY remote now controls VLC.

Why This Project Is Valuable

This project demonstrates real-world concepts:
  • Human-computer interaction
  • Hardware/software integration
  • Wireless control systems
  • Desktop automation
  • Embedded system communication
This is essentially a DIY universal media remote for your computer.

Conclusion

In this tutorial, we built a complete IR-based remote control system for VLC Media Player using Arduino and Python.
You learned how to:
  • Decode IR signals with Arduino
  • Send commands via serial communication
  • Automate desktop software using Python
  • Integrate hardware and PC applications
This project is a strong foundation for building:
  • Smart home controllers
  • Presentation remotes
  • Media automation systems
  • Custom PC input devices

FAQ Section

Why use Python instead of only Arduino?

Arduino cannot directly control PC applications. Python acts as a bridge that converts serial data into keyboard automation.

Can I use a TV remote instead of building one?

Yes. You can skip the transmitter and decode signals from any IR TV remote.

Why are my IR codes changing?

Some remotes send repeat codes or different protocol formats. Add delay filtering in your Arduino sketch.

Can this work with other media players?

Yes. You only need to change the keyboard shortcuts in the Python script.

What is the typical IR range?

Usually 5-10 meters indoors depending on the IR LED and receiver sensitivity.

Comments

Popular posts from this blog

Arduino Serial Communication Beginner Guide (UART Explained)

Serial communication is the backbone of most Arduino projects. It allows your Arduino to talk to your computer, Bluetooth modules, Wi-Fi modules, sensors, and even other Arduinos. If you have ever used the Serial Monitor, you have already used serial communication - now you will understand how it really works. By the end of this guide, you will learn: What serial communication is What UART means How Arduino communicates with devices How to send and receive data How baud rate works Common mistakes beginners make What is Serial Communication? Serial communication is a method of sending data one bit at a time over a single wire. Instead of sending many bits simultaneously (parallel communication), serial sends bits sequentially: Example: The letter A in binary = 01000001 These bits are sent one after another very quickly. This method is: Simple Reliable Perfect for microcontrollers What is UART? UART stands for: Universal Asynchronous Receiver Transmitter It is the hardware ins...

How to Connect HC-06 Bluetooth Module with Arduino (Step-by-Step Beginner Guide)

Bluetooth communication is one of the easiest ways to make Arduino projects wireless. Once you understand how to use a Bluetooth module, you can build robots, home automation systems, and smartphone-controlled devices. In this tutorial, you will learn how to interface the HC-06 Bluetooth module with Arduino and send data wirelessly using your phone.    By the end of this guide, you will be able to: Understand how the HC-06 Bluetooth module works Configure the module using AT commands Safely connect it to an Arduino Send and receive serial data over Bluetooth Build the foundation for wireless Arduino projects Watch the Project Overview What is the HC-06 Bluetooth Module? The HC-06 is a Bluetooth-to-Serial module designed to add wireless communication to microcontrollers such as Arduino. It uses Bluetooth 2.0 (SPP - Serial Port Protocol), which means it behaves like a wireless serial cable. Whatever is sent from the phone appears in Arduino’s Serial Monitor and vice versa. ...

How to Use SoftwareSerial on Arduino (Connect Multiple Serial Devices)

In the previous tutorial, you learned how Arduino uses hardware serial communication through pins 0 (RX) and 1 (TX). That built-in serial port is mainly used to communicate with your computer through the USB cable and Serial Monitor . But here is the problem beginners quickly face: Many popular modules use serial communication, such as: Bluetooth modules ( HC-05 / HC-06 ) GPS modules GSM modules Wi-Fi modules ( ESP8266 ) Arduino Uno has only one hardware serial port. So how can we connect these modules while still using the Serial Monitor? The solution is SoftwareSerial . In this tutorial you will learn how to create additional serial ports using normal digital pins. By the end, your Arduino will be able to talk to multiple serial devices. What is SoftwareSerial? SoftwareSerial is a special Arduino library that allows digital pins to behave like RX and TX pins. This means Arduino can create extra serial ports using software instead of hardware. Hardware Serial vs Software Seri...