Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: And so it begins.... Again :)

  1. #1
    Automated Home Jr Member
    Join Date
    Aug 2013
    Posts
    16

    Lightbulb And so it begins.... Again :)

    Hello

    This is my project thread for my new house. Where I intend to fully automate - and learn from the mistakes that I made last time around.

    Due to a new job, I had to move from my automated home in the country, to a much smaller end terrace house on the outskirts of a town in wales. The house was cheap, and structurally sound. Thats about it for the good bits. The house was built around 1910, none of the walls are square, all the pipwork is visible and the electrics are ancient.

    A lot has changed in the world since I was last on here, but most notably the introduction of low cost computing - i am of course talking about the raspberry pi. The previous house used a LOT of electricity due to the servers (PLURAL) and my lack of knowledge writing code in C.

    During my time away, I started as the manager of an electronics design company specialising in vehicle diagnostics - and learned loads of useful things in the process. The most useful of which are 'C', and a much wider range of low power embedded platforms using I2C, SPI, CAN, LIN and 1wire. A happy coincidence was also that I had a sub contractor on a few of my projects who works for one of the big HA and BA companies - from whom I have learned much.

    I alluded to the fact earlier that many mistakes were made on my previous house, so here are the main ones that spring to mind - and how I intend to solve the issues.

    • Centralised control system
    • High power consumption
    • Too many interconnected protocols
    • Mixed OS's
    • Inability to control any of the system, eg lights when the control server was under maintenance


    My old system was very centralised to the server room, absolutely everything ended up here. It also meant that when there was any kind of issue, the full system went down - if that was in the evening then you got no lights. My new system will be much more localised this time, a raspberry pi for each 'area', using ethernet to feed back to the internet and low power NAS drives for media storage, and a customised CAN network connecting the various components within the area such as switches, pir, lights, sockets, and environmental monitors. Each node such as a light switch will be powered by a microcontroller connected to the local can network. The rasperry pi provides a gateway onto the ethernet backbone. One of the key changes in this version will be that when the network is fully operational - the units communicate as determined by the options on the PI, but in the event that the PI is not available - such as when down for maintenance - the switches, and lights etc have a preconfigured address.

    Example, if the PI is on, then a switch may dim all the lights in a room, or change their colour - but when the PI is down, it looks at its preconfigured settings, and addresses a light directly. You will have much reduced functionality in this state, but the system will be operational until the PI is running again. PI availability is determined by a heartbeat signal given out by the PI.

    The previous system had 3 large servers running constantly, each one drawing in excess of 800watts, the noise was also VERY loud due to the 4 cooling fans on each unit. This gets expensive fast. The new system will have NAS storage as required, I am currently researching power consumption of various NAS drives to find one draws least power when the drive is not in use. The COMMS server that runs the phone system is being moved on to a PI.

    During the last attempt at HA, my coding skills were pretty good, but very WIN32 centric. This means that to get everything running was a combination of USB, DMX, SERIAL, PRINTER PORT, as well as lots of custom bits using micro processors - glued together with some C, Visual Basic, Asp.net, PHP, WSH and some other bits and pieces. All new systems will be written in C, C# or C++ depending on the host. The 2 networks will be ethernet and CAN. I will build adapters to convert any other protocol to can or ethernet as requires within the unit.

    The old system ran on a mix of linux servers, windows servers, windows desktops, win CE, ios and XBOX. All new systems will be linux, with a html5 interface for control devices such ad the phones, tablets or desktop control. Once authentication is sorted out, the html5 interface will also give me full control (minus alarm functions) from the internets.

    I still have all my gear from the old place, but much of it will be incompatible with the new setup, but i have lots of new ideas too.

    And so it begins... I have just reclaimed my website, so http://www.my-digital-house.co.uk will be back up shortly, so I will be uploading pictures, schematics, gerber files and code so that if anybody likes any of my ideas they can make them. I will also be posting full details of my CAN protocol as I develop it, but would love some comments and suggestions once I start uploading the stuff.

    Graham

  2. #2

    Default

    Welcome back Graham. Looking forward to following your new system!

    M.

  3. #3
    Automated Home Jr Member
    Join Date
    Aug 2013
    Posts
    16

    Default

    Thanks Otto.

    Glad to be back.

    Im really looking forward to see what the RPi can bring to the Home Automation arena, and seeing how others are tackling the difficult issues.


    I spotted a thread on here related to geofencing- and that got me thinking that i might start with that.

    As the winter is approaching, it would be nice if the heating was on, and warmed up before returning home at night. So my plans for today are to determine if my phone is located within a fixed distance of the house - and if so initiate a heating control signal to bring the house up to temp. I have not built the heating controller yet, so this will be proof of concept.

    The second phase of this will be to combine the location information with the google directions API (https://developers.google.com/maps/d...on/directions/) to get a time of arrival between the location and home. This information will be used whenever my phone is more than 10miles away from home, and refreshed every few minutes.

    I have started gathering information about the temperature of my home using 1wire sensors, along with outside temp and the time it takes to warm the house from its current temperature to desired temperature. If all goes well then I hope to have the system determine how long the house takes to warm based upon the current outside temp.

    Im sure you can all see where this is heading , but just to confirm. When i head home, the system will figure out how long it will take to arrive at the house, and using the algorithm (whatever it may be) that shows how long to heat the house to desired temperature, begin heating the house - this way the heating is not on if I work late, or go on holiday, but the house will be toastie warm just as i arrive home. Its probably going to need fetteling lol. The initial idea for the heating controller is o maintain a nominal temp when the house is empty, and lower that based on the distance my phone is from it. The system will not be allowed to go below 10deg to prevent damage or mould to the house.

    Graham

  4. #4

    Default

    Lots of great ideas. My only concern is the amount of man hours all that's going to take. Have you looked at existing software? There's lots of new open source ones since you looked last maybe? - http://www.automatedhome.co.uk/home-...nology-choices

    Thanks

    M.

  5. #5
    Automated Home Jr Member
    Join Date
    Aug 2013
    Posts
    16

    Default

    The man at the bank says ive got 25 years to sort it

    But yes I have looked at existing software, but if I am honest - im a control freak and HAVE to understand how every component works in the system. I will be incorporating some of the open source modules for specific features. Mostly though i just love building things and have a very understanding wife

    There are some real neat system out there, but i have not seen one that does exactly what i want.

    I should probably mention that I work with an excellent group of electronic and software engineers who help me out in the evenings, as well as a machine workshop and pcb fabrication facilities. I LOVE MY JOB

  6. #6

    Default

    Nice position to be in. Looking forward to the results

    Thanks

    M.

  7. #7
    Automated Home Jr Member
    Join Date
    Aug 2013
    Posts
    16

    Default

    Today was interesting, it started with registering with developers.google.com for an API key to use the google maps api, and a few hours writing a very basic android app that sends back the location of the phone every 3 minutes to my server, and a prototype app in vb.net to capture the data - and make a google directions API call from the phone location to the house. When you request data using the google API, it returns the route (like satnav) for each turn, but also includes data on the total distance by vehicle, walking or public transport in addition to how long it is expected to take to arrive. This was the data that was needed for the GeoFence feature that I was thinking of.

    The concept described in a post above, but basically by knowing where people are, the house can try and ensure that things get done as people either approach or depart from the house. The best example is having the heating on for coming home, but could just as easily be ensuring that if it gets dark outside (either by physical light sensor or calculated by a webservice) that the blinds are drawn if nobody is around to decide differently. In the future (once the block paving is finished on the driveway) I intend to open the gate when my car (or a car with me in it) approaches the house. All these systems described are only enabled once you have actually travelled away from the house a reasonable distance (currently a purple circle on the map) but will need some testing as its pretty big at the moment.

    I am sure there are many other parts of the house that could be triggered using the information either included with or derived from the location of myself of family.

    GeoFence.jpg

    One interesting side-project from this will be when I get around to building a 'Weasley Clock' from Harry Potter, where the hands have little pictures of each family member, and rotate to point wherever that person in, such as school, work or the library. Lots of people have built these using information from family member tweets etc, but I couldnt find any decent pictures, but here is a normal clock that has been dressed up to look like it - incase you have no idea what I am talking about.

    http://2.bp.blogspot.com/-tzatbb_I7C...ey+clock+1.jpg

    I would like to make quite a large one of these (about 450mm square) for above the fireplace - but I am thinking that I would put small nokia type (or similar) lcd screens on the end of each hand showing each family members facebook picture, the same way as I have for the GeoFence prototype. That way the the Weasley Clock changes over time, and hopefully does not get boring. I have some small geared stepper motors that I got off ebay for next to nothing - and they would have no problem turning the hands, especially if I balance the hand with a small lump of lead on the other side. Once I get the clock built - everyone can configure a 'zone' that they want to be recognized at for each 'tick' on the clock - for example my work, will be different from my wifes, so if I am at my work it will show me at work. If i visited my wife at work, it would show her at work, but me at 'Unknown/Lost/Whatever'


    Now that I know the GeoFence works in theory, the time will now be in making a robust application for the phones, and a proper application for handling the work. This will be run on the raspberry pi, and most likely written in c or c++. I would like it to be a console application/service/daemon type thing that does its thing quietly in the background and sends out notifications to the house when required - but I cannot The licence for the google maps api says that I must use the data provided by them on a map - so I will need to display a GUI (graphical user interface) - it would be a shame if the GUI code had some bugs that somehow meant the maps could not be displayed

    Graham

  8. #8
    Automated Home Jr Member
    Join Date
    Aug 2013
    Posts
    16

    Default

    Hmm attached picture is Tiny

    Can anyone tell me what the maximum pic sizes are please. If needed I can host the pictures and just link to them, as for anyone trying to implement the things that I am discussing they may need to read the code or see specific implementation details.

    I think tomorrow may be a CAD day, drawing up the plans for machining the Weasley Clock, and figuring out how its going to work exactly. I do know that for know it will just be a photo on the hands - until I figure a way of getting data/and or power to the hands whilst still allowing them to turn freely. If there is time, then the asthetics need looking into too - for example, do the hands only turn clockwise?? Do they take the shortest path to the new location?? Do they speed up and slow down, or just go to the position at full speed, then stop dead?? And when you are 'Lost' does the hand stay stationary or does it wiggle back and forth slightly as if its looking for you?? These are all questions that need answered soon.

    Have a good weekend people

    Graham

  9. #9
    Automated Home Guru Vangelis's Avatar
    Join Date
    Sep 2009
    Posts
    131

    Default

    Looking forward to the Project write-ups. Any thoughts on Voice-Control? Been looking at Voxcommando. Although this runs on a Win7 platform, I was thinking of using an Intel NUC platform. I never liked the idea of an 'always-on PC', however I am starting to realise that the Pi it a bit limited on 'grunt' power. I am interested in your plans as it looks to be using the Pi's as a MESH network which could be interesting...

    If you have time, check out this site (http://www.mysmarthomeblog.com), Jon uses an RS485 bus network for his systems - I especially like the 'person count' project

    Vangelis
    Last edited by Vangelis; 31st August 2013 at 09:25 PM.

  10. #10
    Automated Home Jr Member
    Join Date
    Aug 2013
    Posts
    16

    Default

    Hi Vangelis

    I just replied to another thread regarding voice control. I think its starting to look promising - so I am willing to fit a couple of good quality microphone cables during the wiring stage, but I doubt that I will get around to looking at it for a while. I am creating a much more 'user' customisable system this time - unfortunatly that means handling errors correctly, and having some kind of decent UI. Last time around - I never had any of these issues - as I done all the config myself.

    I had a quick look at the site you listed above, its a very good site and I really like the style, and the fact that the information on how to do it is given along with what is being done. I looked at the beam break system, and it looks great - it uses the exact system that I posted up here in 2010, I had some lengthy discussions on my site with someone from here regarding these - and my many failed attempts using lasers and allsorts before settling on the IR LEDs (was that you??). I have to admit that the PCBs that guy has made (Jon??) look a lot neater that mine. I do think that I was close with my single sided retro-reflective led sensors, but just couldnt get it quite perfect before changing over to the two sided approach that I finally used (side note: the lasers worked REALLY well, then my nieces came over for a visit - and I noticed that the lasers were at almost perfect eye level, so they had to go - safety first!!)

    I used to have loads of permanent PCs on, but I plan to reduce that substantially with this build. RPi's running 24/7 doesnt bother me, but a full PC with fans and so on is just too much these days.

    When I was preparing my plans for this place I did look at RS485, as well as many other systems, but in the end I settled on CAN because a) I know it better than any other comms (other than RS232) and b) The built in priority of the CAN message is useful for ensuring that the most important messages get through at the right times (for example, my alarm system has a much higher priority than my outside light sensor - so if the alarm gets triggered at exactly the same instant that the sun went down - the alarm message would get through, and the light sensor would have to wait until the alarm message was sent successfully)

    When you say the PI is limited on grunt, do you operate it using a desktop environment or are you just using a shell console? - I do find the desktop slows it considerably, and for a lot of projects it is not required.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •