Add Recording Indicator Light to NextPVR

Many of us are looking to create a PVR/DVR/HTPC device for our personal media needs. They usually tend to work great but are often missing a few elements to make it just like a commercially purchased product. An example of this is a Recording Indicator Light and/or Tuner Indicator Lights. These indicator lights can easily be added to any device running NextPVR as a backend as long as it has an available Rs-232 Com Port or Arduino(or clone) attached. Any step with an * indicates it is the method that will be used for this instructable

Supplies:

Required:

1x PC running NextPVR as Backend

Various lengths of wire

LED Light Bulbs of desired color

Various resistors(See desired connection method)

Soldering Iron

Electrical Tape

Windows Notepad

(Optional) Various DC Male Headers(Such as found on cordless phone batteries)

If using RS-232 Serial Port (Max 3 LED):

1 x Rs-232 Serial port or Serial port Header or USB-Serial Adapter

1 x 1 KiloOhm Resistor per LED Desired.

1 x Slick Solutions LED Driver Software https://hveijk.home.xs4all.nl/slicksolutions/ledsd...

If using Arduino: (Max 19 LED):

1 x Arduino or similar clone. This instructable will be using the Arduino Uno

1 x 220 Ohm or 1 x 1 KiloOhm resistor per LED Desired

1 x Arduino IDE or online LED

1 x Free USB Port

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Determine Whether Your PC Has an Rs-232 Serial Port

If your computer has either an external Rs-232 Com Port or an Internal header this is the easiest and cheapest method to add some LED Indicators to your PVR. To determine if you have a physical port look on the back of your computer for a jack that has 9 pins and looks like the blue port in the picture.

To determine whether your motherboard has an internal Rs-232 Serial port header google the motherboard model number and look at its specifications. Look for something called Serial Port/COM/Serial Header. If you find it then you have one on your board.

If you have neither available on your computer then you can purchase a USB to Serial adapter from your favorite webstore. They typically can be found for around $10. Then precede to step 2. If you would rather use an Arduino Skip to step 4.

Step 2: Connect Wires to RS-232 Port

There are multiple options to connect the wires to your Rs-232 Serial port. The internal header method is preferred as it keeps all components inside of the case minimizing clutter. The options are as follows. The more $ = More expensive option

Physical Port

Purchase a Female Serial break out end such as This ($$) Difficulty = Easy

Cut apart and splice an old serial cable from a device such as a modem or This ($) Difficulty = Medium

Wrap wire around pin and solder in place (Free) Difficulty= Hard

Use headers from old electronics such as Cordless Phone Batteries (Free) Difficulty = Easy

Header

Purchase a Serial Header to Serial Port panel mount/pci expansion bracket such as This and use one of the methods from above ($$$) Difficulty= Easy

Purchase a Serial Header to Serial Port panel mount/pci expansion bracket such as This and splice into LED wire ($$) Difficulty = Medium

Wrap wire around pin and solder in place (Free) Difficulty= Hard

Use headers from old electronics such as Cordless Phone Batteries* (Free) Difficulty = Easy

After it is decided which method to use precede to step 3

Step 3: Which Pins Do I Use?

A Rs-232 Serial port can only control 3 LED lights. However there is no limitation to how many Serial Ports you can add to your computer so the numbers are endless. In order to drive the three LED's the pins DTR, RTS, and RXD are needed to control the corresponding lights 0, 1 ,2. In order to find these pins use the following suggestions.

Physical Port:

Consult the diagram above

Using your desired method of connection connect the wires to the corresponding pin


Header:

Google motherboard brand serial port header pinout or consult the users manual from the manufactures website for a pinout

Once the pin out diagram is found connect the wires to the corresponding pin desired.

The positive leg of the LED(usually longer leg) connects to the 1 KiloOhm resistor then to the DTV, RTS, or TXD pin. The negative(Shorter leg) connects to the ground.

Step 4: Configure LEDs Driver Software

1) Once your LED is wired correctly download and install the Slick Solutions LED Driver software.

2) Once installed navigate to the task bar and look in the lower right hand corner of your screen for a green circle icon. If it is hidden click the upward facing arrow icon and then the green circle should appear.

3) Right click on the green circle and select Configure.

4) Once opened click on the Device tab

5) Under the LED Device drop down menu select the corresponding COM Port to your serial port. It is typical COM 1 for a Physical Port or Header and Something in the COM 10-20 Range for a USB to Serial Adapter .

6) If using a Prolfic USB to Serial device select the Enable Prolfic PL-2303 USB-to-serial resume fix

7) Click on the LEDs tab

8) Click on each event there and select Delete until none are shown

9) Click Add

10) To control the 1st LED connected to the DTR pin select User Event 0 under Event

11) Select LED 1 under LED

12) Select OFF under State

13) Click Ok

14) Skip to step 20

Step 5: NextPVR Scripts

In order to make NextPVR turn on and off the LED Light we need to create some files it will run. There are 6 files we can create. Each has a different purpose but all can control an LED light to indicate its function.

ParallelProcessing.bat Runs when a recording begins. (Will be used to turn on LED)

PostProcessing.bat Runs when a recording ends. (Will be used to turn off LED)

PostCancel.bat Runs when a recording is canceled (Will be used to turn off LED)

UpdateEPG.bat Runs when EPG(Electronic Programing Guide update begins. (

PostUpdateEPG.bat Runs when the EPG update completes.

Wakeup.bat Runs when PC is waken up from sleep

For this instructable we will be using the 3 scripts indicated above. The process is the exact same for the other scripts(1 turns on 1 turns off)

Step 6: Create a Script

ParallelProcessing.bat

1) Open Notepad

2) Copy and Paste the following into the blank document

