zeroecho
Posts: 13
Joined: Mon Dec 31, 2012 3:18 am

Creating the one Pi to rule them all

Mon Dec 31, 2012 4:36 am

Hi everyone, I've spent the Christmas break basically reading as much as I can about different Pi projects. I work in software development with a degree in programming (though my day job is QA) I've a GCSE in Electronics from 10 years ago so whilst I'm OK with software development, electronics is a bit out of my comfort zone. I've got so many ideas for what I want to do with my little Pi I thought I'd write up my progress in here to help others who attempt similar projects and to also hopefully get advice from the masters to ease the journey :lol:

Basically I've got an existing wireless security system I got from a well known UK DIY specialist but not really using it at the moment. I've got my Pi a month ago and have a master plan for it link a bunch of things in my house (so far got it running as an AirPi, raspmc and a basic webserver). At it's simplest I'd like to be able to re-use the existing PIRs and door/window sensors from my home alarm system and combine it with a/multiple webcams to send me images to my phone when sensors go off.

OR... if it's not possible to use the existing wireless kit (I think they are RFID based as I had to register each sensor with the master box when I installed it) then to find a way to have wireless battery powered PIRs reporting back to the Pi, I looked into XBee but to be honest it seems waaay too complicated http://lookmanowire.blogspot.de/2012/07 ... e.html?m=1 and expensive http://bitbang.co.uk/rpi.html (I'd like to keep the total cost of this project to around £100-150 on new parts if possible) but maybe I'm missing the point of each of the modules or not aware of cheaper components that achieve the same thing as I want (wireless reporting of status from a sensor such as light, movement or sound)

I've got an adafruit cobbler, half breadboard, connectors and a PIR on order to try a basic starter hack of monitoring my hallway for postal deliveries when I'm at work. I'm still looking for a webcam that'll work with the RPi as my old Philips DMVC1300K doesn't seem to play nicely with it any suggestions for cheap but reasonable quality RPi compatible webcams would be appreciated, with a tutorial for setting it up if possible please as I'm a linux noob (learnt loads this week just by installing LAMP + AirPi)

I saw a pretty cool hack posted where the guy was using this http://www.audon.co.uk/home_web/ts001.html to control lights etc. but I don't want to invest in the wireless controller before getting input - anyone with experience in this area I'd love to hear your thoughts/suggestions

