Home > Electronics Projects, Projects > iPhone controlled TV Lift

iPhone controlled TV Lift

Video of the iPhone TV Lift controller working!

Hardware

This was probably one of my most time consuming projects.  Hopefully I can do some justice to the time and work spent through this post.  I should probably begin by describing the whole system.  First, the TV is lifted up & down by a “Lift Tech” lift.  By the way, they get the prize for the most original company name ever.  Their controller box has a port that allows home automation systems to control its operation.  They did a really good job of making it extensible.  You can control it in a variety of ways: short one pair for going up, another for going down; short a pair for down, open for up; etc.  I had intended to use the first mode, but I think I fried a channel on my opto-isolator.  I ended up using the second method because it only required one channel.  Unfortunately that means I can only have the TV up, or down.  I wasn’t too disappointed, though, because I don’t expect to want it any other way very often ;) .

TV Lift controller box

TV Lift controller box

The board I designed to interface the TV Lift to the server was fun to design and build, even though it was prone to error.  I had originally intended to use the Microchip ENC28J60 ethernet controller. I thought it’d be cool to have the iPhone app connect directly to the board’s ethernet controller and microcontroller. Unfortunately, I screwed up the interface from the ethernet controller (specifically the physical layer circuitry) and the magnetics. This interface is harder than it looks, trust me. I thankfully included a serial port on the board (which I had other plans for) and used that instead. This choice made the microcontroller software extremely simple. All it really has to do is wait for a ‘d’ character over the serial port and lower the TV, a ‘u’ character lifts the TV, and a ‘s’ character queries the controller for the current state. I’ve included an image of the schematic for the board, in case you are curious about my lofty intentions.

TV Lift Schematic

TV Lift Schematic

If you’re interested, the board I used on my reflow soldering toaster oven page is the TV Lift board.  Incase you don’t want to go over there, here is a picture of it mostly finished up:

Controller board installed

Controller board installed

Using the RTS line for reset

Using the RTS line for reset

There is one more thing that I had to change.  For some reason the controller board that I made crashes after a while.  I have to use a ladder to reboot it (power-cycle).  Hauling the ladder around is annoying, and I don’t like doing it.  To allow myself to reboot it remotely, I added a diode from the MCLR line (reboot) of the microcontroller to the RTS line of the serial port.  The RTS line is used for modems from back in the day.  Now I can use it to force MCLR low, to reboot the controller, if it’s “low” (-5 volts).  It’s a hack, but what are you going to do?

Software

The software for this project is deceptively simple.  The iPhone software basically connects to the server using a socket, and if the “up” button is pressed it sends a ‘u’ over the socket, and a ‘d’ if the down button is pressed.  That’s it!  Server software is almost identical, however it listens to the return of the serial port and expects my controller board to return a ‘U’ or a ‘D’ from the ‘u’ and ‘d’ command.  If these are not received, the board is reset and the command is tried again.

Conslusion

Well, that’s all there is.  I hope you’ve enjoyed it, I know I have.  Please, feel free to ask any questions in the comments section!



  1. Marcus
    May 2nd, 2009 at 17:07 | #1

    Does your iPhone communicate using Wifi for this project?

  2. May 2nd, 2009 at 17:20 | #2

    Just out of curiosity, what is specifically wrong with the phy layer circuit? I’m comparing yours to the one here: http://tuxgraphics.org/electronics/200611/embedded-webserver.shtml

    It looks the same to me.

  3. May 2nd, 2009 at 17:32 | #3

    @yzf600 I think the problem was that I waited about 2 months from making the mag Jack part outline and ordering the parts. When I was ordering parts I couldn’t find a matching part number. The one I actually ordered was a little different. I think at least one of the pairs (through the transformer) was open and half grounded. The ethernet controller was really hot, so I ended up desoldering it. Sparkfun has a breakout board with their magjack part and uses the same controller. I’ll probably use that as a blueprint for next time.

  4. May 2nd, 2009 at 19:03 | #4

    Cool project, I could see this being something that the automation company would want to offer as a standard option.

  5. May 2nd, 2009 at 21:15 | #5

    Thanks!

    I agree that it’d be nice for this to be a standard option… The frameworks Apple created for the iPhone are neat in that you could allow the user to download an XML file describing a menu structure that would a hierarchal UI. The leaves of that “tree” like structure being actions. With that, you could map user actions to all kinds of home-automation like tasks. This may be especially interesting if you had a lot invested in X10, or a “street of dreams” like house.

  6. May 2nd, 2009 at 21:24 | #6

    @Marcus Yes, it does. It’s using a standard BSD socket. You can set the hostname and port using the settings app. I’d like to use Bluetooth, but apple doesn’t give you access to the interface.

  7. December 6th, 2009 at 18:44 | #7

    That is an excellent idea – I know some students at Toronto University came up with a universal remote app for the iPhone earlier this year. No word on whether theirs was programed to operate a TV lift, though. Perhaps the traditional remote will become thing of the past. This type of application definitely needs to become standard. Thanks for sharing your project details. Great stuff!

  8. December 6th, 2009 at 18:52 | #8

    Thanks! It’s true that simple network (TCP/IP) stacks are becoming more common in embedded devices. I think that’s a good thing. I’m always wishing that companies would make it easy for hackers in this arena. I have a dish network satellite TV box, it has an ethernet connection, and the even charge more if it’s not on the internet. It wouldn’t be much for them to allow a telnet connection to the box allowing simple commands to change channels, turn off/on, etc. But they don’t :(

  1. May 2nd, 2009 at 05:59 | #1
  2. May 2nd, 2009 at 08:20 | #2
  3. May 2nd, 2009 at 18:52 | #3
  4. May 3rd, 2009 at 14:17 | #4
  5. May 4th, 2009 at 10:36 | #5
  6. May 11th, 2009 at 20:12 | #6


seven × = 7