All posts by Tony Blews

Genesis of the Arduino Dalek

As previously mentioned here, I was recently given a broken toy Dalek, which I promptly took apart (in the name of Science).

Here it is before surgery commenced…

dalek-1

Having stripped the thing down, I found inside two perfectly good electric motors, and when you find two working motors inside a toy there is only one thing to do: Work out how to use a computer to control them!

So, figuring out that the easiest way of doing this was with an Arduino, I bought one.

I won’t bleat on about how good the Arduino is, or how easy it is to use. There are hundreds of sites that do that.

Instead, here is a list of things wot i dun to get a PC controlling the Dalek.

To start with, I think we’ll have a bit of circuit design. Below is a simple circuit that takes 2 inputs from the Arduino and runs a motor either forwards or backwards. One input decides the direction of the motor, the other whether it is on or off.

relay-circuit

All very nice and abstract, but to be of any use it’ll need to be built. The quickest and easiest way is on Veroboard. So here is the design for that:

relay-vero

The relays do the switching, and the diodes are there to protect the Arduino from back-emf currents when the relays toggle. Two of these circuits will be used, one for each motor. I built them on separate strips of board to make things easier for myself. This is what they look like when all connected up and dumped onto the Dalek chassis:

dalek-wired1

The small board in the top left of the picture is just a plug I bodged up to make connecting the thing easier.

The parts used are 4x 1A5VDC DPDT relays, 4x 1N4004 diodes, a 10×39 strip of Veroboard and some wires.

After all that soldering and burning my fingers, the next step is to write some code to make the thing move.

Each motor can be controlled to go backwards, forwards or stop. This gives nine possible movements, as this table shows:

dalek-matrix

And now its time to test this whole think by writing a program that takes keyboard commands (the letters in red, above) and sending signals to the circuitry to control the motors. Heres it is:

// Project: Dalek control system
// Version 0.1 - Written before my Arduino even arrived
// Tony Blews tony@tonyblews.co.uk

int MotorDirectionR = 10;
int MotorDirectionL = 11;
int MotorPowerR     = 12;
int MotorPowerL     = 13;

void setup()
{
 pinMode(MotorDirectionR, OUTPUT);
 pinMode(MotorDirectionL, OUTPUT);
 pinMode(MotorPowerR, OUTPUT);
 pinMode(MotorPowerL, OUTPUT);

 Serial.begin(9600);
 Serial.println("Serial control Dalek system starting...");

}

// modes for the motor control
// convention here is modeXX - where X is F for forward, S for stationary and B for backwards
// first X is the left motor, second X is the right one
// for direction control, the LOW if forward and HIGH is backward
// for power control, LOW is off and HIGH is on

// all stop
void modeSS()
{
 digitalWrite(MotorDirectionR, LOW);
 digitalWrite(MotorDirectionL, LOW);
 digitalWrite(MotorPowerR,LOW);
 digitalWrite(MotorPowerL,LOW);
}

// move straight ahead
void modeFF()
{
 digitalWrite(MotorDirectionR, LOW);
 digitalWrite(MotorDirectionL, LOW);
 digitalWrite(MotorPowerR,HIGH);
 digitalWrite(MotorPowerL,HIGH);
}

// move straight backwards
void modeBB()
{
 digitalWrite(MotorDirectionR, HIGH);
 digitalWrite(MotorDirectionL, HIGH);
 digitalWrite(MotorPowerR,HIGH);
 digitalWrite(MotorPowerL,HIGH);
}

// spin left
void modeBF()
{
 digitalWrite(MotorDirectionR, LOW);
 digitalWrite(MotorDirectionL, HIGH);
 digitalWrite(MotorPowerR,HIGH);
 digitalWrite(MotorPowerL,HIGH);
}

//spin right
void modeFB()
{
 digitalWrite(MotorDirectionR, HIGH);
 digitalWrite(MotorDirectionL, LOW);
 digitalWrite(MotorPowerR,HIGH);
 digitalWrite(MotorPowerL,HIGH);
}

// move forward left
void modeSF()
{
 digitalWrite(MotorDirectionR, LOW);
 digitalWrite(MotorDirectionL, LOW);
 digitalWrite(MotorPowerR,HIGH);
 digitalWrite(MotorPowerL,LOW);
}

// move forward right
void modeFS()
{
 digitalWrite(MotorDirectionR, LOW);
 digitalWrite(MotorDirectionL, LOW);
 digitalWrite(MotorPowerR,LOW);
 digitalWrite(MotorPowerL,HIGH);
}

// move backward left
void modeSB()
{
 digitalWrite(MotorDirectionR, HIGH);
 digitalWrite(MotorDirectionL, LOW);
 digitalWrite(MotorPowerR,HIGH);
 digitalWrite(MotorPowerL,LOW);
}

// move backward right
void modeBS()
{
 digitalWrite(MotorDirectionR, LOW);
 digitalWrite(MotorDirectionL, HIGH);
 digitalWrite(MotorPowerR,LOW);
 digitalWrite(MotorPowerL,HIGH);
}

//main program loop
void loop()
{
 if (Serial.available() >0)
 {
 char inByte = Serial.read();
 // this version uses the QWEASDZXC "square" on the keyboard
 // as my laptop doesn't have a numeric keypad
 switch (inByte)
 {
 case 'q':
 modeSF();
 break;
 case 'w':
 modeFF();
 break;
 case 'e':
 modeFS();
 break;
 case 'a':
 modeBF();
 break;
 case 's':
 modeSS();
 break;
 case 'd':
 modeFB();
 break;
 case 'z':
 modeBS();
 break;
 case 'x':
 modeBB();
 break;
 case 'c':
 modeSB();
 break;
 default:
 modeSS();
 break;
 }
 }
}

And with that done, I suppose all that is left to do is show a video of the bottom bit of the dalek trundling around under computer control…

… which have to wait until the next post.

Huawei E5830 Mifi Device

Another month brings another Gadget purchase. This time its the Huawei E5830 Mifi thingummy, a combined 3g mobile broadband modem and portable wifi hotspot. Once again it is on the 3 network.

mifisizeThe reasons for buy it are twofold. Firstly the internal GPRS modem in my Ubisurfer has gone down, rendering it useless without another means of connectivity (at least until Datawind’s tech support sort me out a replacement or fix); and secondly, my trust Huawei E220 USB broadband modem is being pressed into service as a permanet net connection for my Linux box running a game server (until Virgin can final get around to installing proper broadband for me).

That’s enough of me justifying the purchase, let’s have a look at the thing.

mifiOoh, shiny. So, pop in the sim card and battery, plug it in to the charger and wait for twelve hours. Thumb the power button for two seconds and on come the five lights.

Ah, you’re thinking, there are four lights! Well, the fifth light (in the middle, not shown) only comes on when you first power up the device or if you feel an irresistable pull to a a foreign land (roaming).

If you’re really insteresting in what the four status lights mean, I’m sure you can find out elsewhere.

Thumb the wifi button for two seconds, then the Saturn button (only my name for it, as it has a little picture of a ringed planet on it) for two seconds and if all is well you’ll be able to connect to the internet through the thing.

Assuming all it well, that is. Sometimes it isn’t. Even though i’m a bit of a 3 fanboy (nine phones and two modems over the years), I still have issues with them. Firstly 3 is a crap name for a company, Whampoa would have sounded cooler; and secondly the coverage where I currently live is ropey at times.

3gcoverageThe darker shade represents indoor/outdoor coverage, whilst the lighter shade shows outdoor coverage only. The pointer shows where I live. Not shown is a 3g modem gaffa taped to my window in order to get a good signal.

Besides the device itself, the box contains a short USB lead and a charger. The charger is, obviously, for charging the thing, and the USB cable is for three things.

  1. using it as a storage device if a microSD card (not supplied) is inserted into it
  2. using it as a USB modem
  3. using the configuration program.

The configuation program (which installs straight from the device itself – nice) allows you to do all the usual wifi router based things: DHCP config, port forwarding, changing the SSID to something rude, changing the password to something you’ll actually remember.

Connecting to the thing is easy with any most wifi devices. So far I’ve managed to get two laptops (WinXP and Linux), the Ubisurfer and a borrowed iPod Touch running concurrently. I know the iPhone works ok (slightly faster that the phone’s built in 3g modem), and I’m sure the iPad will work. (Does anyone want to lend me one to test?)

Sadly, I could not get a laptop running Hexxeh’s Flow build of Chromium OS. But I put this down to Flow failing to recognised the Dell’s WiFi hardware.

Its a great little device. Go and buy one now. £49 from Three on their PAYG plan.

So, all that remains for me to do now are the customary speed test, using www.speedtest.net, as ever.

Firstly using the old E220 USB Modem:

E220 USB Results

And now using the E5830 Mifi:

E3850 Mifi Results

I clearly have a winner here, but your mileage may vary.

Finally, here are the frankly deplorable results taken recently from my sister’s Orange Home Broadband link recently:

Orange are shite

Dalek Autopsy

Daleks are great. I’ve wanted one for years. The idea of having a Dalek to order about appeals to me. I could have it make tea for me and then exterminate my enemies/co-workers.

Daleks instill fear in the weak and feeble. For example:

giant-dalekMy sister recently acquired a defunct radio control Dalek on a car boot sale and figured that I might be able to find something to do with it.

But first we need to see exactly what we’re dealing with.

autopsy1What we appear to have is a Doctor Who – 12″ Radio Control Black Dalek, missing its eyestalk and the relevant control unit.

Someone once said that once you break something to see how it works, you have left the path of wisdom. It might have been Merlin, or possibly Mr. Miyagi. In this case, the damn thing is broken and i left the path of wisdom years ago anyway.

So, off with the bottom!

autopsy2Here we see three things:

  • the base unit – which contains the RC receiver, speaker, battery unit and motors
  • the superstructure – which is what makes it look like a Dalek
  • some turkey mince – which would have been my supper, but was so far out of date that it was in danger of crawling away by itself.

Stripping off the burnt out RC receiver (and letting the mince run free) gives us a closer look at the base unit:

autopsy3An even closer look shows us the nubbin that connects to the drive shaft that rotates the head unit:

autopsy4Peering up the skirt of the Dalek shows us where the shaft connects to the nubbin, along with some wires that connect to the circuitry in the head:

autopsy5Just concentrating on the bottom we have:

  • a base unit with working motors that run off 6v
  • some duff circuitry which will be ignored
  • a piezo speaker which might come in handy later
  • nothing for my supper
  • a blog post which, having re-read the text, will probably rank quite highly in the results of porn searches.

Crewe, Gateway to Hell

According to figures published by the Strategic Rail Authority for the financial year 2002/3, 773969 people began their rail journeys from Crewe Railway Station, yet only 763846 people ended journeys there. This represents a net de-population of 10123 people in one year alone, by train alone. This is as close to 10000 people as makes no odds to me.

In the April 2001 census, Crewe had a recorded population of 67683 people. If we’re being generous we can round this up to a guestimate of 70000 people by April 2003.

Given these figures we see that within seven years of April 2003, in other words April 2010, Crewe will become a desolate no-mans-land inhabited only by temporary, transient people on their way to elsewhere.

I was there today. Its happened already.

If this is Voyaging, I’d rather stay put

Already this year I’ve travelled more rail miles that in the preceeding ten years. Two Stafford/Preston return trips has reminded me why I avoid the railways like the plague: The Virgin Voyager.

441200731_907ea18696_mSome people might say that they represent a giant leap forward in train technology. These people are probably short, have no sense of smell and enjoy rollercoasters. And are probably clinically insane.

Myself, I’m of above average height, can still smell despite a good few years chain-smoking and hate all fairground rides. I’ll neatly sidestep the sanity issue (I’m typing this on a Datawind Ubisurfer – I must have been bananas to buy it).

My first major moan about the Voyager concerns the piss-awful seats and lack of legroom. Now when I say that I am of above average height I mean that I am about six foot four. This doesn’t put me into the realm of basketball players or circus freaks, but it does stop me sitting in most of the seats on a Voyager. Table seats are fine, if you want to share a table with a drunken Scottish squaddie (are they all AWOL and hiding on the trains, or is it always the same one?), and the priority wheelchair users’ seating has sufficient room, but the majority of the seating would require me to undergo a leg-ectomy for me to use them. I suppose I could sit sideways across two seats, but that is uncouth, yobbish behaviour for the sort of folk who play their music loud in public.

When Charles Darwin designed the human olfactory organs he must have had quite a chuckle to himself when he put in the bits that enable you to smell the unique aroma of a Virgin Voyager. Is a whiff of flatulence combined with a hint of smoke? A solid leavening of used toilet with a dash of electrical burning? Or is it,as I suspect, a full blown massive turd secreted directly on to an electric heater full of cat hair? The reason for this is apparently that the toilet effluent tanks vent into the bodywork, and that the wiring is prone to going shonky. Not even the APT had these features!

103180317_c75db8702d_mBut these are just minor nit-picking flaws, I can almost hear you say. Surely the superior ride quality makes up for them? Well, yes, of course, assuming your idea of a nice journey involves lurching from side to side, up and down, and occassionally backwards and forwards. During the course of typing this, my netbook as been dislodged from the little wanky tray-table no less than three times. I’d have a smoother ride in a Land Rover. Across a bomb site. Under shelling.

2502984106_8cb81fd88e_mAnd let us not forget, the government spent millions between 1959 and 1974 to electrify the West Coast Main Line, and now Captain Beardy is pissing all over this by running diesel trains on it. Money well spent! Its like buying the entire run of Star Trek Voyager on DVD, and copying them on to ropey old VHS tapes, then scrubbing the tapes with magnets before watching them.

 

Datawind UbiSurfer first impressions

I’m trying to get to grips with my impulse purchase of the week. For reasons best left unexplored I’ve parted with about 120 quid for a Datawind UbiSurfer from Maplin. Its a ex-display model, hence the slight price reduction over the RRP of £149.99.

DSC00027

So, what is the UbiSurfer? In short, its a cheap netbook running an implementation of Linux. Oh, with a years free internet access thrown in.

More about that later, but first the specs:

  • 7 inch 800×400 TFT screen
  • 128MB RAM, 1GB Solid State disk
  • Full QWERTY keyboard and Touchpad mouse
  • Push-Push SD card socket and 2 USB ports (the box says 3, but I have 2 and a connector I’ve never seen before)
  • Measures 222x165x29.5mm, weighs 700g
  • Battery life provides 4 hours active use and 4 hours

Note the lack of a spec concerning the processor. Apparently it is some form of ARM 500Mhz job.

DSC00028

Applications wise you get the usual word processing and spreadsheet offerings, and a collections of email clients, PDF readers and the like, all GPLed programs.

For web browsing you have Mozilla IceWeasel (Firefox), which only works when connected via a Wifi hotspot, and the UbiSurfer browser itself.
And now we get to the main (only) reason that I bought this thing: free internet access. Included in the price of the device is 30 hours access per month (for a year) to Vodaphone’s GPRS network, via an onboard modem. As we all know, GPRS isn’t exactly lightening fast, but Datawind claim that any web page can be loaded in 7 seconds.

This is supposed to be achieved by Datawind pre-rendering the web pages on their servers (in Canada) and sending them on in a compressed form to the UbiSurfer browser, which then decodes and displays them.
Ok, that sounds fine in theory, but in practice its not so good.
Datawind’s own site (www.datawind.com) takes about fifteen seconds to load, and more complex site such a Google Mail can take up to a minute to fully render.
This pre-rendering process also throws up problems when entering data onto a web page. Tabbing between fields can take up to ten seconds.
Obviously these problems don’t occur when using IceWeasel and connecting via a Wifi hotspot.

DSC00026

But, oddly, my biggest complaint about the UbiSurfer browser is about the hideous splash screen which also comes up when you disconnect, thus preventing you from viewing pages offline. Here it is in all its glory.

splashJust look at the smug pissweasel. Those grass stains are going to raise questions in the office after lunch. Luckily you can overwrite the this image with something less irritating.

I shall continue to persevere with this thing, in the hope that I can find a use for it.

3 Mobile Huawei E220 USB Modem

In the past I bought a ‘phone that did proper internet access. I even reviewed it here and here!

Well, now I’ve gone and bought a 3 Mobile Internet dongle thing. Specifically, the Huawei E220.

3modem

So, what do you get for your 50 quid?

Apart from the device itself, the DVD style box contains a SIM card, a manual that I didn’t bother even opening, two USB cables and some padding that I didn’t bother to eat.

