Archive

Posts Tagged ‘Viglen MPC-L’

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).

Graphing Current Cost

October 29th, 2009 Ed No comments

I bought a current cost and Viglen MPC-L (15W low powered computer running Ubuntu) last year, and have since been recording power and temperature.

Power consumption

Temperatures

Adapted from Jibble, I have been recording data in “RRD”, a round-robin database in a single file. Initially, I didn’t have a computer on 24×7, so added some cheap and tacky code to pull the historical data from the current cost meter and log that. A couple of weeks after buying the current cost, I realised I couldn’t live without live readings, so bought the Viglen MPC-L.

View code.

Part of that code runs “colours.pl” with the current power consumption, which sends a message to the arduino telling it to change the ambient light’s colour to a colour that depends on how much power the house is eating up. More about that shortly.