I bought a new doorbell. It actually came as a set, with two ringers. One is battery operated and the other is mains powered, plugging straight into the wall. I once again find myself attempting to keep up with Nick. Having seen his doorbell projectI knew exactly what I had to do: it was time to hook my doorbell up to an Arduino board and put it on the internet.
The red wire is +3V, the black is ground. The doorbell chime unit used to draw its power from two AA batteries, so now it gets the same three volts from the Arduino instead.
The short dangling white wire is actually the antenna for wireless reception of the signal from the remote button, while the long white wire once completed the circuit to the buzzer. The Arduino treats it as an analog signal (and uses the built in pullup resistors to ’steer’ the input to high). I should probably use it to drive a transistor to close a digital switch instead. This way works for now though.
Here’s the Arduino sketch (tweaked slightly from Nick’s blog post).
int ledPin = 13; // LED connected to digital pin 13
int potPin = 0; // white doorbell wire to analog pin 0
int val = 0;
long time = 0;
long debounce = 5000;
void setup() {
pinMode(ledPin, OUTPUT); // sets the digital pin as output
Serial.begin(9600); // open serial port at 9600 baud
digitalWrite(14 + potPin, HIGH); // set pullup on the analog pin
// (analog 0 = digital 14, a1 = d15, etc)
}
void loop() {
val = analogRead(potPin);
if (val < 100) { // if the circuit is completed
// (for me, it generally drops from 1023 to ~ 15 when 'ringing')
if (millis()-time > debounce) {
Serial.println(”ON”);
digitalWrite(ledPin, HIGH); // sets the LED on
delay(500); // …wait for half a second
digitalWrite(ledPin, LOW); // and turns the LED off
time = millis();
}
}
}
To hook it up to my house’s twitter feed, I just need to open the serial line on the attached computer, doing something like this every time a new line is added
curl -u email@example.com:password -d status="There's somebody at the door" http://twitter.com/statuses/update.xml
Nick has already written a nice introduction to using the Google Chart API for drawing charts of household power consumption over time. I’ve been playing with some other parts of the API as part of setting up a web-based dashboard so Rachel and I can keep an eye on our house’s power (as monitored by the Current Cost meter) from the living room computer and our own laptops.
First, I also started playing with what Google describes as Google-o-meters. For example, a basic dial can be created like this
For power readings, I’d prefer to have the colours go from green through yellow to red, and since the colour argument takes an optional 4th component for opacity (00-ff), let’s try making it semitransparent too.
I’ve been spending some time thinking about alternatives to line graphs (or sparklines) for plotting daily power consumption. I’m really liking the radar chart option. These look a bit like this.
(using cht=r for straight lines, and again with the same data but using curved lines, thanks to cht=rs)
It seems quite well suited to rendering 24 hours of power consumption. Like so.
http://chart.apis.google.com/chart
?cht=r (and rs for splines)
&chs=300×300
&chd=s:QKKHHHHIG9JwpHIXddcbUMRUQ(using simple encoding)
&chco=FF0000
&chxt=x
&chxl=0:|0|1|2|3|4|5|6|7|8|9|10|11|12|[etc...] (labels)
&chm=B,FF000040,0,1,0|h,00004444,0,0.5,1|h,00004444,0,1,1(rings at 50 and 100%)
That was a Saturday. Can you tel when we got up and switched on the (power-hungry) electric shower? On a weekday, that initial spike comes a bit earlier.
Even better, I can overlay the daily plots from a whole week in one chart. Using semi-transparent shading helps create a sort of heat-map thingy, thusly.
http://chart.apis.google.com/chart
?cht=rs
&chs=300x300
&chd=s:CBBBBBBBBDXcCBCCXQFFFGEDC,CCBBBBCbTZMCECCCTORRFFFCB, [...] (one per series)
&chxt=x
&chxl=0:|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23
&chm=B,FF000066,0,1,0|B,FF000066,1,2,0|[etc, shading for each series]|h,00004444,0,0.5,1|h,00004444,0,1,1
It looks as though most of our power is spent in the mornings, largely due to the electric shower.
Reminiscing about childhood games last night, my friend Arthur wondered out loud how marbles are made. Nick and I googleraced to find the answer, and (unsurprisingly) both ended up finding the same bit of video.
‘How It’s Made‘ is surely one of the most interesting series on Discovery (perhaps beaten by Mythbusters). The marble video caused us to go on a mini knowledge quest, in which we learned how many other things were made. Golf balls, bubblegum, jawbreakers all have extrusion in common with marbles (though are fractionally less cool), while filing cabinets are about as interesting as they deserve to be. Aren’t the internets brilliant?
A few years ago, I was playing more online poker than was probably healthy (though only ever invested about £10 in online poker at my peak had built it up to well over £100, which I inevitably lost. Frighteningly quickly. (Though not before I extracted the original £10.) I don’t particularly want to start again at the moment).
Reading (this is an addiction anyone would be proud of. I regularly get through 5 or 6 books in a month).
I bite my nails (and I hate it. If you see me doing this, tut at me or something).
EVE Online (I recently suspended my account, since I wasn’t playing it nearly enough to make the monthly payments worthwhile, so my character is currently in the equivalent of hibernation. The past two Christmas holidays have been marked by obsessively shooting space-based pirates though, and I’m sure I’ll get back into it one day).
The addition of an Xbox 360 has meant I’ve been recently hooked on some excellent games. (Call of Duty 4 is amazing, and having played through the single-player game I got sucked into levelling up in the multi-player game until I reached ‘Presetige’ mode. Grand Theft Auto 4 came out this week, and I think it’s already my latest addiction. For a few weeks anyway).
I seem to have a slightly addictive personality. But doesn’t everyone?
I’ve always wanted a pair of Converse. I picked these up in a skate/juggling shop in Brighton today. They were the last pair left (bargain: £20) and just happened to be the right size.
Ever since the Dedicated Followers of Fashion post about laptop stickers used a photo I’d snapped of Cory Doctorow’s heavily stickered ThinkPad, I’ve been a(n even) keen(er) observer of laptop stickers and their owners. I’ve been avidly photographing them, uploading them to Flickr and tagging them ‘laptopstickers‘. Here are a few examples.
(Sparse. As with Dan, you’d know Ren is a game geek pretty easily)
Having bought a MacBook Pro in January, I decided it was finally time to plaster it with stickers. It helps me get past the new-car feeling of having to keep it perfect, and since there are a lot of identical MacBook Pros out there, some personalisation is helpful. I figure that I’ll keep adding them, and if they peel off I’ll just add more. It’s a bit of a release not to be so concerned about the way it looks, though I was ironically obsessive about getting the right stickers before I began.
I’ve been collecting them for some time, but didn’t want to start putting them down on the lid until I had enough to give a good covering. SXSW was a great venue to pick up fun and relevant stickers, and Coté was kind enough to send me some too.
Incidentally, this is the reason I had the Autobots logo etched onto the bottom of the machine rather than the lid; I’d known since I bought the MacBook Pro that the lid was going to be en-stickered, and the laser etching opportunity, while too good to miss, seemed best placed underneath. It gives a chance for surprise and delight, too.
For the first time in my life, I used a Skype video call with my wife today as an ambient backdrop to life, rather than just as tool for having a conversation.I’d always wanted to try it, ever since hearing my friend and colleague Dave Newbold mention, in a presentation he was giving a couple of years ago about the near future for technology and social interaction, something he’d heard described as ‘ambient Skype’, whereby people leave a voice client running in the background while they are away from home as a way of being almost-there.
Where the marginal cost of bandwidth is at or near zero, you don’t have to constantly talk to make use of realtime online communication tools. You can relax and enjoy being in each other’s company, as you would at home. A bit like Leisa Reichelt’s term, Ambient Intimacy, but less about easily staying loosely in touch with many people, and more about actual intimacy between two people by using a (normally) synchronous tool in an undirected way.
Time zones have often made it difficult in the past. I’m in the US and Rachel is back in the UK, our lives don’t overlap much, and we have to make an effort to find times we’re both online, or revert to text and email. Today though, I had some free time in the late afternoon and badly needed a nap. Since it was early enough to coincide with Rachel’s bed-time, we tried falling asleep together, apart.
I found this to be very comforting. It’s rather reassuring to drift off with the familiarity of hearing each other breathing and (for me) the everyday noises of home in the background. A nice way to reduce the distance during a long trip abroad. I don’t know why we didn’t try it sooner.
Three different physics games I’ve been enjoying recently. You might like them too.
1 - Toribash (Mac, Windows) is my favourite fighting game ever. The physics, rendering and tense multiplayer action make it an instant addiction.
2 - Crayon Physics (Windows) is the freeware prototype of something which went on to become the eagerly awaited Crayon Physics Deluxe (the one shown in the video below).
3 - Phun (Windows and Linux) is a fun 2D physics playground. Experiment with gravity, friction, springs, motors, and more. It looks a bit like this
It seems to be inspired by the MIT Magic Paper demo (shown in the video below).
I’ve been helping out as the ‘chief engineer’ at Speechification for a while, and I’m now proud to be joining Russell and Steve in making Watchification happen too.
The aim of the project is reassuringly simple: in the same way that Speechification curates speech radio from around the world, we want to make it easy for people to find the best bits of TV, both old and new. The iPlayer is great, but there’s so much there. Where do you start? Isn’t it nice when friends suggest stuff you might enjoy? Since word-of-mouth is how I discover all of the television I watch, it’s something I appreciate greatly. So we’re trying to do that. Expect it to grow and change as we get used to doing it, and learn what works. We may have some design improvements coming soon, but more on that later.
With my ‘chief engineer’ hat on, I knocked up a nifty little WordPress hack over the weekend, using the Custom Fields GUI plugin as a starting point. I make it easy for contributors to paste a unique ID from iPlayer or YouTube (or Google Video…) which is then extracted so the blog can automatically build the appropriate embed code for iPlayer, YouTube or Google Video, depending on the video source. Realistically, it’s only a little bit easier than copying and pasting an embed code, but capturing the URL (and the editor, the producer, etc) in metadata allows us to have more fun with the data later too. Here’s what it looks like…
If you’re interested enough in television to want to share your favourite bits of it with the world and would like to become a contributor yourself, let me know (roo at rooreynolds dot com).
Alice was kind enough to pick up a packet of ‘Whatevers’ for me from her local ASDA. Now I can be hip. Or groovy. Or whatever it is the kids say these days.
With words like bothered, mint and minger becoming part of British culture ASDA today (27 April 2006) announced it would be selling its own variety of old favourites ‘Lovehearts’ albeit with a more contemporary slant.
While the phrases are certainly more up-to-date than Lovehearts (which I’m pretty sure got an update to include “fax me” and other nonsense), they’re not exactly appetising.
If we’re celebrating contemporary British culture, it’s rather a shame that it can be summed up with “as if”, “bothered”, “chav”, “in it!”, “minger”, “mint”, “proper”, “respect”, “whatever” and “you what?”. There must be better phrases, surely? On the plus side,
ASDA will be updating the sweets on a regular basis so any customer with suggestions to modern day expressions that are missing should contact their local store or ASDA’s customer services department on tel: 0500 100 055.
My first impression is that I’m not sure why “chav sweets” (visible in both of the above photographs) made the cut; it’s a bit self-referential for my liking, and breaks the patterns of the phrase being something you can say to someone as you hand over a powdery fizzy bit of candy to someone. And why does “in it!” contain a space? Shouldn’t it be “i’nit!” or even just “innit!”? In fact, while we’re complaining over the finer details, shouldn’t it be a question rather than an exclamation? Innit?
No I have not phones the customer services department to make suggestions yet. Whatever.
In any case, thanks for the sweets Alice. Proper mint, innit?