8 November 2008

The Arduino Diecimila

Gadgets are guaranteed to give geeks a special tingly feeling, and robot controllers are a very special type of gadget. Was it William Morris who said that nothing useless can ever be truly beautiful? Whoever it was, he was spot on. By that definition, Robot controllers are immensely beautiful. What's more, they're not difficult to get into, and thanks to the open source hardware movement, they're an amazingly cheap method of making intelligent objects. Robot controllers typically contain tiny amounts of RAM, but because you're not fannying about trying to hoist a pointlessly resource hungry translucent user interface onto a graphics card that can outperform an 80's supercomputer, you don't need that much memory to do complex and genuinely cool things. Robot controllers also have plenty of input/output lines built in, waiting for you to poke the wires from sensors, buzzers, motors etc. into them to give your creation (whatever it is - and it doesn't have to be a robot) a sense of where it is, what's going on and how to control itself in the world. The rest is down to your creativity as a programmer.


I've just bought the Arduino Diecimila robot controller for just £17.60 from Cool Components. To the untrained eye, it looks like a very small and boring interface card for a PC. It's not. It's a full computer with some very special qualities. The chip at its heart is an Atmel Mega168, for instance. This is an industry standard microcontroller, which is basically a complete computer on a chip. It runs at 20MHz and, because it has a simple yet very comprehensive instruction set, it delivers a full 20 MIPS. The chip has 16K of non-volatile RAM on board to store its programs, 1K of volatile RAM to store variables while it's running, and 0.5K to store data when it's switched off. So, it can maintain a persistent state between battery changes - ideal for a robotic pet, wouldn't you say? but isn't the lack of RAM a problem?


No. Seriously. By programming like a real programmer, you can fit one hell of a lot of functionality into this beast. Think about it: you need to store a true/false (boolean) value, for example. Why would you need a 4-byte word to do that? Why not designate one byte to store 8 such booleans? See? Real programming; "tapping on tin" as they used to say is how it used to be done, before Windows came along and PCs became bloated playthings. Who actually needs an Intel Quad Core processor to read their email, for crying out loud?


Sorry, I got a bit ranty there. Anyway, by thinking like a proper programmer, the amount of "mind" you can squeeze into a microcontroller is phenomenal and the RAM seems huge. Want proof? Hundreds of millions of microcontrollers are used in car manufacture every year. They control everything from the dashboard to the injector system. They decide whether to deploy the air bags and tell the mechanic whether the wheels need balancing at service time. Your car may contain several dozen of them.


Everything about the Arduino Diecimila is open source, including the hardware. You can, if you wish, download the plans from the Arduino homepage, buy a Mega168 (they're around £3 retail!), a few resistors, capacitors and wires, solder the lot into a bit of veroboard, and hook it up to the serial port on your PC. You can program it directly from there using the free AVR Studio suite, which gives you the industry standard GCC C compiler, and a superb macro assembler if you want to get really code efficient. It also has a full simulator for a range of Atmel chips so you can test your code properly before squirting it onto the chip and watching it control your creation.


The Arduino Diecimila has 20 I/O lines. 6 can take analog inputs and convert them into 10-bit binary. 6 of the ports will do pulse width modulation, making them ideal for directly controlling servos. The others will accept things like infra-red diodes and photo-resistors directly, and have such high impedence, touching the end of a wire connected to them will cause the input to go high (ideal for touch sensors).


What's more, the Arduino Diecimila has a USB interface. This is used to program it, but there's also a library enabling you to write from the unit to a USB pen storage device. Is that enough non-volatile RAM for you?


So, what can you do with a robot controller? Well, the obvious thing is to make a robot, but there are plenty of other possibilities. I'm interested in making what I call an intelligent object; one that reacts intelligently to it's surroundings and to your interaction with it - a digital pet that goes WAY beyond the idea of a Tamagotchi, for want of a better phrase. One that learns from physical interaction. So far, the design can see light and infra red, it has a basic sense of touch, it can sense its orientation (and any movement), and hear basic sounds. It has light, sound and vibration as outputs at the moment and there are plans to give it a small LCD screen. It doesn't even move yet under its own steam, but the plan is to mount the sensors on a kind of "head" that sits atop a servo motor so that it can turn.


I'll be posting the results of my experiments over the coming months, and hopefully I'll have something basic running to show you soon. It's a big project and something I've never contemplated before, but I'm not doing it because it's easy. J.B Priestly once said that the secret to happiness is to be busy with unimportant things. I'm beginning to see what he meant.


P.S: I have no idea why the formatting of this post is different. I've tried everything. Sod it. Life's too short.


Stumble Upon Toolbar

6 November 2008

Begging to differ...

Home Secretary Jacqui Smith says that people "can't wait" for ID cards to come in. Whoever is coming up to tell her this is, I'd like to suggest, not representative of the entire nation. Frankly, I don't believe it happens all that much.

Can anyone actually say what ID cards are for? Originally, we were told that they'll combat terrorism, but no one could explain how. Next, they were to confirm our identities when we need to do so (getting a passport, etc.) but we can already do that. Then they were to confirm our identities when making a purchase (chip & pin, anyone?) Now they're asserted as being simply a Good Thing. But, seeing as we will not be compelled to carry them, for whom are they a Good Thing?

Well, consider this: The total cost of implementing the ID card scheme now stands at £5.1 billion and the projected compulsory cost to every adult in the UK looks like being £60. Smith claims that the market for issuing passports and ID cards is set to be around to £200 million a year. Would I be cynical in thinking that this is about generating cash, not national security or to "help" us in some indefinable way?

Now, the serious point: ID cards are supposed to be uncrackable. That's fair enough, but as anyone who's ever thought about it for a short while may have noticed, the forms of ID we'll have to provide to get one of these super-duper cards are all less secure. It's like locking a safe inside another safe like a series of Russian Dolls. You still have to hide the key or combination to the outer safe somewhere. This is the eponymous weakest link. And, because security is only as strong as its weakest link, it's open to abuse - as Ms Smith found out this week when a group calling itself No2ID took a glass she'd been drinking from at a conference. This glass apparently has her fingerprints all over it.

So, do we, as Ms Smith asserts, really want to be forced to pay £60 for something that will languish in the back of the bits drawer at home? I think not. Maybe it's time I started a petition: The Campaign for Real Big Brother, calling on the government to either implement a proper, competent police state or to forget the whole idea. No bumbling about in the middle ground promising it will provide indefinable "benefits". It'd be a satirical campaign, of course, but like all satire it has a serious point. Stop wasting our time and money, Ms Smith. The people the terrorists want to blow up is the likes of you, not us, the poor sods they can and do get to. And yet, we're the ones being eyed suspiciously, 24/7.

Stumble Upon Toolbar

Back To Wires, Back To Reality

I've never been a fan of wireless networks but now there's a real reason to mistrust them. Computer security researchers Erik Tews and Martin Beck have managed to partially crack the hitherto secure WPA encryption that should be used on all domestic wireless routers and cards. If you're using the older WEP encryption, please know that it's crackable in about a minute, the tools to do so are available online, and that the neighbour's geeky kid is possibly already aware of this - if he's not had a good look around your network already.

If you're reading this and have only limited computer knowledge, how long do you think it would have been before you'd have found out that WPA wasn't as secure as the man in the shop said? It's not like he's going to call you years after selling you a wireless router to warn you. When WPA is fully cracked, it'll give hackers (more correctly called "crackers") a whole new world to explore. More importantly, it'll give malicious individuals a new infection tool for worms.

The best solution to wireless insecurities is always going to be wires. They may be unsightly in some people's eyes, but at least your neighbours can't steal your broadband connection, or even spy on your internet usage.

Stumble Upon Toolbar

The 9 Acres That Saved Humanity

The BBC reports that Bletchley Park has been thrown a bone in the form of £330,000 to perform essential maintenance on what is possibly the most important and symbolic 9 acres of land anywhere on the planet.

Let's be clear about this: if it wasn't for the code breaking work carried out at Bletchley Park during WWII, we wouldn't now be speaking German as plenty of people think; we'd never have been born at all. England and English culture as it existed would have been utterly destroyed. As it was, after the victory of El Alamein, helped in major part by decrypts of Rommel's secret orders, the allies never lost a battle. We knew what the German high command was ordering before its field commanders did.

When I visited in 2005, Bletchley was in a serious state of decay. The famous huts, where Turing, Welchman, Knox and the others struggled to solve the greatest intellectual chalenge of the age, were falling down. Tony Sale, however, was just putting the finishing touches to a Colossus. Out of interest, the original Colossus was designed and by Gordon Welchman and Tommy Flowers, not Alan Turing.

On the tour I attended, someone asked if the machine works. Sale said that yes it does, and that though they ran it for the morning tour, it was now a little too warm to risk the machine's delicate thermionic valves. Now, I have as much religious belief as the keyboard in front of me, but due to a lack of lunch, dehydration and heat, when I suddenly heard the subframe cracking as it cooled, I swear I came the closest I've ever been to a genuine religious experience. Colossus may look like an overstuffed store room, but to me it's a thing of genuine beauty and wonder.

I love Bletchley Park; if you value the fact that you exist at all, so should you. So should the Lottery Heritage Fund. Bletchley should be a place of pilgrimage. It's where the modern age began and where the Nazis were defeated. Frankly, if my home was on fire right now, the only things I'd save would be my teddy (of course) and the pine cone I found on the path leading from Bletchley station.

Stumble Upon Toolbar

5 November 2008

It's 2:30am GMT as I begin to write this post on November 5th 2008. Democrat Barack Obama has gained 195 votes against 76 for John McCain. Obama needs just 270 and he effectively rules the world unopposed for the next 4 years. Maybe the American civil war is finally over and this is the first true US General Election.

This was John McCain's only ever chance at being President, but it couldn't have come at a worse time. Someone had to stand for the Republicans, and I think he gave it a good shot - given that he must have known he only had at best a slim chance of winning. I reckon not many republicans would have agreed to give it a go. Fair play to him.

Here's my worry, and I'm sure it's nothing, but watching the US presidential coverage, I can't help remembering the feeling I had one balmy night in early May 1997. The witch's ghost was finally laid to rest and things, they told us, could only get better. Their definition of better turned out to be an interesting one to say the least, but as long as Obama isn't planning to launch New Democrats on the world, maybe things will start becoming a little less stupid on this damned planet.

Stumble Upon Toolbar

4 November 2008

Please don't forget to vote

UK voters may remember the night of April 9th 2002, when Labour were expected to landslide against the stagnation of the post-Thatcher years and yet another recession. The trouble is, they didn't win.

Instead of voting, I went to watch some rather poor quality jazz (Andy Shepard and In Commotion at Band on the Wall in Manchester, as I recall). I, like everyone else, felt confident I'd be waking up under a Labour government the next morning come what may. Nothing could be farther from the truth. Enough voters also seemed to take it as a foregone conclusion that there'd be a change of government and didn't vote. Somehow it seemed like it was just time for change. Maybe if enough people had voted the way they said they would and Neil Kinnock had become premier, New Labour would never have come into being. What a different world it may have been.

Nothing is a foregone conclusion in politics, specially at election time. So, if you want change in the US tonight, please for the good of your own happiness, GET OUT AND VOTE!

Stumble Upon Toolbar

3 November 2008

Security Begins At Home (Office)

Well, it's happened again; though the Department of Work and Pensions says there's nothing to worry about, millions of private identities are on the loose - again.

This time, a data stick containing the passwords of people who used the UK Government's Gateway system for everything from tax returns to fine payments was found - wait for it - in a pub car park. Do you want to know how many times the identities of UK citizens have been lost since the amazing bungle that saw 25 million child benefit claimants' details lost in the post last year?

According to the Daily Mail, the Information Commissioner says it's 277. That's data loss incidents, not lost identities.

A couple of months ago, I tried calculating the number of identities government contractors have lost for an article I was writing. My estimate was that about half of us have had our details lost (some of us multiple times) by the very people who should know better - contractors cleared to work on or engaged in managing supposedly secure UK government systems. But are these systems even secure in any meaningful sense when it's clearly possible to simply copy live, sensitive data to a USB pen drive, slip it in your pocket and leave the building so to speak, or when it's possible to take a laptop containing such data home and leave it to be stolen from the back of your car overnight?

The concept of "secure" when applied to government data systems seems increasingly to be a nonsense. What the hell was someone doing with live data in a pub car park anyway? This leads me to a very grave question; one I'd seriously rather not be asking, but one that needs asking.

How long until someone reads the data they find on a lost USB stick or stolen laptop, and realises it's worth far more than simply punting the hardware around the pubs or on eBay? What happens when someone with serious terrorist intentions buys such data and picks YOUR identity at random to buy the equipment for an atrocity? How do you explain to the very nervous anti-terrorism officer screaming and pointing a loaded machine gun at you that you're an innocent, law-abiding dupe, and that it's the government itself that's ultimately responsible? The answer is, you can't.

The rate at which the government is haemorraging our identities is horrific: 277 data loss incidents divided by 12 months is an average of 23 incidents a month or about 5 a week. Under any circumstances, this is completely unacceptable. In such apparently dangerous times, it's deeply and criminally incompetent to the point of recidivism. It's getting to the point where I'm seriously beginning to fear that not only will politicians but the civil service itself lose the confidence of the British public. What happens then? I shudder to think what stupidity may pass for a solution, or what dangerous new influences the country may fall under as we look for a quick fix to a terrible mess.

Instead of our Home Secretary insisting that we, the poor sods who form the great mass of innocent potential terrorism victims, must be monitored ever closer, the state should be watching those whose job it is to keep us safe. Because no one in Whitehall seems to have figured out who those people are, I'll spell it out. They must begin with the people we have no choice but to trust with all our identities. Ultimately, that's themselves.

Stumble Upon Toolbar