Skip navigation

Raspberry Pi Projects

2 Posts authored by: Matt Collinge element14 Team

We recently went on holiday and I took my laptop & VGA cable with me. It was my intention to hook it up to the TV and play some media on it to keep the kids happy on rainy days (pretty essential in the UK!). It turned out the TV had the VGA port covered up by the mounting bracket, so we ended up putting the laptop on a chair and watching videos from there; it did the job, but there was a perfectly good TV I could have used.

 

At home we have a Fire TV Stick that runs Kodi, but the problem with Fire TV is that it has to have an internet connection, otherwise it refuses to run any apps. I'd rather not have to tether it to my phone all the time.

 

Next time I'll be more prepared; I've put together a compact and flexible setup consisting of a Raspberry Pi 2 running OpenElec (and Kodi) together with a set of cables allowing me to hook it up to pretty much any TV. The Pi runs Kodi really well; the OpenElec distribution boots really quickly & has good Wifi and BlueTooth support.

 

Cable-wise, I've got a 1m standard HDMI cable, which will be used in most situations.. with a 2m HDMI extension lead if I can't get the Pi near enough to the TV (some accommodation doesn't have power sockets where you'd expect them). I've also got a RCA lead, with a SCART adaptor as well.. so that helps if we get stuck with an older TV, which is a plus point for using a Pi 2 with composite out.

 

For media storage I've gone with a USB3 Flash Drive with a capacity of 64Gb, which gives us more to play with than the microSD card, and it's super-fast for copying media from a PC. As soon as you plug in the flash drive, Kodi will show it in the menus.

 

At first I chose a compact/travel USB-based keyboard instead of Bluetooth in case OpenElec 'forgot' the keyboard and I'd have nothing to navigate the menus to re-pair it. But then I bought a numeric keypad from eBay for £2. The keypad isn’t instantly recognised by Kodi, but an easy way to get it up and running is to use the Keymap Add-on. Attach a normal USB keyboard and the keypad at the same time, start the add-on, and use the keyboard to activate the remap process. From there, it’s dead simple to map the keypad to the different Kodi functions.

 

So that's it.. nothing groundbreaking or overly difficult to put together. The whole system is small enough to fit in a small travel bag & gives us a lot of flexibility when dealing with different hotels/accommodation. You may just find the TV accepts the USB flash drive and can play back whatever is on it.. but at least you'll have all the gear you need if it doesn't

 

 

 

Kit list;

 

1 x 2m HDMI extension cable

1 x 1m HDMI cable

1 x Raspberry Pi 2

1 x 8Gb MicroSD card

1 x Compact USB travel keyboard

1 x RCA to SCART adapter

1 x 3.5mm plug to RCA lead

1 x 64Gb USB3 Flash Drive

1 x USB power supply + cable

 

Update 16-Aug-2017 - I've just got back from a holiday near Blackpool in the UK and this system worked brilliantly. It was all in an old camera bag, and this is the second place we've stayed that had a patch panel for the connections.. here's one from our visit to Center Parcs earlier in the year;

 

pisocket.png

 

And here's the one from last week;

 

 

The patch panels and handily located power sockets make things a lot easier!

I’m building a home automation project which connects a Raspberry Pi to control my central heating. I wasn’t particularly happy ripping out all the existing controls, and wanted to piggyback onto them.. which helps if the Pi ever fails (I’ve still got the old controls to fall back on).

 

I also didn’t want to mess with the existing heating control board, so bought a duplicate unit (British Gas UP2) from eBay for about £12.. I can perfect the project on that, and install it when I’m ready.

 

This set of videos goes through each step of the project.. starting off with opening the control board, an overview of what I want to do, and testing out the changes.

 

Opening up the Control Panel

 

This was a bit tricky.. it wasn’t quite obvious which plastic clips needed pushing in to pull the board out.. if you were doing this on your actual panel (not an eBay-bought duplicate) then this video should help work out what you need to do to get into it without damaging anything.

 

 

Project Overview

 

Next up, I’ll quickly go over what I intend to do to piggyback onto the control board. There’s a project here which did exactly what I wanted to do. He’s not using a PiFace 2 like I intend to use, and he wants to be able to control the hot water as well, but everything else is the same.

 

 

Safety First – Masking off the High Voltage Area

 

In this second video, I’ll show how I’m masking off the high voltage area of the board to make it a bit safer when I’m testing things out. Obviously most of the time the board is off, but this helps keep things safer when it is on without the cover.

 

 

Identifying Solder Points

 

Luckily this blog gave me a good starting point, but it wasn’t clear where to get the status of the central heating.. I used a multimeter to find a spot which changed voltage when the system was on, and this diagram shows you what I found;

 

 

Soldering

 

Since I only needed 4 wires for this project (2 for the switch, and 2 for the system state), I took an old USB cable, cut the ends off, stripped the wires and soldered it to the board without much trouble.

 

 

Soldering Complete!

 

This shows the control board after the soldering has been completed.. it’s pretty simple soldering; the only tricky part was finding the points to connect to for the system state (on/off). I’ve stuck down some of the wires so that they don’t catch or get stuck underneath the control boards buttons.

 

 

Testing the Wiring

 

Now that I’ve done the soldering, I’m testing out the wiring.. seeing whether connecting the two wires for the switch turns the central heating on, and when it is on, whether we get voltage on the other two wires to indicate the system state.

 

 

Controlling from Software

 

I’ve now hooked it up to the Pi Face 2 board, which can be controlled with a few lines of Python to simulate a button press, and detect the state of the system. It wasn't strictly necessary to use a Pi Face 2.. I just happened to have one that I wanted to use in a project. One disadvantage of the Pi Face 2 was that it can't talk to a 1-wire temperature sensor, so I ended up soldering on a Pi Wingman to give me easy access to the unused GPIO pins.

 

 

 

With these basics in place, the rest of the control software can be written to do scheduling, bring in temperature readings, and allow the system to be controlled remotely.

 

 

Software Architecture

 

One of the early design decisions for the Raspberry Pi powered heating controller was to have the Pi secured behind a firewall without direct access to it from the Internet. What I decided to do was have a set of simple PHP web pages on a remote web host that you can access from anywhere, and the Pi control server talks to that web host to send/receive data.

 

What I didn’t want was for the Pi to run a web server that ends up getting compromised & having the run of my home network.

 

 

The Pi server and remote webspace need to be paired with an access key. Anyone accessing the remote site needs the correct access key to be able to control the system.. and the level of control is limited by the API we’ll put in place.. i.e. remote clients won’t have direct access to your internal network via an open port on your home router.

 

Of course, you could actually host the ‘remote’ part of this set up on your Pi and use port forwarding; the architecture allows for both types of access. The access key is still needed to control the system, but you’ll be more vulnerable to attacks on your Apache/PHP installation & need to keep up-to-date with software patches to help ensure your system is secure.

 

 

I've made a fair amount of progress on a relatively simple set of scripts + PHP that makes this possible.. this video shows how it looks so far. The control part isn't hooked up, but it is able to accept a command from the front-end and pass it to the back end scripts for actioning. The temperature logging is working nicely.

 

Filter Blog

By date: By tag: