Archive

Posts Tagged ‘automation’

Home Easy Interrupts everything!

November 7th, 2009 Ed No comments

Ok, so all the parts of the arduino code work fine – just not all at the same time! The setup is as follows:

An interrupt procedure gets the home easy (HE) signal, and sends it to a callback function.  This converts the sender/recipient/state into strings, and then publishes the data to MQTT.  Problem with this is it takes time, and may be interrupted by the next HE signal.  This problem is exaggerated by the HE motion detectors, which send about 15 on/off messages one after the other.   When this happens, MQTT is interrupted and it leaves the arduino in a very strange state – loop() is paused, and nothing happens until it receives another HE signal, which kicks the arduino back into action – but by that time, any signals like “turn off the central heating” will be lost, so my energy efficient house becomes boiling hot!

So, after lots of hitting my head against a wall, my solution is to add the data to a global “string”, and then in the loop() method, to read this string, split it up into the MQ topic and the data to send to it, and then send it.  I have found the WString library crashes the arduino, so it’s all done by manipulating individual characters in the array.  Really missing the simplicity of Java!

And there are more problems…

Read more…

Arduino Central Heating Control (Home Easy Hack)

November 1st, 2009 Ed No comments

Firstly, I have no qualifications in electronics, I do not totally understand all the different types of central heating programmers, so I accept no responsibility for you screwing up your system. As I don’t have proper central heating cable, I the colour coding is way off – there are no earth wires, despite the pictures showing earth-coloured wires. This is safe – neither the central heating programmer nor the home easy device need earths, so I use the earth wires as control lines.

However, with that over… I’m on a quest to automate my home with arduinos, and central heating is something that “needs” automating. Yes, I could buy a Home Easy central heating controller for £75, but I already have three plugs and in all honesty, nothing to do with them (yet). After reading an article at instructables, I decided to do something similar but hopefully a lot easier. The final result I aimed for was to have my usual central heating/hot water programmer running as usual, but have the home easy plug sitting between it and the pump/boiler so I could make it act like a thermostat. Then, by leaving the central heating on 24×7 on the programmer, I can take full control over it via arduinos and an AM transmitter. Naturally you could use any home easy remote to control the heating as well, but that’s not very exciting! As I’m prone to playing, I also want to be able to bypass the home easy device and let the programmer work as usual – just in case the code/hardware fails!

Read more…

Two-way communication via Nuelectronics ethernet shield…

October 30th, 2009 Ed No comments

…is possible, and does work – but only sometimes.

I struggled last night for several hours trying to get reliable two way communications.  The idea is that every time the arduino receives a home easy command from a remote or motion detector, it sends a message to the MPC-L.  Then, with some funky programming, the server will decide what events to fire off.

Unfortunately while I can reliably receive messages, and reliably send messages, I can’t do both – it just hangs.  I’m thinking it’s the nuelectronics ethernet shield, the software certainly isn’t very nice, so as I’ve only been playing with this for a few days, I’m splashing out on an official shield.  As a by-product of this, it is supported by Nicholas O’Leary’s MQTT code.  So, moving away from last night’s PHP start, I’ll write a small java program to receive these, process them, and fire off any events if need be.

The logic for the event firing will end up being more complicated, but initially, I want a bunch of events/desired actions, and each event has a sequence of signals required, each of which have to happen within a changable amount of time.  Only if a path through the sequence is achieved in the right time will the action be fired.

For example, a motion detector in the hall, and a door open/shut detector on my front door.  An event (i.e. turn off all lights) with a sequence of 1. Motion detector fired, 2. Door opened will detect when someone has just left the house, but obviously you only want it to happen if the time between 1 and 2 isn’t too much, otherwise the person could have walked upstairs and someone else came in through the front door!

I got this working in PHP, so will Java-it-up tonight.  Then will code the more complicated (and more useful) central heating logic (i.e. I want the house at 18 degrees at 7PM, it’s now 16 degrees, and takes 45mins to warm up to 18degrees, so turn on centreal heating at 6.15PM).

AM Transmitters Arrived

October 28th, 2009 Ed 5 comments

Farnell delivered two packages, ordered at 4PM, the next day via UPS – very impressive, must have costed more than the £8 it cost me (free P&P).

So, with the help of the arduino playground and homeeasyhacking, my arduino could receive and transmit home easy messages.

Prototype

The photo shows my prototype of all parts of the project (ambient light – bit of paper coiled up, will be improved soon – and home easy controller).

Wire the data line of the receiver (any of the two work on my receiver) to pin 8, and the data line of the transmitter to pin 6, and connect power/ground/aerials accordingly (I haven’t used an aerial for the receiver yet). A 23cm piece of wire works well as an aerial. All my cables are strands from CAT5 – I’m a cheap-skate!

To use the following code, first download the HomeEasy package from homeeasyhacking, add the .h and .cpp file (Sketch > Add File), then copy and paste the following code. Upload it, then start the serial monitor.

Press a button on a home easy remote and you should see the sender code – copy this, and replace “2427994″ in the code below with yours. Then restart the program, and whatever you programmed the first button on the first slider of the remote should turn off and on. Make sure, unlike me, you haven’t plugged your computer into that device – I eventually got the code working only to kill my computer’s power, oops!

To control another device, change the setHEDevice(0) line.
Read more…