Most coloured LED strips are controlled via a remote or bluetooth app. I created firmware to control the LEDs from my computer using an IR transceiver circuit powered by an Arudino microcontroller. The firmware was written in C++ with an optional PowerShell script to control the program from the terminal.
Table of Contents
The video shows the PowerShell script running in the terminal. Multiple commands are called quickly to show the colour changes of the LED strip as well as the LED indicator on the breadboard—green is for transmit, blue is for receive, and red is for invalid command.
LED.Controller.Demo.mp4
- Control IR based LED strips (NEC protocol) using the Arudino IDE serial console or terminal
- Monitor data being sent over IR using the Arudino IDE serial console or terminal
- Help menu listing available commands (terminal only)
The program can be run from the Arduino IDE. Once the firmware has been flashed to the microcontroller, the program can also be run from the terminal (with Windows PowerShell).
- Arduino IDE: version 2 download
- (Optional) Windows PowerShell: install on Windows, Linus, and macOS
The IRremote.h library must be installed in your directory or through the Arudino IDE Library Manager.
- Flash the code to the microcontroller
- Open the serial monitor under
Tools > Serial Monitor
- Use valid commands found on line 37 of
LED-Strip-Controller.ino
- Flash the code to the microcontroller
- Open Windows PowerShell and change into the project directory:
cd "C:\Users\name\repo"
- Run the script:
.\script.ps1
- Note, the script can be run from other CLIs such as command prompt:
powershell "& ""C:\my_path\script.ps1"""