code here

3) Click File--> Save and navigate to the Navigate to C:/Users/Public/NPVR/Scripts folder

4) name the file ParallelProcessing.bat Make sure to remove the .txt extesnion!!

5) If it prompts about changing extension select Yes/Ok

6) Exit notepad

PostProcessing.bat

1) Open Notepad
2) Copy and Paste the following into the blank document

code here

3) Click File--> Save and navigate to the Navigate to C:/Users/Public/NPVR/Scripts folder

4) name the file ParallelProcessing.bat Make sure to remove the .txt extesnion!!

5) If it prompts about changing extension select Yes/Ok

6) Exit notepad

PostCancel.bat

1) Follow the exact same steps as PostProcessing.bat just name the file PostCancel.bati instead

Step 7: Fix the Permissions....

Some issues sometimes arise when trying to use Slick Solutions LED Driver with NextPVR. These issues are fixable but can be frustrating. Here is how to fix them.

1. Navigate into the C:/Users/Public/NPVR/Scripts folder

2. Right click on ParallelProcessing.bat and click Properties

3. Click Security

4. Click Edit

5. Click Add

6. Type in user account name into the Enter the object names to select box

7. Click OK

11. In permissions box click checkbox under Allow to left of Full Control

12. All items in list should become checked under Allow

13. Click Apply

14. Click OK

15. Click OK

16. Repeat same steps for PostPorocessing.bat and PostCancel.bat

Step 8: Connect Wires to Arduino

There are multiple ways to connect wires to the Arduino. The following are the most common ways:

Purchase Arduino Jumper wires such as This and splice them ($$) Difficulty = Easy

Purchase Arduino Terminal block connectors such as This ($) Difficulty = Easy

Stick wires directly into header or wrap around pin (Free) Difficulty = Easy

Solder wires directly to Arduino (Free) Difficulty = Hard

Step 9: Which Pins Do I Use?

You can use any of the I/O pins available on the Arduino to control your lights. For this instructable we will be using pins 8, 9, 10. If you feel comfortable coding just simply swap all instances of these numbers in the included sketch to your desired pin number.

Step 10: Configure Arduino Sketch

1) Plug Arduino into computer via usb port

2) Download and install the Arduino IDE from Here. It is avalaible for Windows, Mac, and Linux.

3) Or Launch the Arduino web editor from Here which does not require installation. Requires an Arduino Account

4) Once open click control/command + a on your keyboard then click backspace to clear all text

5) Copy and paste the following code into the new blank document

#include
IRsend irsender; byte byteRead; void(* resetFunc) (void) = 0; //declare reset function @ address 0

void setup() { Serial.begin(9600); for (int thisPin = 8; thisPin < 13; thisPin++) { pinMode(thisPin, OUTPUT); } } void loop() { if (Serial.available()) { byteRead = Serial.read(); indicators();

} } void indicators() { switch (byteRead){ case '1': Serial.println("Tuner 1 ON"); digitalWrite(8, HIGH); return; case '2': Serial.println("Tuner 2 ON"); digitalWrite(9, HIGH); return; case '3': Serial.println("Tuner 3 ON"); digitalWrite(10, HIGH); return; case '4': Serial.println("Tuner 1 OFF"); digitalWrite(8, LOW); return; case '5': Serial.println("Tuner 2 OFF"); digitalWrite(9, LOW); return; case '6': Serial.println("Tuner 3 OFF"); digitalWrite(10, LOW); return;

} }

6) Replace the number inside the parentheses with the desired pin number you chose

7) If desired chance the number inside of the single quotation marks next to case to any alphanumeric character you wish

8) Click Sketch --> Upload

9) Save file when prompted

10) Wait to upload. Text will say Done Uploading when complete\

11) Your all done with this part! Just remember to keep the Arduino Plugged into the computer

Step 11: Configure NextPVR Scripts

Simply replace the instances of COM16 with the Com Port number of your Arduino in the following scripts. Also if you changed the number inside the single quotation marks in the previous step add that same character isnide the double quotes here.

ParallelProcessing.bat

1) Open Notepad

2) Copy and Paste the following into the blank document

@echo off
MODE COM16 BAUD=9600 Parity=n Data=8 set /p x="1" \\.\COM16 exit

3) Click File--> Save and navigate to the Navigate to C:/Users/Public/NPVR/Scripts folder

4) name the file ParallelProcessing.bat Make sure to remove the .txt extesnion!!

5) If it prompts about changing extension select Yes/Ok 6) Exit notepad

PostProcessing.bat
1) Open Notepad

2) Copy and Paste the following into the blank document

@echo off
MODE COM16 BAUD=9600 Parity=n Data=8 set /p x="0" \\.\COM16 exit

3) Click File--> Save and navigate to the Navigate to C:/Users/Public/NPVR/Scripts folder

4) name the file ParallelProcessing.bat Make sure to remove the .txt extesnion!!

5) If it prompts about changing extension select Yes/Ok

6) Exit notepad

PostCancel.bat

1) Follow the exact same steps as PostProcessing.bat just name the file PostCancel.bat instead

Step 12: Test It Out!

Now go ahead and test out your new recording light! When you begin recording the light should go on. When the recording finishes or is canceled it should go off.

Now that you know how to connect the LED and code them go ahead and create some scripts for tuner indicators or specific tuner recording lights. I already have these scripts made, if you need any help ill gladly be off assistance

Be the First to Share

    Recommendations

    • Instrument Contest

      Instrument Contest
    • Make it Glow Contest

      Make it Glow Contest
    • STEM Contest

      STEM Contest

    Discussions