No installation CD? Nope. The clever little chappy installs all it needs from an built in memory stick type thingummy which Business pretend to be a CDROM. Take a not, USB device makers: This is the way forward.

One of the USB cables is a standard 6 inch one, which works ok but means that the modem is hanging about where I usually have my mouse (never having got used to the crappy touchpads that most laptops have). The other is a much longer affair with two Type A connectors at one end, just in case your computer can’t push enough power out from one socket. This is fairly useless to me, as the added cable length means the device needs the two plugs to be connected, and the two USB sockets on cheap mlb jerseys my Dell are on opposite sides of the case. It works great if I have my “media slice” connected, as that gives me 2 extra USB sockets cheap mlb jerseys on the back, but it also triples the weight of the machine, so I usually leave it to gather dust.

I’m using the long cable to connect to my telephone instead.

What you Rentabilidad, probably can’t tell from the photo, is that the sim card holder is held in place with sellotape. It won’t fall out during normal Spider use, but did pop out a few times while in my bag. Hence the classic British engineering fix.

So, how fast is it?

Firstly, here is what I got through my phone on a good day:


And here is what the new dongle gives me:

A bit faster, as you can see. I managed to get up to about 2900kbps by standing outside the house and getting a clear line of sight to the nearest transmitter, which is about 300 yards away.

With this “proper” internet modem connected, rather than the mobile phone, Three aren’t restricting what I can access. So now I can waste my time on b3ta, and won’t get an electronic telling off if I accidentally try and watch some young flibbertigibbet shaking her udders on YouTube.

So what does it cost to run?

Well, you have 3/Skype a choice: £10 for 1gb, £15 for 3gb or £25 for 7gb.

A nice range of prices for you there. Being a bit skint, I opted to only spash out a tenner, and my 1gb lasted a week.

Luckily, you can stick on as many addons as you have the money for, and don’t need to wait until with end of the cheap mlb jerseys month. Next time, however, I will be later getting the £25 top up (assuming that I get hold of some money).

I’m quite happy with it, currently. When I get the chance, I’m going to have a wander in to the countryside, and see how well the modem (and indeed the AMOI phone) function when quite far from a transmitter.

Amoi Skypephone – 4 months later

Last November, I bought a 3 Skypephone, AKA an AMOI WP-S1, AKA an AMOI 8512. My original review of it is here.

skype3phone
After five months of continuous Drive use, I’ve decided to take another look at the phone.

And it is in remarkably good shape, despite being dropped, splashed, almosted drowned, and generally abused. The magnet holding the battery cover in place hasn’t fallen off yet, which is unexpected. Some of the rubberised coating has become a bit worn, but thats not really a big issue.
Remarkably, neither the screen nor camera lens have suffered any damage at all. The buttons all still work, and the USB port has failed to go all loose and wonky.
Physically, it seems about as indestructable as my old Motorola V600 (but I haven’t thrown it at a wall yet – most likely due to not having anything to do with O2 these days).

Skype:

Well, yes. I’ve used it twice, and that was just to see if it worked. I only know one avid Skyper (who will admit to it, anyway), and I never bought it for the Skype functionality anyway. It works.

MSN:

It works now, after 3 finally got around to supporting it properly, but the app is a pain to use on the handset.

PC Connectivity:

To start with, the software seemed overly complicated and tedious. Why, I thought, couldn’t I just plug it in and use it like a USB memory stick? Well. After I found the MicroSD card taped inside the packaging (just as I was about to chuck all the needless cardboard into the recycling bin) and installed it, thats exactly how it wholesale NFL jerseys works. It’s just a pity that it won’t work that way with the internal memory.

MoDem:

This is the best thing about the phone. True, the connection speed is only 115.2kpbs 180kbps download / 43kbps upload at the moment, but wholesale nba jerseys that is double what I was getting through the internal modem on the laptop on a normal dial-up connection. Sadly, the modem now refuses to work when the AMOI’s drivers are installed, but that is hardly a big loss as it was just causing me to run up big phone bills at work.