Here's my wish list:
Home security (existing door/window sensors + alarm to go off if certain conditions are met + webcam images send via email/mms/imessages + lights turned on automatically when the sunsets)
Home automation (intercept my wireless thermostat to control it from anywhere & open/close my curtains in a morning/evening. I have a Logitech Harmony, it'd be great to expose that type of functionality via a web interface giving me access from anywhere without needing to point a remote at a certain direction, video doorbell using a webcam so I can reassure my postman it's ok to leave parcels with my neighbours...)[/*]
Media Centre, (airPlay speaker system, a way to meld my NAS media with my PVR via a web interface)

Here's my current resource list:
RPi (512mb)
Edimax wifi
Bluetooth dongle
Adafruit Cobbler
Half size breadboard
Philips DMVC1300K Webcam
IR power saving plug by Lime
Wireless home security system http://www.diy.com/nav/fix/electrical/c ... d=11138222
An old Harmony One remote (I'm trying to figure out how to dismantle it and maybe recycle the IR transmitter, they send me one with a broken touch screen originally hence why it's spare http://www.dtvcontrol.com/harmony/Harmony1Guts.jpg)
Danfoss TP5000RF an older version of this http://www.heatingcontrolsonline.co.uk/ ... p-132.html

I'm contemplating getting these plugs:
http://www.clasohlson.com/uk/Pr182650000/Pr182650000 and maybe one of these http://www.maplin.co.uk/remote-controll ... tor-510524
and this RFID controller http://www.audon.co.uk/home_web/ts001.html
Though most projects on the web I've looked at seem to suggest getting an arduino might work out easiest but if I've got the cobbler I'm not sure if that's going to be the case.

I've a folder bursting with bookmarks from bits I want to borrow from other people's project but any ideas (or criticisms) I'd appreciate, it's a huge project so I'm just thinking of taking things a piece at a time over the next few months, using as much as I can of the existing hardware I've got really.

Thanks for reading!

zeroecho
Posts: 13
Joined: Mon Dec 31, 2012 3:18 am

Re: Creating the one Pi to rule them all

Sun Jan 06, 2013 5:18 am

I ended up getting this as my webcam (with a view to keeping an eye out for a cheap Sony EyeToy the next time I spot one) as I liked the idea of it having wireless already (rules out the need to learn how to use an Xbee with a RPi for now and already can be accessed via the web for normal use and has infrared built in already, I figured by the time I'd got the components to make an eyetoy camera setup do that, it'd cost about the same price as buying this cheaper one)

Got my code grabbing images and emailing me them via heavy re-use of these two great project's code:
http://networkjew.com/2012/12/18/how-to ... -detector/
http://jamesmedd.tumblr.com/post/352709 ... -letterbox

I plan to expand this a bit further and have it output to a service on iOS, hopefully Moped so I can see the images within the post like a text message but not mixed in with my other normal human contact communcation or maybe just Boxcar/Pushover which are also pretty cool services (I use IFTTT a lot already :ugeek: )

I grabbed this PIR and plugged it into my RPi (via a half-size breadboard with some male to female jumper cables) but I've not quite got it working yet (not sure if it's the conditions in the room, my connection to the Pi or my code yet) - it's basically always signalling alarm at the minute unless I disconnect the device, not particularly useful... :oops: so currently it is spamming me to kingdom come when I run the script so use with caution/education for now - I'll keep the code updated as I progress: https://dl.dropbox.com/u/419327/py/moti ... ication.py

For those curious the reason for using this PIR over the webcam's inbuilt motion software is two-fold.
1)The motion software is VERY annoying to setup and keeps going off whenever the sun decides to change intensity (no idea if the PIR will do the same, we'll see I guess when I get it into a useful position and actually working)
2)I may decide to use the PIR with something else at some point in the future so it's useful to know how it works and interfaces, one idea I'm mulling over is using the PIR to automatically switch a few lights on at night instead of fumbling around for a light switch, for example

My soldering iron should arrive tomorrow :twisted: and I decided to dismantle some old "broken" products so I'm aiming to release a few trapped components and try revive them into something a little more useful, namely a motor from an inflatable bed pump that's batteries leaked and pretty much destroyed the rest of the unit as well as a fault Harmony One I had replaced that's got a small LCD screen, 2xIR transmitters and 1xIR receivers I thought could be useful in turning the TV etc. from a web interface

I'm not really sure what I can use hardware wise to try intercept the wireless communications my existing home security sensors and my npower energy meter are using. I'm loathed to rip the latter open as it's currently a sealed working unit (the home sensors can be opened though due to worn threads that's not been a 2 minute do-able job so I've left them be for now). If anyone knows of a way to talk to them from the RPi, I'd appreciate the input and it looks like others would too: http://myhomehack.blogspot.co.uk/2012/0 ... -hack.html :D

nazouille
Posts: 28
Joined: Thu Jan 03, 2013 12:30 pm
Location: France

Re: Creating the one Pi to rule them all

Sun Jan 06, 2013 9:30 am

Just to tell you that an other usb device can be used to handle wirelessly things
http://www.rfxcom.com/store/Transceivers/12103
http://www.rfxcom.com/store/Transceivers/12102

I using one to get only temp/hum sensors measures and I will use it to control lights later :)

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: Creating the one Pi to rule them all

Sun Jan 06, 2013 10:06 am

I'd just like to say, good luck and keep us posted. Your goals seem ambitious but realistic, you're not asking stupid questions, and you're making progress already on your own. Nice one. :)
note: I may or may not know what I'm talking about...

zeroecho
Posts: 13
Joined: Mon Dec 31, 2012 3:18 am

Re: Creating the one Pi to rule them all

Sun Jan 06, 2013 5:27 pm

nazouille wrote:Just to tell you that an other usb device can be used to handle wirelessly things
http://www.rfxcom.com/store/Transceivers/12103
http://www.rfxcom.com/store/Transceivers/12102

I using one to get only temp/hum sensors measures and I will use it to control lights later :)
Thanks for the information, keep us posted on your progress, lights is my next phase just trying to decide what device to communicate from the Pi with, and trying to find the right kind of plug sockets to control them, several brands seem to have low life expectancies

£78 for the usb device seems a little pricey but if it'll talk to everything I want to as part of this project then I may invest, I was considering getting the tellstick which is USB based and with shipping seems to be ~£52. Or if I can figure out the specifics it looks like potentially I could make one for much cheaper http://www.skagmo.com/page.php?p=projects/22_pihat

zeroecho
Posts: 13
Joined: Mon Dec 31, 2012 3:18 am

Re: Creating the one Pi to rule them all

Sun Jan 06, 2013 5:39 pm

toxibunny wrote:I'd just like to say, good luck and keep us posted. Your goals seem ambitious but realistic, you're not asking stupid questions, and you're making progress already on your own. Nice one. :)
Cheers :), yeah I keep coming up with new bits where I think "that'd be cool" so the scope keeps growing but I'm just adding it to the backlog and keep focussing on a little bit at a time so far. It's the electronics side I'm worried about as volts, amps, ohms, IC, filters, FET, darlington pairs, etc. are all a bit alien to me so that's where I'm hoping someone who has done something similar can help out with ideas on what is needed. I'm thinking of ordering a few resistors & LEDs to help me do some test setups.

zeroecho
Posts: 13
Joined: Mon Dec 31, 2012 3:18 am

Re: Creating the one Pi to rule them all

Mon Jan 07, 2013 7:13 pm

Finally got around to reading issue 8 of theMagPi. Looks like I can get a transmitter & receiver for £1.60 from china! http://issuu.com/themagpi/docs/issue_8_final

nazouille
Posts: 28
Joined: Thu Jan 03, 2013 12:30 pm
Location: France

Re: Creating the one Pi to rule them all

Mon Jan 07, 2013 7:26 pm

yup, I think I will give a try to that method later too :)

zeroecho
Posts: 13
Joined: Mon Dec 31, 2012 3:18 am

Re: Creating the one Pi to rule them all

Mon Jan 07, 2013 8:17 pm

I've just ordered this one http://www.ebay.co.uk/itm/RF-Wireless-T ... 416fb17064 which should take about a month to arrive - I'll post how I get on when it arrives

Of course I could have ordered this one for £4 http://www.ebay.co.uk/itm/433Mhz-RF-Tra ... 416f535675 and saved myself about 3 weeks! lol, oh well - will give me plenty of time to nip to Maplins/Clas Ohlson/Screwfix etc. to check out their RF plugs, start writing my web interface and to desolder my harmony IR components (& maybe my tft screen) and try get them working with my setuo 8-)

pocster
Posts: 78
Joined: Mon Jan 14, 2013 12:11 pm

Re: Creating the one Pi to rule them all

Tue Jan 15, 2013 11:40 am

This is an excellent article.
You sound like you are in the same boat as me i.e. software engineer but electronics a tad rusty :lol:
You are also trying to achieve the same goals as myself; a full automation system but built bit by bit with a tiny budget :roll:
My first plan was to get a raspie sorted as a slimbox streamer using squeeze play (I assume quite trivial). But then make it power off when no input i.e. streaming stopped.
Next I was thinking of getting siri proxy to control the music (though how you interface those 2 I have no idea yet :-))) ).
A web front end on my iphone/ipad should also be able to control these things - and then move onto perhaps lightwaveRF for lighting/socket control via the pi.
Lots to think about!

Keep up the great work!

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: Creating the one Pi to rule them all

Tue Jan 15, 2013 1:02 pm

If you want RF remote controlled (by pi) power socket you can get one for £5 from asda/morrisons and no additional hardware needed except a single wire. Software is here:

http://www.raspberrypi.org/phpBB3/viewt ... 5&start=14

I am planning to use this solution to control my boiler.

zeroecho
Posts: 13
Joined: Mon Dec 31, 2012 3:18 am

Re: Creating the one Pi to rule them all

Tue Jan 15, 2013 1:11 pm

It seems a very common goal - here's a brief update on where I'm at:

All my electronics kit has arrived now, except the stuff from China, broke the £130 mark the other day on bits and pieces I needed to achieve this goal but to be fair some of that was because I don't own this stuff and will likely use it again for other projects i.e.

http://www.amazon.co.uk/gp/product/B000L98002
http://www.amazon.co.uk/gp/product/B0050WBY9E
http://www.amazon.co.uk/gp/product/B003NEGZLS
http://www.amazon.co.uk/gp/product/B000LFVHK6
http://www.amazon.co.uk/gp/product/B000ELJ0E2
http://www.maplin.co.uk/butane-gas-refill-25349
http://www.maplin.co.uk/de-solder-pump-97040

I got this to brush up my electronics and also for some components:
http://www.amazon.co.uk/gp/product/B005IWMZ4Y

My AdaFruit cobbler arrived so I've had my first go at soldering that together, yet to get anything through to my breadboard so I think I need to revisit that

I got these whilst they were on special offer, seemed to have good reviews, work at the right frequency and worked out as about the same as the cheaper per unit than anywhere else I'd seen only except these have better reviews (there's a few no-name ones online for packs of 5 for £22 but for £8 difference Maplins currently offering 3 for £15) and at least I can nip round the corner and take them back if they start playing up which seems to be the reason many brands get negative reviews

http://www.maplin.co.uk/remote-controll ... ack-531561

I'm struggling to get my PIR to light up an LED when movement is detected, I'll try take some pictures of my setup to see if someone can assist.

I've salvaged the old airbed pump to see if I can implement it into some form of curtain opening device, it's powered by 9 D cell batteries originally but trying to power it from the Pi from 5v could be interesting (I did wire it to a DC adapter at 9v but it seems to spin then stop, spin, then stop, I assume this is due to AC vs. DC waves) but it's still no way near the top of the to-do list on this project, definitely a nice to have.

I formatted my Rasbian SD card in favour of giving Occidentalis a try as it's supposed to be better for IO projects http://learn.adafruit.com/adafruit-rasp ... s-v0-dot-2 but I've got to reinstall LAMP and AirPi etc.

First step is get the PIR picking up movement and triggering the LED, then once I've provide it's working (i.e. I've not somehow fried the PIR)

Next step is to record the frequencies of the remote I've got.
Then I want to hook the PIR up to the Pi with the RF transmitter once it arrives and have it trigger a lamp I've got
After that I'll be writing the web interface and looking into the IR side of the project
If I get that part working the final step is either intercepting the Thermostat radio signals to the boiler and the nPower energy meter readings or opening/shutting the curtains from the Pi
Last edited by zeroecho on Tue Jan 15, 2013 1:21 pm, edited 2 times in total.

zeroecho
Posts: 13
Joined: Mon Dec 31, 2012 3:18 am

Re: Creating the one Pi to rule them all

Tue Jan 15, 2013 1:12 pm

s7mx1 wrote:If you want RF remote controlled (by pi) power socket you can get one for £5 from asda/morrisons and no additional hardware needed except a single wire. Software is here:

http://www.raspberrypi.org/phpBB3/viewt ... 5&start=14

I am planning to use this solution to control my boiler.
Bit too late for me on the hardware front but it worked out about the same price so it's not the end of the world :)

Thanks for the link, will look into the software side!

pocster
Posts: 78
Joined: Mon Jan 14, 2013 12:11 pm

Re: Creating the one Pi to rule them all

Tue Jan 15, 2013 1:58 pm

I do use global cache itach boxes for IR control; they seem really good and appear on ebay 2nd hand in the usa for a nice cheap price.

zeroecho
Posts: 13
Joined: Mon Dec 31, 2012 3:18 am

Re: Creating the one Pi to rule them all

Sat Feb 09, 2013 3:06 am

It's been a few weeks since I updated this so here's the current status in a sentence:

I am doing too many things in parallel! :lol:

The last component to arrive was the one most crucial to making this awesome, the RF tx + rx!

I have hooked it up to the computer and recorded 6 frequencies (1 for each plug I got from Maplin). I've yet to hook up the receiver but converting to binary was a laborious process I'll be glad not to have to do any time soon. That said it didn't exactly take a life time to do either

I decided to grab a few sensors which when the Pi is running stably (I keep coming back home to find it's unresponsive on the network) is publishing temperature and LDR values to cosm following the adafruit tutorials for using an ADC with the RPi (cost about £5)

I've also got some gears and the motor working, and have a chip that will drive it... I just haven't got them all working together yet because when I hooked a pulley and some string from Ikea up to the motor, the string just wouldn't move due to lack of friction. Need to spend more time on that part of the project (in my opinion it's definitely been the most difficult so far due to absolutely no knowledge of motors, gears or pulleys)

I'm in the middle of installing SiriProxy to add an extra fun way to control the system and have designed how I'd like the web interface to look, I'm leaving the web controls until later once I've got the sensors behaving via bog standard python first. I've started mapping the GPIO ports against what has made sense to use from my experiments on the breadboard.

I received on of the new PiFace boards which whilst fun, isn't going to be much use to me for now until I get the motor + pulley sorted out. The lack of documentation is just hindering me at the moment so I've put it to one side and returned to using the cobbler and breadboards until I get into the components behaving how I'd like them to and start wanting to make it be a tidier package.

I have a noobie question I'm hoping someone might be able to help me with please :oops:

I'd like to combine the c++ code here http://www.hoagieshouse.com/RaspberryPi ... switch.cpp with the rest of my python code which for now looks vaguely like the majority of these two projects: http://jamesmedd.tumblr.com/post/352709 ... -letterbox http://learn.adafruit.com/send-raspberr ... hon-script (I'll publish mine when it's not a horrible mess of functions like it is currently :twisted: )

I'm sure I could run these two as 2 background processes but I'm sure there must be a nice way for them to live as one. I'm not scared by the C++ I'd just prefer not to chop and change languages and I've been more recently dealing with python.

Any ideas please?

Gadjetnut
Posts: 18
Joined: Fri Apr 05, 2013 9:13 pm

Re: Creating the one Pi to rule them all

Fri Apr 05, 2013 11:07 pm

If you are building an alarm system, please check out this website:

http://www.projects.privateeyepi.com/home

They have full instructions on how to create an alarm system with email alerts, web based dashboard to view and control you alarm. No fees.

http://www.privateeyepi.com/image/dashboard.jpg

Return to “Automation, sensing and robotics”