Archive

Archive for the ‘Make Stuff’ Category

Genesis of the Arduino Dalek

July 24th, 2010 No comments

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…

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.

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:

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:

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:

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.

Turning a ViaMichelin SatNav into a Media Player

June 9th, 2010 No comments

ViaMichelin X-950

How do you turn a £20 quid satnav, bought from the local Steptoe and Son, into a pocket media player? Well, I’ll show you.

The aforementioned ViaMichelin X-950 runs Windows CE 4.2 Core as its base OS, with the GPS and mapping software running on top of that.

What we need is to stop it running the the mapping software automatically, but leave it on there with an option to run it.

To do this you’ll need the driver disk that can with the unit. ActiveSync alone won’t suffice here, and anyway it has to be ActiveSync 3.8 as later versions won’t work correctly (especially with WinXP SP3).

So install the software, fire up ActiveSync and connect the unit with a USB cable.

Next you’ll need to download the file at http://www.gpspassion.com/download/custVM_GpsPasSion_buddy.zip and extract it somewhere (to your desktop will do).

Run the custVM_GpsPasSion_buddy.exe program and follow the onscreen prompts. Answer Next/Yes/OK until its done.

Now unplug the satnav from the USB and reset it using the button on the back.

Click the OK box on the screen twice to install both software items, and then wait for the thing to reset itself. It should now look like this:

Win CE Screen

Next you’ll want to download http://hautil.free.fr/bm/ScreenRotate.zip, and copy the files in it to \Program Files\ScreenRotate. Running that program will, surprisingly, rotate the screen through 90 degrees.

Using Windows Explorer, find the file \Program Files\ScreenRotate\ScreenRotate.exe and create a Destktop short cut (File -> Send to -> Desktop as Shortcut).

Next you’ll need to run \My Documents\CustoVM\RegEdit.exe and change some settings.

Change the value of HKEY_LOCAL_MACHINE \ System \ CurrentControlSet \ Control \ Power \ Timeouts \ BattSuspendTimeOut to be 2700 (which is 45 minutes).

By now you’ll be wondering where the WinCE control bar is, and how to input data. Well if you tap the very bottom edge of the screen near the plastic, the control bar will appear, and from here you can enable the on screen keyboard.

So far you should have a machine that boots into Win CE and has a video player (CORE) installed, and the mapping system still available (as an icon on the desktop called MapSonic.

You’ll be wanting an image viewer too, so download the file http://hp.vector.co.jp/authors/VA003011/gqe/gq151hpce.zip and extract it somewhere on your PC. The copy the files from the ARM directory to \Program Files\GQ and create a desktop shortcut.

And there you have it. Copy some sound files, JPGs and videos onto the thing and away you go.

You want a demo? Oh go on.





(The song “Happy Birthday Tony” is (c) Crackerwax 2008)

This info was gleaned from http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=57135 but that is in French, and this isn’t.

Dalek Autopsy

May 27th, 2010 No comments

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 Dalek intimidates Puny Lego Doctor

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

Dalek (minus eyestalk)

What 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!

What lieth inside

Here 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:

Warning: exposed circuitry

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

Nubbin highlighted with red ring

Nubbin highlighted with red ring

Peering 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:

Shaft, with another red ring around it

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

Mini-Rizlas

July 27th, 2007 No comments

Don’t have time for a full length smoke? Boss moaning about the time you spend outside?

Just want to cut down? You need MINI-RIZLA!

Approx 3/4 the length of a normal Rizla.

Inspired by the amount of time I spend outside the pub, not wanting to smoke a whole roll-up in one go.

Get the PDF template, all ready to print!

Categories: Make Stuff Tags: