Bill's Blog
Tech stuff

TV Controller/Monitor

Start Date: March 2013

This project is designed to do two things,

  1. Decode a standard TV remote control too keyboard keys
  2. Monitor and possibly control TV usage.

The main reason I build this system was to allow me to send keyboard keys to the Mac Mini behind the TV. This would mean that I can use the same remote control without buying a new one. Originaly I build a Teensy 2.0 to do this with only the Infrared decoding.

I started this project due to my kids watching a lot of TV. I decided that maybe it was a good idea if they could see how much hours of TV they watching every day and every week, and start using their own self awareness to the amount of TV viewing. Then maybe the next stage moving the project over to a more user based system where each view can select their time slot by entering in a code using the TV remote control. I only got to the first part of these steps, see the conculsion below to find out what happens..

The Build

The following components:

  • Iteaduino Leonardo
  • ITEAD 1602 LCD Shield
  • InfraRed Receiver

The reason I use the Leonardo is that like the Teensy it has a built in USB keyboard device, so you can send keys directly to the host computer. The LCD sheild has keys on the front to allow for access to different menus instead of using the TV remote control.

Installing

The code is on github. It has two parts

  1. The Leonardo/Arduino code, that decodes the TV remote control and monitors TV usage.
  2. Host computer python script to send the current time and recevie the TV usage stats.

The Build

  • Connect the Infrared receiver to pin A1
  • Attach the LCD shield
  • Upload the arduino code to the Leonardo
  • Connect to the host computer
  • Run the host python script.

You can change the Infrared pin to any form A1..A5, by changing the '#define IR_PIN'

in file : ardurino/src/TVController.h

#define KEY_PIN                   A0
#define IR_PIN                    A1
#define BACK_LIGHT_PIN            10

Currently the python script is run every 10 minutes to sync the time with the Arudino. To do this put the following line in you crontab:

*/10 * * * * python ~/Apps/tv-controller/apps/tvcontrollerd --device /dev/tty.usbmodem431 --set-time >/dev/null 2>&1

Conculsion

The first part of the project is very successfull, converting the current TV control to keyboard keys. The second part not so because fo the following reasons:

  • The main users ( my kids) have stopped watching TV and moved over to using computers instead. Not sure if this is a success or not?
  • The LCD display is too small and so you cannot see the usage stats from the sofa, it would be nice to be a bit bigger or use an LED display instead.
  • The tracking of the TV usage is not 100% accurate, this is because you can turn the TV on/off via the power button on the TV. To fixing this issue I was looking into receiving all other remote control commands, and if so mark the TV is on.

Written by Bill on Thursday April 16, 2015
Permalink -
comments powered by Disqus

« Smart Bin Counter - MacBook Air Lego Stand »