Tag: Fun
Arduino powered lights and heating!
by Matt on Nov.07, 2010, under arduino, learning, ubuntu, Uncategorized
Over the past few weeks as it gets colder, I’ve really started to notice the significant bite in heating costs from our flat being largely electrically heated. The main issue with this system is that none of the heaters have thermostats, they are either on, or off. As each heater is 2kW or greater, and there are 4 of them in the flat, that means at any one time we could be using 8kWh of electricity. Which is a lot of money during the day!
The solution? Build a thermostat for them (and replace 2 with a gas convection heater). The circuit for this is quite simple thanks to the fantastic home easy set of sockets. I bought a pack of three sockets (with a remote) and a light bulb holder (we’ll come back to that later). On top of this I needed a temperature sensor (tmp36), a 433MHz transmitter , a 433MHz reciever and an arduino uno.
Thanks to the lovely folks at the Home Easy Hacking Wiki getting this lot to work together with an arduino is easy as anything! Here is the basic circuit:
This is only the transmitter/temperature sensor part. Initially you’ll need to build a receiver to get the ID of your remote. This can be found at this page in the arduino playground. Once you have your remotes ID, you just need a simple arduino sketch to turn the socket thats plugged into the heater on/off! Here it is….
HomeEasy homeEasy; boolean isOn; int incomingByte = 0; // for incoming serial data float timeOn=-900000; int myCode = 1595082; void setup() { Serial.begin(9600); homeEasy = HomeEasy(); homeEasy.init(); isOn = false; // 1 = On, 0 = Off } void loop() { float temp = getTemp(0); Serial.println(temp); if (Serial.available() > 0) { // read the incoming byte: incomingByte = Serial.read(); // say what you got: if (incomingByte == 111){ //turn on the group homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, true ); homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, true ); } else if (incomingByte == 102){ // turn off the group homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, true ); homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, true ); } } if (temp < 18.0 && isOn == false && millis()-timeOn > 300000 ) { //turn on the heaters homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, false ); homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, false ); isOn = true; timeOn = millis(); } else if (temp > 18.0 && isOn == true && millis()-timeOn > 300000 ) { homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, false ); homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, false ); isOn = false; timeOn = millis(); } } /* * getVoltage() – returns the voltage on the analog input defined by * pin */ float getTemp(int pin){ return (((analogRead(pin) * .004882814)-0.5)*100.0); //converting from a 0 to 1023 digital range // to 0 to 5 volts (each 1 reading equals ~ 5 millivolts }
This code ensures that there is no change in status for at least 5 minutes, basically so the socket doesn’t go continuously on/off and damage something! There is also a hook for a serial input to turn on the “group” of the remote. This is to turn on the light in my bedroom. I’m in the process of writing two simple bits of python to turn a light on/of depending which is run. This means I can set up a cron to turn on a light at a given time! Simple alarm clock
To get this code to work you’ll need the homeeasy library from here. You may need to alter the pin allocation in homeeasy.cpp, but that shouldn’t be too hard to do!
Next thing to do on this project is to get my Revo setup as a little wireless server box to graph the temperature changes and run the alarm clock. Conveniently it’s being replaced with a mac mini this week so has become available to complete the project. This will be a simple ubuntu box, running ubuntu server and little else really. Thought it may gain an ldap database for another, slightly different project.
Chillis!
by Matt on Jan.31, 2010, under Fun, learning, life, ubuntu
Having seen other peoples success of growing chillis from seed (specifically theopensourcerer) I thought this year I’d have a go. So in what could possibly be said to be a familiar style…..
I’m only attempting three types of chillis this year, cayenne long hot, navaho and scotch bonnet. In the interest of science I’m trying theopensourcers method of germinating the seeds, and tomorrow evening will be attempting some in plain pots with compost in a heated propagator. This may mean I end up with an absolutley enormous glut of chillis, but I’ll burn that bridge when I come to it.
Here are the seeds ready for the airing cupboard.
I’m also in the process of building an automated watering system for these once they’re in the greenhouse using arduinos, and hopefully connecting to a server in the house using an easy radio link to report the conditions in the greenhouse
Many thanks to theopensourcerer for the information he’s posted on his blog.
Jaunty Welsh Release Party
by Matt on Apr.26, 2009, under Photography, ubuntu
Last night was the Welsh Release party for Ubuntu 9.04 Jaunty Jackalope. 6 people turned up in total, which isn’t bad in my oppinion for a team that only formed a few months ago.
Attending was Nrrd, Suave, Ianto, a chap called Nathan who isn’t on IRC, Brace (?) and myself. It’s always interesting to meet new people, and these are probably the first group of Ubuntu people I’ve met since I bought my Eee PC from Popey
Everyone seemed to arrive at the Central Bar in Cardiff, skipping Starbucks (that may be a lesson for next time) and we sat, had a few drinks and nattered away quite happily. An enjoyable time was had by all it seemed.
Since I was paying for a train ticket into Cardiff, I thought I’d have a wander with my Camera too. The pictures I took over the whole day I was there are in the flash slide show below. Enjoy