Pretty much Tinnitus? everything i’ve tried is working over this connection, with the exception of the YouTube multi-uploader. I haven’t tried World of Warcraft yet, because I’d like to retain some of what little of a life I have left.
The connection speed may sound low, but its enough to watch videos without them stopping all the time.
3 do wholesale nfl jerseys have annoying policy concerning what they term as “adult” sites, though. You can’t access them. No chance. This is annoying as i used to use b3ta a lot, but now I can’t (apart from one day last month when their policy got relaxed – or got broken, more likely – for about 6 hours). Also, quite a few of my friends’ sites have been tagged as “adult”, as they are a sweary bunch of troublemakers.
All this talk of data transfer brings me on to probably the most important thing about a mobile phone…

Running costs:

Calls to normal numbers cost 12p per minute, with texts at 12p each. You can buy add-on bundles to make these cheaper, which I only tend to do for texts, as I try to not to ring many people (apart from taxis, pizza delivery places and pubs).
Data is charged at a quid per megabyte, which sounds expensive because it is. However, the internet add-on bundles can save you loads of money and cost 50p for a day, S?zleri £2.50 a week, or £5 a month.
I’m still not sure what the “fair use” data limits are for the weekly and monthly blocks, but daily seems to be about 100mb. Which isn’t bad.
I tend to Amoi stick on a load of daily blocks in one go, as its easy to exceed 100mb in a day (if, for example, you decide to watch all the Happy Tree Friends episodes whilst drunk), and you can move into the next day’s block without having to wait until midnight.
All in all, it cost me about £20 every three weeks.

So whats wrong with it?

The camera doesn’t have a light or a flash. <sarcasm>Oh shame</sarcasm>.
The microSD card was cunningly hidden in the depths of the packaging and nearly got binned. And doesn’t come with an adapter.
I can’t get the modem to work with the built-in bluetooth on my laptop, yet it works with an external dongle. Not really an issue, as anyone likely to want to connect a laptop to their phone will probably have a USB cable on them.
And thats it.

Verdict?

It is still a brilliant and cheap little phone, and works almost perfectly. I’d like to see a new version that does full mobile broadband without me having to carry an additional dongle, and maybe a future one will. I’ll upgrade to that when it comes out, but for now I can handle the slower speed. You should buy one now.
Oh, you want a rating? Right. Which 80s popsters had a song wholesale MLB jerseys called “System Addict”?
Thats right. Five Star.

Amoi WP-S1 3/Skype Phone

This week I got a bit drunk and bought a new phone, a 3 Skype phone. In reality, its an Amoi (no wok included) WP-S1, and this is what it looks like…

skype3phone
Snazzy, eh?

For £49 its not really a bad bit of kit. True, it is on the 3 network, but after being frigged about by O2 and Virgin over the last two weeks I’ll try any alternative.

So, what does it do?

Well. It does all your normal phone crap, plus it allegedly automatically uses Skype when you want it to. I say allegedly as I ‘cant even get mine to log in using my Skype details. And 3’s usually unhelpful customer support have no idea what to do.(But at least they can’t beat the O2 monkey who asked me, twenty minutes into our conversation about why my GPRS had been cancelled, if I owned a mobile phone. No, Sherlock, I can process GSM signals in my head.)

Anyway, thats not important. What can it do?

For me the big win is that you can use it as a modem and get ‘net access. True, its only about 116Kbps, but that better than I was getting from O2. The downside to this is that the software supplied completely screws up all your existing modem drivers. Not a big loss for most people, but bloody annoying nonetheless.

Sadly the internet service is somewhat restricted. Mail and Web services seem okay (with exceptions), but thats it. FTP is blocked, as are MSN Messenger (probably a good thing) and no gaming stuff will work.

For some reason, POP access to my gmail account won’t work, but I can still access the gmail website. Odd.

Access to sites like B3ta are blocked, but thats probably a good thing for me.

A big problem is Facebook. I was never a big fan of it (see elsewhere) until I got the phone. Now I’m on it all the time, mainly because you can access straight from the phone. This is my biggest U-turn since I suddenly decided that VW campers were indeed a bit cool.

The FTP thing is annoying, as I have to update these pages via FTP. I means that I have to go to the pub and use the WIFI machine. Like I needed an excuse.

So… ultimate verdict, is it any good?

Yup. Best phone i’ve had in ages.

Update: Yay! FTP / IM / Flickr uploader…. it all works now!