Want to Join Us ?

you'll be able to discuss, share and send private messages.

Tutorial STB Sombifier

Discussion in 'Reverse engineering' started by storm shadow, Mar 18, 2013.

Share This Page

  1. storm shadow

    Techbliss Owner Admin Ida Pro Expert Developer

    STB Sombifier
    The curious journey one SetTopBox+Automation idea took me
    Short version: The STB Sombifier
    - Saving me 61kWh energy per year.​
    - Auto change TV channels by simulating the original STB remote signals.
    - RGB LED Strip control via unused buttons on the STB remote.​
    - PIR to pre-start the STB once there is a movement in the room.
    - IR Receiver to automatically start the PC monitor (connected to the STB) using the STB remote.
    - Current consumption monitor.
    - 12 V DC and 220V AC rail control.
    Here it is quick demo on how it works:​
    Long Version: (How it works and how I ended up with the solution)
    When I changed my TV provider they gave me a so called SetTopBox(STB) as a receiver. I found out it had HDMI output and immediately decided to use a old monitor I had (Philips 230C1) as a TV Screen. That worked fine initially but soon I found a problem – I had to switch the monitor ON and OFF by hand.
    Oh, that is so tedious! (+I am lazy)
    Well, automation Part Zero can now start! Goal:
    Get the PC Monitor turn on and off using the STB remote
    That was relatively simple:
    * Prepare a clean laboratory conditions for development - done:
    * Have microcontroller (uC) - done:
    The paper tape is there because the original coil was producing a 10Khz signal that I can hear and it was awful so I have changed it with a different one that does not quite fit but now it is absolutely quiet.​
    * Make uC listen to STB remote signals - done:
    * Make it understand signals and specially OFF one - done
    * Make it cut 220V power supply to the PC Monitor - done:
    * Once OFF is detected cut the PC Monitor power - done
    I should be finished, right? Well, sort of ... during the creation of Part Zero I found out that the STB consumption in stand-by is ~7Wh (550mA on 12V). That is huge! For one year that bastard would consume ~61kWh of power.
    With such amount of energy one can power a 100W bulb for 25 whole days. Yayiks.
    As I do not want to leave that bulb to shine for 25 days ... automation Part One can start.Goal:
    Cut STB and PC Monitor power using the STB remote
    That was easy said that done. Initially I thought that I will just plug the STB in the 220V power rail so that it gets started and stopped with the PC Monitor.
    Turns out once you give power to the STB it will not fully start. It just goes in to stand-by and then you have to press the STB remote (IR) to really start it.
    I asked my TV provider to change the firmware so that once I give power to the device it will really start. They ignored the request saying it cannot be done ...
    TV provider: 1
    Energy saving hero: 0
    I already have uC ... and I decided to make it (with additional IR Transmit hardware) mimic the remote signals so that I can automatically start the STB - done:
    Everything should be okay now, right?​
    Turns out there is a startup sequence that varies in time duration and one have to emit the IR signal at the end of the startup sequence when the device is finally in stand-by.
    TV provider: 2
    Energy saving hero: 1
    Soooo, I already have uC! :) I will make it somehow detect that the STB has entered stand-by mode and then emit the IR signal. Luckily for me there is a slight drop in the power consumption of the STB when it goes in stand-by. Enhance the uC with additional hardware to monitor current consumption - done:
    (I am monitoring current flow with the little black thing)​
    Enhance the uC with additional hardware to start stop STB only - done:
    (That one tuned out not that easy as the STB was not happy when I was cutting the negative supply rail, so I had to find out a way to control the high side of the 12V power rail with 3.3V signal, but I did it)​
    Now I have fully automated start and stop of the STB via the the STB remote. Result:
    TV provider: 2
    Energy saving hero: 2
    reducing the power consumption to ~0Wh when in standby using my custom hardware - done!
    TV provider: 2
    Energy saving hero: 3
    Solder everything together on shield - done:
    That is great and I used for some weeks but then I discovered that there is a drawback – the initial startup sequence can sometimes take up to 2 minutes and during this time you just sit and wait for the TV to start
    I do not like to wait that much every time I start the TV, let's start automation Part Two.Goal:
    Get the TV to start quickly
    There was something like this in my mind:
    Okay, let's sacrifice some power for in exchange of convenience.
    But how to do that more efficiently and stay on the lower part of the curve? The solution is a PIR sensor that helps the uC to immediately switch on the device once there is a movement in the room. Then once the user switches the TV using the remote the uC just powers the PC Monitor and the user is left with the impression as if the TV has started immediately
    Prepare a test setup - done:
    1. Potentiometer - to simulate STB power consumption​
    2. PIR to sense movement​
    3. LED to visualize PC Monitor state​
    4. IR receiver​
    5. PIC32MX440F256H used for Hansun HS6020 STB zombification.​
    6. RS232 to USB converter for debugging​
    7. PICKit 3 programmer​
    8. PC for programming - Kubuntu 12.04.1 + KDE 4.9.5​
    9. DSO Nano 2 - funny oscilloscope but for simple tasks as that it is OK.​
    Enhance the shield - done:
    To backup the energy saving side I have done additional logic so that if for 10 minutes (after the last movement) the user did not switched on the STB ON (using the remote) the uC shuts the STB OFF.
    To backup the convenience side I used one of the buttons on the STB remote (that the STB does not react to) to make the uC change the channels up and down automatically so that I do not have to manually press up or down eveytime until I find a channel that seems interesting.
    Then one day I realized that these two remotes
    can become one. I can do that by making the uC emmit the proper signals for the RGB LED controller after a button on the STB controller is pressed. One day later I reached the final solution: