Friday, 28 December 2012

Arduino and Sky box innards

 Well as its Christmas I've had a bit of time on my hands so thought I'd start on a project a friend of mine, Adam thought of. He's key developer on TVHeadend and liked the idea of replacing the Sky+ box. That's been the drive behind TVHeadend, XBMC, etc. So why not go a step further? Take that old Sky plus hardware/case and re-use it for the XBMC PC with fully functioning front-panel.

I've had a few Sky+ boxes lying in my garage for a while now (Faulty capacitors, or just old hardware so they just sit there), so I thought I'd rip one open and see whats going on. Firstly we know the insides of the Sky+ box,

its 1 main motherboard, a PSU board and hard-drive. Then a ribbon cable feeds the front panel. So HDD comes out, and I pull apart carefully the front panel. Luckily they're made to disassemble, so a couple of screws at the side and the front panel then can unclip with gently prising the locking tabs all round it.

This revealed the front panel innards, and a 2-part circuit board with a lot of circuitry on it.


Not what I was expecting, I was thinking more along the lines of either I2C or a simple LED cluster that fed back to the motherboard. I powered up and started to probe the pins to see what I was getting. Unfortunately I don't have an oscilloscope so I couldn't see any data/signalling, so just went on voltage initially. Unfortunately all I found was ground, power and standby-power. Pretty disappointing. I then tried to find out what the LEDs that light up the Sky playback circle (The sequence of LEDs that go round in a circle when playing back video, etc). Unfortunately as I don't have an active SKY card in, even the demo won't display this sequence, so again I've had to give up on this. So I've decided to pull the circuit board out, and do my own thing! Fit a cluster of LEDs in the back and just feed those back to my Arduino board.

The idea is that I'll plug the arduino into the XBMC/Openelec box using USB. I can then write a serial communication language that will send status to the arduino that will then display on the LEDs. On top of that I'm going to cut out part of the front panel of the Sky box and put in a backlit LCD screen, that will show current channel, now/next, something like that (Not fully decided). Last night I got as far as mounting the LEDs behind the facia and started to check they were aligned (tricky!). Next will be to start wiring that to the arduino to see if I can get the 'animation' of the LEDs looking anywhere near OK.

If anyone has done any more interfacing with the Sky+ front panels or figured out the control lines, etc, please let me know! I'd love to get the original circuit board running somehow.



Thursday, 20 December 2012

Borri UPS for home use

Around a week ago my APC Smart UPS SC420 decided its battery needed replacing (again!). I only seem to get around 2-3 years out of mine which started me thinking, why on earth do I get such short life from something 'relatively' expensive. These units come in at around £120 and batteries around half that. For 420va that doesn't seem too great, as all I do is power 2 machines (desktops with a few add-ons) and a network switch/wifi. Mainly to protect the computers from nasty spikes and unexpected shutdowns more than running without power (since the internet router is in the house, not connected to a UPS).

However, I wanted to replace the UPS to keep the protection up, mainly as the power in my area seems to spike and brownout quite a bit and I've had a lot of things go pop as a result of this (X10 kit hates this kind of choppy power, hence most of my X10 home control stuff going bang). So I duly went to APC and looked up the replacement battery. It came out at around £50 after postage, etc. So I then looked at the APC upgrade wizard, see what they would offer me for a trade-in, as I particularly like the idea of trading in old hardware to get new for a bit of discount and I feel I've done the environment some good with them having batteries inside, etc. For trade-in I was disappointed. I could get a replacement unit for around £100, thats with the same 420va limitation, which since I run that at around 80-90% load isn't great (and I suspect why I go through batteries so often). So looking at the next up capacity 450va, this was £151 for really very little difference, or the 550va model for around the same price. Not very impressive.

So I started doing my usual answer to everything, google for recommendations or alternative brands, Borri kept coming up as they appear to do all sorts of UPS and generator equipment from SOHO right up to datacentres, etc, and looking quite promising I looked at the B60 range. These started at 800va and went up to 2000va, and shopping around for prices. I was pleasantly surprised, the B60-800va version would be £71 delivered, etc. So thats approximately double the rating for a nice £71.

The next issue before ordering, was it linux compatible? For years I've used APC units and used the ever popular opensource APCUPSD to shut down servers when batteries neared depletion, etc. Firstly Borri provided a download of linux software. An excellent start. Checking the software it wasn't what I'd hoped, it was a java-based server/applet that basically talked to the ups over USB and presented output via a flash-based web-ui on a custom java-tomcat url on your machine. OK, not the end of the world. I did more digging and thought of NUT for linux. This looked to support it, so worth giving it a go.

UPS arrived next day and it's quite a nice looking unit, really clear permanently lit LCD on the front telling you input volts, output volts and current status (Battery level in bars, current load level). I plugged it into my laptop to play around with and get an idea of the java tomcat web interface. It actually was quite neat, just a pity it was flash and didn't seem to have a raw data port/method of extracting data from it otherwise I'd have stuck with it.

Installing NUT and setting it up for the Borri wasn't too bad, it's partially supported according to NUT using the blazer_usb driver, but this doesn't give you battery level/capacity and time to depletion. No real issue, I can survive!

I've yet to add my load of machines to it and see how it copes, but so far its looking pretty good. If I figure out the battery level/capacity part of it I'll be very happy with this solution.