Building a Hydroponic Raft in a Window Box

hydroponic window box

Let me start by explaining my interest in this: I live in a flat, I have no garden and the waste land I tried to reclaim round the back of the garages the building owners cover it in pesticides. That leaves me one alternative, getting an allotment! Sadly the queues for that are too long and it can take years now to get one, the other issue is that I am incredibly lazy and don’t have much time to take care of an allotment, or any sizable garden for that matter.

So I have no space, I’m lazy and don’t have the time. This leaves me with growing things on my window sill, but this causes an additional few problems, there is reduced space and generally you need deep pots to ensure ample space for good root growth. I also seem unable to get the watering right, either too much or just not bothering at all. If my plants have survived this long then they’ll either get green fly, or more likely lots of tiny flies living in the soil. So growing on my window sill in soil also has problems…

This is probably enough to stop most people, but I figured there had to be a better way that would take little effort and minimal space. Enter the wonderful world of Hydroponics. Hydroponics is viewed as an expensive option to grow your own food since it typically has a high costs to start and requires specialist fertiliser, so growing a lettuce hydroponically will cost far more than if you bought it down the shops – but that’s the beauty in economies of scale I guess. For me the goal is to grow as much as I can in as little space as possible.

Introducing the Hydroponic Raft

The simplest hydroponic construction is the raft, basically you have a tub of water and your plants float on top of it with the roots dangling down into the water. You add nutrients into the water and hey presto, your plants grow and you don’t need to worry about water levels that often since everything is floating.

Which Plants to Grow

The raft method only suits water loving plants, this leaves you with things like salad greens such as lettuce, chard and spinach. I haven’t tried much else in this but I have to say Spinach really loves it. Get your plants started either in rockwool or jiffy pellets to keep things easy.


hydroponic raft parts

Hydroponic Raft

  • Flower box/ trough, needs to be water tight, can get them from the hardware store – make sure it’s sturdy and not likely to bend/ warp.
  • Polystyrene, about 5cm thick you can get this from hardware stores for loft insulation.
  • 3inch diameter net pots (order on ebay etc…) or use some flower pots as long as they have holes in the bottom of them. They need to be just a bit deeper than the polystyrene
  • Growing medium – clay pebbles Hydroton, reusable and cheap but you’ll need to buy on line. Remember to wash and rinse the clay pebbles to get rid of dust.

Hydroponic Nutrients

general hydroponic nutrients

I spent a long time researching nutrients and every one of them come in multi-bottle formulas requiring you to mix them, finding the amounts to mix is near impossible, even from the manufacturers leaving you to trial and error and peoples opinions in forums. So I went with the only manufacturer I could find that had sensible information and a mixing calculator – General Hydroponics. I had to order this online and it comes in 3 bottles, this by far is what costs the most.

Water Quality

ph test

You’ll also need to check the pH of the water and a way to alter the pH. I recommend a small bottle of pH indicator and some ph Up and ph Down from Growth Technology. Just be sure that if you buy it on ebay that the muppet who sells you it ensures the bottles aren’t leaking as these are concentrated acids & alkalis.


  • Aquarium air pump
  • Air hose & air/bubble curtain

This helps to oxygenate the water for better root growth and to inhibit fungus/ mould growth.

You can also add in lighting but I figured start by building the system first.


Drill & 3 inch hole saw (68cm).

Syringe to extract and measure pH adjustments and administer nutrients – you need one up to 100ml.

Something to cut the polystyrene, I know that’s quite vague but it’s so easy to cut that you can do it with anything you can find – you’re only limited by your own patience. Use a saw, a knife, you can build a hot wire cutter with a bit of wood, a car battery and some wire or you can use an electric carving knife and make a huge mess on the floor like I did. Be warned, you will make a mess, do not let your girlfriend witness the mess. Be sure to also have a vacuum cleaner on standby, this stuff gets everywhere.

cutting polystyrene mess

Building the Hydroponic Raft

Measure the flowerbox and divide this into a few smaller sections, the idea is to create a group of floats so that you can lift a section out of the water for maintainance. Draw out your sections on the polystyrene, there’s no need to be too accurate as you can trim the sections down to fit.

Cut the sections down to size – most flower boxes are tapered, so you’ll need to angle the sides in a bit to fit better.

drilling polystyrene

Once done, mark out the holes for the pots – you want to cut the holes just a bit smaller than your pots so it’s a snug fit. I spaced these pots about 4 inches apart from their centres, giving the maximum space for the plants to grow (depending on what you’re growing)

planted rafts

Insert the flower pots or net pots if you’re fancy like me. Fill them with the clay pebbles and add in your seedlings. For this batch I grew my seedlings in jiffy pellets then just added that in to the pot in amongst the pebbles.

Add in the water up to 3 cm from the top of the container, measuring how much water you’re adding. Use the General Hydroponics nutrient calculator and mix in the required nutrients based up on the water volume and desired growth rate, leave it to stand for a couple of hours and check the pH and alter it accordingly – you only need a very, very small amount of acid or alkaline to alter the water pH and you’re aiming for a pH of about 6.5 which in a colour indicator looks like urine (yellow). As an example, for 20 litres about 3-4ml of acid will take it from a pH of 8 to 6.5.

hydroponic window box

If your adding in the air pump, you just need to lay the air curtain at the base of the box, they normally don’t float so it should be fine.

Lessons Learned

The raft was very easy to build, but monitoring the water was a hassle since you need to remove a raft to check it – I wasn’t using a separate reservoir  as space is limited.

hydroponic raft spinach-4 weeks on

The plants grew rapidly, but I followed the nutrient calculator to the letter and ended up adding too high a nutrient quality which meant I got my spinach flowering and some stunted growth in other plants – the only way to fix this is change the water and start again. So I maintained a fairly weak nutrient mix.

I also found that the volume of water, 23 litres to be exact, was more than enough to buckle and warp my cheap plastic flower trough permanently after a couple of months, so I would advise something much sturdier.

warped flowerbox

The clay pebbles I used actually need to be rinsed and washed to get rid of dirt as this causes problems with the roots and also your air pump/ air curtain if you’re using one.


Creating a simple Flash app with Kinect

lucky larry flash kinect

First of all read up on how to set the Kinect up on your computer, I’m using Windows XP here.

Getting the Kinect setup on your PC: OpenNI / Primesense

Interfacing Kinect with Flash & AS3

Now you’ve read those (If you needed to), for this tutorial you’ll also need Flash CS4 or later, which you can download a demo from Adobe for free. Alternatively you can use the opensource actionscript compilers – I’m only using Flash to quickly draw some objects because I can’t be bothered to code them, so you can take my actionscript file and add to it if you don’t want to use the Flash IDE. One note though, you’ll need to compile and run this as an executable (.exe).

You can download ALL my files here

I say *ALL* because it seems that everyone’s more than happy to show their video of this working but no one shares their code, at the very least they share the .exe files. So here it all is and it’s very simple to follow, making use of the excellent AS3 server and libraries from

lucky larry flash kinect files

To quickly test this out, plug in the Kinect, download and unzip my folder, start as3-server.exe and then start LuckyLarryFlashKinect.exe. Perform the Cornholio pose and it should start tracking your right hand. Push your hand out to press a button.

Hopefully that worked albeit a bit glitchy. So how was it done? I’ll walk through this assuming you have some Flash knowledge but essentially it’s just a rehash of the demo on

First get that demo of Flash, I tried CS3 but the AS3 kinect libraries are a bit buggy, so I’d recommend grabbing the latest demo from Adobe’s site, I’m using CS5.5 which works fine for this, but CS4 works just as well.

The LuckyLarryFlashKinect.fla file literally just has the buttons, hand icon and a link to an external actionscript file, if you really wanted to you could just draw that with actionscript code and compile the file using an open source alternative – I’m just being lazy.

If you open that up, you’ll see I have a movieclip called all with an instance name of all

actionscript instance name

That contains the movie clip buttons and 6 instances of the button movieclip

flash kinect buttons

The button movieclip has 2 frames in there, one for on and another for the off state, you could easily change the colour etc… in actionscript but I wanted to specfically show the nextFrame function in my code.

flash kinect hand

The hand movieclip is called Right, this is the hand icon which has another movieclip called handhit. I have this so that I can have a much smaller, more precise hit test bounding area. Under the properties for each movieclip on the stage you’ll see that they have instance names to link them to actionscript. Other than that, the files publishing settings are set to Actionscript 3.0, and to create a SWF and EXE file.

That’s it. Everything else happens in the actionscript file which I’ll walk through in more detail.

Looking at actionscript file now…

First we create our package and import the necessary libaries

	// load relevant libraries
	import flash.display.MovieClip;
	// AS3 kinect 
	import org.as3kinect.*;
	import org.as3kinect.as3kinectWrapper;
	// Greensock for programmatic tweening for rollovers etc...
	import com.greensock.*;
	import com.greensock.easing.*;

Now we create our package class extending the movieclip object and declare our private variables

	public class LuckyLarryFlashKinect extends MovieClip
		// declare new instance of the AS3 wrapper
		private var as3w:as3kinectWrapper;
		// configure a 'depthLimit' limit in millimetres, you need to stand further back than this
		private var depthLimit:Number = 800; 
		// store the depthLimit of the right hand
		private var right_z:Number;
		// store if something has been pushed
		private var isPush:Boolean;

The next function creates the link to the skeleton data via the libary files and then registers 3 event listeners, 1 for the skeletal data and the others for Enter Frame

		// declare the event listeners for skeleton tracking and enter frame
		public function LuckyLarryFlashKinect()
			as3w = new as3kinectWrapper();
			as3w.addEventListener(as3kinectWrapperEvent.ON_SKEL, on_skeleton);

On the EnterFrame function we get the skeletal data and check for the depth of your hand, adding or removing the interaction event listener depending upon the distance. In this function, I also handle the rollover, since it’s present every time irrelevant of depth, I’ll explain that for loop a bit later on.

		private function EnterFrame(event:Event)
			// get skeleton information to retrieve right hand info
			//Depth detection event listener - set it to work at a minimal depthLimit
			if ((right_z < depthLimit)){
				removeEventListener(Event.ENTER_FRAME, interaction);
			}else if ((right_z > depthLimit)){
				addEventListener(Event.ENTER_FRAME, interaction);

			/* Rollover
			 * Because we're not detecthing depthLimit and just x and y, this function lives
			 * outside of the interaction function it loops through all the items within 
			 * the buttons movie clip and do hit detection on each one, instead of declaring 
			 * each individual possible hit test we handle it in a much smaller for loop
			var i:int = 0;
       		for(i; i < all.buttons.numChildren; ++i){
				if (right.handhit.hitTestObject(all.buttons.getChildAt(i))){
					// use greensock to make the buttons bigger/smaller, 0.1, {scaleX:1.10, scaleY:1.10, ease:Cubic.easeIn});
				} else {, 0.1, {scaleX:1, scaleY:1, ease:Cubic.easeIn});


After this we declare the skeleton function to get the data for the right hand and map it to our movieclip named right. For the x and y data I alter this to translate the tracked data to the screen, without this you can only control a very small space inside the movieclip. Unlike the demo files, here we're also looking at z index/ distance from the sensor, this is the real difference between the demos.

		private function on_skeleton(event:as3kinectWrapperEvent):void
		// gets hand tracking and data to build into gestures
			var skel:Object =;
			// right hand position, fetched from the AS3kinect wrapper/ skeleton data
			// I add a multipler (*4) and an offset (-400) to compensate for using right hand only, saving me stretching!
			right.x = (skel.r_hand.x*4)-400;
			right.y = (skel.r_hand.y*3)-400;
			right_z = skel.r_hand.z;

In the final function, interaction, I just observe the right hand depth (z) and if that's less than my depth variable I then execute the hit tests dynamically to figure out which button to click/ animate. So I'm assuming that you stand further back than my depth limit, when the hand is less than this, you're pushing a button. I guess instead of calculating the distance of your hand from the sensor, we could calculate the distance of your hand from your shoulder, head or neck allowing you stand as close or far away from the sensor as you want as your hand depth then becomes relative to your body and not the sensor.

		private function interaction(e:Event)
		/* function that does all the button clicking /gestures
		 * in this case we're concerned on the detected depthLimit to figure out if
		 * a button has been 'pushed'
			// if right hand is at required depthLimit for 'pushing'
			if (right_z < depthLimit){
				removeEventListener(Event.ENTER_FRAME, interaction);	
				/* Same as the rollover loop, detect the hit but also register that
				 * something has been 'pushed'

By setting a depth element (depthLimit), it's this that creates the push to click gesture. However there is an issue, because we're always calculating the z index of your hand in the application file, there's quite a bit of lag and when you want to use logic loops such as 'while' then this can cause you some memory issues in Flash, especially since actionscript is not a multithreaded language.

        		var i:int = 0;
        		for(i; i < all.buttons.numChildren; ++i){
			        if(right.handhit.hitTestObject(all.buttons.getChildAt(i))&& isPush==false){
						isPush = true;
						// greensock shrink the button, 0.06, {scaleX:1, scaleY:1, ease:Cubic.easeIn});
						if(all.buttons.getChildAt(i).name == "myMovieClipName") {
							//Do something for an individual button
            		} else if (right.handhit.hitTestObject(all.buttons.getChildAt(i))&& isPush==true){
						isPush = false;				
						all.buttons.getChildAt(i).prevFrame();, 0.06, {scaleX:1, scaleY:1, ease:Cubic.easeIn});
						if(all.buttons.getChildAt(i).name == "myMovieClipName") {

The final part of the interaction function is the hit test which then loops through each button and skips to it's next frame if it's the one hit, I also left in some logic to get the name, in case you wanted specific functions. I use the for loop rather than write a whole series of if statements, it works by getting the number of child movieclips in the parent movieclip and then iterates through this number to get the index of any child movieclip. With that we can also get the name, frames etc... of that clip. You can read more here about Dynamic hit tests in Flash & AS3

In this loop we record whether something has been pushed so we can skip back and forward between frames - if you were loading new content/ new screen on a button press then you wouldn't need this logic, it's just there as a quick hack.

Finally, be warned, if you introduce a lot of complex actionscript, then expect it to drastically slow down, the tween animations being used are actually happening much slower than they should. This is because of the way in which we're grabbing the Kinect data. If you were to do this with the Microsoft Kinect SDK on Windows 7 you'd still have the same issue due to the amount of middleware needed to get this to run. Looking forward however, my hope is that from Windows 8 onwards we could have native Kinect like the Xbox, I doubt Microsoft will ever support any none Microsoft platform or even their own older OS.

Here's the video of me using the app just to prove that it does work although the push gesture is a bit glitchy...

Flash & AS3 Dynamic hit tests

flash as3 dynamic hit test

I stumbled on to a problem that took me a while to find a simple answer so I thought I’d write it up here.

Basically, let’s assume you have 10 items in your Flash file and you want to detect when your cursor or any other object touches, overlaps or hits them. You could get around this by doing an IF statement for each case something like:

if (myMovieClip.hitTestObject(myTargetMovieClip)) {
  // do something
} else if (myMovieClip.hitTestObject(myTargetMovieClipTwo)) {
  // do something

Of course you could also write this all in a switch statement but that still leaves you with some pretty lengthy code. So instead we can use a loop to do all this work for us.

This works by getting every child element of a parent container such as Stage, root, or another movieclip with the syntax such as:


I would recommend that for everything you want to loop through you put them inside a movieclip and to get round some later issues I’d also put that inside another container so:


So now we can access all your movieclips inside of one, there are a few properties that are useful to know based upon this


As it may suggest this will return the number of movieclips that are inside the one that you call this against e.g.

var howManyChildren:int  = containerMovieClip.parentMovieclip.numChildren;

This gives you the number of items your loop will need to go through, to get a specific child item you can then call it via the index number e.g.


And once you have an that, you can then retrieve the name or even the frames of that movieclip:

var name:String = containerMovieClip.parentMovieclip.getChildAt(INDEX).name

So putting that all together you can then end up with:

var i:int = 0; //stores the count
for(i; i < containerMovieClip.parentMovieclip.numChildren; ++i){
    if(containerMovieClip.parentMovieclip.getChildAt(i).name == "myMovieClipName") {
      //Do something for an individual movieclip

And in a few lines of code you can then automatically detect whatever it is that your cursor etc… has hit. For a few items that’s not going to have a big impact but what if I wanted to loop through hundreds of items in a game for example, do I really want to write hundreds of IF statements, when this loop will take care of it all for me? This loop gets even more powerful when you add in something like Greensocks tween libraries so you could randomly animate every clip in that for loop.

Interfacing Kinect with Flash & AS3


A very quick guide on how to hook up the Kinect with the AS3Kinect project, you can find all the relevant information on the different wrappers for AS3Kinect at:

The AS3Kinect project works with either OpenKinect and OpenNI and you’ll need a specific version depending on the wrapper that you’re using. Talking of wrappers here’s a couple of things to remember about them:

  • You can’t have more than one running, so you have to pick and install one
  • Each one has different features, the main advantage of OpenNI is that it provides skeletal tracking data

I show how to set up the OpenNI & Primesense drivers here: Getting the Kinect setup on your PC: OpenNI / Primesense

I went the route of OpenNI purely for skeletal tracking for some of the projects I was working on. To get that skeletal data you just as easily could use the Microsoft drivers that they released only after everyone hacked the Kinect and then Microsoft realised they were missing out. BUT while they work a bit better and provide everything, it ties you to Windows 7, which I don’t have and don’t need. I also dislike the idea of being tied to specific software.

So, anyway, follow my set up for OpenNI as that’s what I’ll be using in later tutorials. Now you’ve done that it’s very easy to use the AS3 server, just download it at:

Unzip that somewhere and in the XML file you’ll need to add in the license key (Similar to the OpenNI setup steps):

For reference my later projects/ examples will have this info done for you.

The .exe file is your AS3 socket server that pulls the data from the OpenNI drivers for you to use in your Flash projects via the as3kinect actionscript libraries. I tend to keep an instance of the server in the same folder as my Flash project as well as the libraries. You’ll always need to have this running to get Kinect data, incidentally, if you close your Flash projector file (.exe, .swf) you’ll need to restart the server each time.

AS3demofilesIf the AS3 server doesn’t start and if you’re sure the drivers are installed, first check the power! If the Kinect is not plugged into the power supply and you’re just trying to use the USB power, this isn’t going to work.

Anyway, to test this works download the demo AS3 files:

Unzip that, start up your AS3server and then run 3d_test.exe if it’s all working then you should get something like the following screenshot:


To get the Kinect/ OpenNI drivers to recognise you, you’ll need to perform the pose which I’ll refer to as ‘The Cornholio’ cornholio

Once you’ve done that you should be able to see the program tracking your hand movements.

Now that’s all working have a look at to get an idea of how to pull data using the as3kinect library (in the org folder).

Got it? Good, time to move on and I’ll show some examples of using this data.

Introducing the Harley Davidson Toilet Seat

harley davidson toilet seat up

Are you a Harley Davidson owner bored with your toilet seat? You’ve got every other piece of Harley branded merchandise but to really show off that you own a Harley you need the Harley Davidson toilet seat. Sadly, in their infinite wisdom of branding just about everything that they can, Harley have overlooked the humble toilet seat. I mean look at the below image of the toilet, hardly awe inspiring is it?

the old toilet before

No offense every day toilet owners but the prized buttocks of Harley Davidson owners around the world are offended by this above insult, they demand more, so here I am to right this wrong. To paraphrase the band Manowar, every man should be “Sitting in Leather, riding on porcelain”.

Firstly, not being a Harley owner myself, I needed to find out how to make something ‘Harley’ and there’s a few simple steps:

  • Black, orange or white in colour (or combination)
  • Must use as much leather as possible
  • Must feature leather tassles
  • Must have Harley logos on every surface possible
  • If possible should feature a lot of chrome

Easy! Follow the below to build your own authentic Harley toilet seat which is in no way endorsed by Harley themselves and may land me in some trouble…

Parts list:

  • Black toilet seat
  • Leather tassel strip/trimming – about 1 metre in length. (Ebay)
  • 2 sheets of Harley Davidson decals, must feature the Screaming Eagle (Ebay)
  • 2 leather paniers for additional storage on those long toilet journeys – must have tassels and big enough to store toilet roll, trail mix, tools etc… (Ebay)
  • 2 wire coat hangers to help attach the panniers to the toilet bowl
  • Hot glue gun, pliers and cutters

Step One:

Put the Harley logos on the toilet seats and panniers, remember that every side must feature a logo somewhere, even if it’s not visible at first.

I used the largest Screaming Eagle logos on both sides of the toilet seat, a smaller version on each of the panniers and the smallest version for the front of the seat itself.

The basic Harley logos were then added to each end of the pannier.

To apply the decals correctly, first cut around each one in the sheet and then peel back a small area of the backing paper and slowly apply the decal to the surface using something like a cloth to smooth out any air bubbles.

harley davidson toilet seat closed

Step Two:

To add the tassles to the toilet seat, start by finding the centre of the leather tassle trimming and using the hot glue gun add a small blob of glue and stick the tassles in there until it sets, you want to ensure it’s perpendicular to the seat. Work around the tassles every 5cm or so adding another blob to secure it in place.

To finish off now work around the inside of the tassle strips base with a generous amount of hot glue to secure it fully in place (and help keep it in shape).

harley davidson toilet seat open

Step Three:

Now you need to figure out how to attach the panniers to the toilet bowl. I found that by taking a couple of wire hangers I could build some basic hooks that could attach themselves to the rim of the toilet, each toilet is different so it’s trial and error using pliers and cutters to bend and shape the wire.

harley davidson toilet seat up

Step Four:

Locate your nearest Harley Davidson owner and install this masterpiece in their bathroom. Inform them to kiss that snooze-fest of an old toilet seat good bye.

Await the sheer joy and pride that they will surely exhibit and the now overly frequent trips to the toilet that they’ll be sure to make.

the sweet joy of a harley davidson toilet seat owner

Optional Extras:

  • Tassling for the flush handle
  • Handlebars/ mirrors
  • Harley engine sound when flushed
  • More chrome
  • More leather

Unfortunately you’ll have to create your own exhaust sounds, but for that I recommend a healthy amount of sprouts, bran and beans.

If you’re from Harley Davidson, can I have a bike please and in return I’ll build one of these for your showrooms!


I wrote to Harley to introduce them to the concept of awesomeness, turns out they were less than impressed and without a sense of humour. Also turns out that they have so many Harley Davidson toilet submissions that they have a category, I’m waiting to hear back if mine was the best they’ve seen. Below is the email thread for your amusement:


Probably not the best place to mail the idea to, but hopefully it’ll amuse you and bring a smile to your faces.

I thought I would share with you something that I built as a Christmas gift for a friend who’s a Harley Davidson owner (883 I believe, but could be wrong) and already has a wide range of HD merchandise.

After visiting a few of the Harley Davidson shops in Las Vegas recently, I was amazed to see just how many things feature the Harley logo but I sensed there was a gap in the market that has been overlooked.

With that in mind, I feel I have corrected this wrong with an early prototype. You’ll have to excuse it’s crudeness as it still lacks any chrome and the leather is still minimal but I think I’ve added enough Harley logos to it to compensate for this.

The Harley Davidson toilet seat: see the attached photo of the look of joy on the owners face at this gift. That’s right, the toilet seat has leather panniers!

If the joy and excitement of my Harley owner friend of owning this is anything to go by, multiply it by the millions of people world wide who own a toilet and you’ve got yourself a serious opportunity here.

If you’re feeling generous, I would love to own my own Harley and would happily build you one of these seats in return.



(Photo of Kevin looking really happy was included)

Dear Larry,

Thank you for expressing an interest in utilizing the registered trademarks of Harley-Davidson, in conjunction with toilet seats.

Harley-Davidson is unwilling to enter into a license agreement with your company.  We’ve received similar requests in the past, but our current licensing strategy is twofold:  to concentrate on products that we believe further the motorcycle experiences for our current customers and to bring new customers to the brand through relevant products that demonstrate our unique brand attributes and values.  Accordingly, we are unable to consider pursuing a license agreement with your company.

Although this letter is not the response you anticipated, we hope that it does not in any way reduce your enthusiasm for Harley-Davidson Motor Company. 

Thank you for considering Harley-Davidson.
Harley-Davidson General Merchandise – Licensing

Thanks for the quick response, however I think you misunderstood my intent.

It was purely to show what I made as a joke gift and may be make you smile. In my email I mentioned nothing about being a company, licensing etc… But it’s nice that you think I’m capable of that level of commitment and thought.

Forgive my questioning but I’m interested in the bit where you write that your strategy is to “concentrate on products that we believe further motorcycle experiences”… If you don’t mind me asking, how does a licensed Harley branded popcorn machine, oil can party lights or salt & pepper shakers further the riding experience?

Not to push the point, but, with my toilet seat you can at least pretend you’re riding something and let the imagination wander as you make the sweet, sweet sounds of a Harley during your bathroom break. It was the lack of chrome wasn’t it? I knew that would be an amateur mistake.

Anyway, it’s good to know you at least got the mail and you were correct about it not being the response I anticipated, I was hoping for something along the lines of high fives being thrown up and free bikes being given out. The offer still stands if you would like one sent to your offices.

I thought the look of ultimate joy on my friends face surely enchanced his Harley experience, trouble is I think he’s now spending more time on the toilet than on the Harley now.

Thanks again for taking the time to respond to my nonsense,


(No reply received)

Dear Larry:

Your recent message has been forwarded to me for possible further comment.

Your enthusiasm for our brand is terrific!  And, we hope your friend enjoys your gift.  However, we need to make sure you understand that without a written trademark license directly from Harley-Davidson, you cannot produce more of these for selling purposes.  FYI, there have been a number of others who have decided to go ahead with “Harley-Davidson” toilet seats without our permission, and so we keep a close watch on that category.


Hi Judy,

There’s no intention of producing these for sale, it’s only for a fun one off as a gift. I use the term ‘prototype’ in the loosest possible sense of the word, if I was serious I would have spent time adding in chrome as well as more leather and possibly a custom toilet basin based on the classic V engine, which you have to admit does sound pretty sweet.

Anyway, I didn’t realise that so many people actually take it that seriously to build Harley Davidson toilet seats for sale and that you have so many genuine submissions. I hope that mine is one of the best toilet seats you’ve seen in a while (if you saw the pictures or link in the original mail). My friend Kevin thought so, but he’s not been seen since – he’s been spending too much time in the bathroom now by all accounts but luckily my toilet seat features panniers on either side to store trail mix etc… so he should be ok.



(No reply received)

So far there has been no offers of free Harleys or congratulations given for making awesomeness personified in a toilet seat. I still think I should have added in more chrome and leather to get their attention. Maybe a few more logos as well…

Getting the Kinect setup on your PC: OpenNI / Primesense

Here’s the full details and process on getting your Kinect running on your PC using the OpenNI and Primesense drivers, yes this may be a little old news for some, but my guide here will actually get your Kinect running pretty much first time rather than leave you to guess and try to follow the other guides out there.

So first of all you’ll need a Kinect! Now we’ve sorted that out, the rest is easy and just a matter of following the steps – I’m documenting this as much for my own use as well as yours… I’m doing this for a Windows XP laptop, but you can do this on Ubuntu, Windows 7, Mac OSX etc…

1. Remove any existing drivers

First of all, if you have any drivers previously installed for the Kinect, such as OpenKinect, Freenect, Microsoft Kinect drivers etc… you’ll need to remove/ uninstall them. They will appear in the device manager under Human Interface and normally be called something like Xbox NUI Motor, Xbox NUI Camera, Xbox NUI Audio. Incidently when you install the OpenNI/ Primesense drivers, they are named differently and you do not want to under any circumstances use the above drivers.

2. Download and install the following drivers & binaries

download kinect sensor driver

Head on over to Github and get this package which you want to download that and then navigate to the Bin directory and install the relevant driver for your OS. This has the drivers precompiled for you but you can also compile this from source. The file will be something like:

  1. SensorKinect-Win-OpenSource32-

OpenNI downloads

Next, you’ll want to go to OpenNI.orgs download page and for each of the options select stable choose which development package you want for your OS:

  1. OpenNI Binaries
  2. OpenNI Compliant Middleware Binaries
  3. OpenNI Complient Hardware Binaries

You can also download & compile these from binaries by going to the OpenNI github page

So now you should have 3 files something like:

  1. openni-win32-
  2. nite-win32-
  3. sensor-win32-

Or whatever you’ve compiled from Git, run the installs etc…

On the Primesense Nite installation, if prompted for a key, add the following:


Now that’s done you’ll need to download and install the Microsoft Visual C++ Redistributable Package for your OS which can be found at:

In my instance I’m using the x86 one, for windows 7 use x64 etc… just grab the latest one available. This allows you to run the OpenNI applications.

3. Plug and pray

Now plugin the Kinect – make sure you have the power plugged in as well, not just the USB! Your computer should recognise the Kinect and want to install the drivers – make sure you choose the Primesense ones if prompted – I found that when I had old drivers it remembered the location, so I just zipped up the folder and archived it to remove it from the driver search.

Device manager after successful install

If all goes well you should have 3 hardware installation screens on Windows and the device manager should show the hardware under Primesense

4. Setup

Now that’s installed there are a few more things you need to do in order to hook up OpenNI and Primesense, namely a few XML config files which you just need to add in the same license key so that Primesense will work for you that key was:


Insert OpenNI key

Link OpenNI and Primesense

5. Finished

Now that’s done you can start to play around with the examples – there are various wrappers/ API’s available to you to now use this to create applications.

  1. Test out OpenNI by running the NiViewer sample
  2. Test out Primesense by running any of the samples there

Primesense sample

Now you have that installed you can move on to using various wrappers etc… to hook the Kinect up to Flash, Silverlight, Processing, Arduino, Java, Python etc…

Arduino : Convert Decimal to Binary

arduino convert decimal to binary

When programming Arduino you’ll eventually at some point want to get to converting decimals to binary or the other way around. In most cases it’s normally because you want to read a value and set a number of pins on the board or use a shift register etc… to control multiple pins e.g. a PWM value from one pin (0-255) that then sets 8 pins to either high or low (on or off) depending upon it’s representation in binary, 255 = 11111111 setting all 8 pins to high or 1 = 00000001 setting only one pin to high.

For the purposes of this we’re going to consider only using decimals up to 8 bits/ 1 byte, if you were going for an integer larger than 255 then you’d use 16 bits for representation in binary which Arduino can handle just fine – 8 bits just means it’s slightly easier for me to write up.

I could show the really, really long way of doing this where you iterate over each digit of a decimal and then convert that into a binary after one giant for loop but why bother when there’s a much quicker way using Arduinos / C++ inbuilt functions that are available to you for free.

Here’s the code, just copy, paste upload to your Arduino board and check the serial monitor:

void setup()

void loop()
int myNum = 67;
int zeros = 8 - String(myNum,BIN).length();
String myStr;
for (int i=0; i

This is only an example so I've left all my variables inside the loop. The setup loop just sets the serial port monitor so you can see an output.

So first we declare our decimal to convert, in the real world this would be a value fetched from the serial port or from a sensor of some kind. You'd also want to check that the number is less or equal to 255 and is not a negative nor a float (meaning it has a decimal point) e.g. if myNum >=255 then do my stuff etc... We declare our decimal as an integer (a whole number).

Now skipping slightly ahead you'll see that I'm using String(myNum, BIN). This is a built in function of the String object in Arduino that, for free, will convert your number into a binary string, you can also use DEC, HEX and OCT for other conversions (guess what DEC does?). The trouble with this is that it misses the leading/preceeding zeros off the conversion, so 1 = 1 not 00000001 and while it's not the most efficient way to add in the zeros it does mean later on when you loop through that value you can always expect 8 bits and don't have to allow for it to be more or less.

To add in the zeros we can use another function of the String object and calculate its length - how many characters make up the string. We then subtract this number from 8 to get how many zeros we need to add and with a simple for loop we create our string with the required zeros.

We then join / concatenate our string with the original binary conversion to get our 8 bit string and that's it. You can write the string joins in a shorter way but for understanding the code I've ignored this.

So now we have a binary string that can be sent over serial or then split up to turn on and off 8 pins. You'd probably want to convert this string to a character array, char[], and iterate over that array to then set/unset your pins.

Why I wouldn’t go to Peru with The Adventurists

I should add that the below is my opinion, feel free to skip to the end to see various links and comments that give more information for you to make your own mind up.

So my friends and I saw an opportunity to drive something that can only be classed as one of the most unsuitable vehicles on the planet through the challenging terrain of Peru. What was better was that this could be done for charity and it looked like a genuine adventure for us. Even better there’s a company that was organising the trip, called The Adventurists, basically they look after the paperwork and vehicles leaving you to pick your own route between the start and finish of the ‘moto taxi junket

The MotoTaxi Junket

So we went away and did some research, the vehicle it’s self is a moto taxi / tuk tuk. Basically it’s an underpowered knock off motorcycle converted into a trike with a shabby roof on top. We read up on a lot of issues people had had with them, mostly mechanical and due to poor construction but also down to user error and lack of understanding/ training – people not even having used a motorbike before wondering why their chain breaks or why they break spokes in a wheel.

This sounds like an horrific idea to knowingly rely on something that is most certainly going to break down, but being a motorcycle mechanic to me this didn’t seem like any kind of issue that couldn’t be handled without some basic preparation. Next we read up on some horrific injuries and incidents and decided first aid classes would be the way to go along with learning the language along with emergency paperwork, funds and tools to help us avoid these kind of issues. We were getting prepared…

The Adventurists

It should be noted that we had this figured within 3 months of booking with The Adventurists, though you would have thought we’d have had this kind of information from them by now on what we need to do for the mototaxi junket, at least a ‘thanks for giving us your money’ or a ‘here’s a check list’ etc… but nothing arrived (and it never did). So we were left to figure all this out, what did our ‘entry fee’ buy except their lunch? We hunted around on the site and finally found a very poor PDF file called the ‘team handbook’ which promised on one page a cost breakdown but gave nothing, along with very little useful information. What were we paying them for?

This started to spook us somewhat, here are these guys ‘organising’ our trip, vehicles/ mototaxis and paperwork but had failed to organise anything except taking our hard earnt money and leaving anyone on this trip to fend for themselves under the guise of ‘it’s an adventure’ rather than a lack of their organisational/ operative skills. The lack of organisational skills really hit home when we attended one of their afternoon tea’s which considering there was a free brewery involved (Hendriks Gin), they couldn’t organise a piss up and the event soon descended into a big unorganised amateur mess leaving us disappointed. Also turns out that most of the other attendees seemed to be rather richer than us and dare I say it, upper class, it must of seemed like a jolly good hoot to spend mummy and daddys money – from the ones I talked to or overheard, not one of them had any idea of what they were getting in to and the lack of support they would get. I guess for them, they wouldn’t miss the money they paid if they decided later they didn’t want to take part.

The MotoTaxi Junket is an “Adventure”

Did we really want to trust even our own paperwork to The Adventurists let alone our lives? I think not. During this time one of the events already running couldn’t finish on schedule and the routes had to be altered, it was really hitting home that these guys had taken our cash and given nothing in return, not even an email or event information and then left the participants at the mercy of their lack of organisation claiming that this makes it an ‘adventure’. It makes it a nightmare but tally ho, the entry fee is only the average lunch bill for most of them anyway.

At least when you hire a car you get some form of paperwork, we didn’t even get that, just a Google Checkout receipt on email for a cost paid for the mototaxi junket and nothing else. If it was billed as a rally event etc… then yes, you’d expect to do all the planning yourself but you’d still be provided some basic information as well as legislation etc… – you’d also have a pretty big team to manage everything, but as a small team of 2 or 3 people you rely on The Adventurists to organise things a bit more and do some of that work for you.

So it was time to chase these guys up, we’d had nothing, they clearly can’t organise anything so what were we paying them for except our own funeral in a flaming roadside wreck in Peru? What was the fee paying for, if it was passports, visa paperwork, medical insurance, vehicle rental etc… it was leaving it a bit late to sort out and it blatantly wasn’t going to get done by them. If we were doing all the work then why pay them? I can sort out a similar trip, granted not the mototaxi junket, to Peru and not only get the transport but I can get my flights and accommodation sorted out into the bargain as well by the operator with not much extra to pay. Now that’s organisation!

Getting a Refund from the Adventurists

So first contact after the initial 6 months, we enquired about refunds, just stating we needed to pull out and what could we do as to our statutory rights as consumers, nothing nasty. Nothing, a month passes. Chase up again. Nothing. We call a few times. Nothing. Ok, now time to threaten to put it officially in writing with legal advice. Now we get a response, however, they seem upset as to why we’re threatening them and say there’s no chance of a refund since they state there’s the ‘standard’ 28 day refund policy. Standard for who? when you lease a car or plan a trip or event, the refund policy normally works by notice of cancellation prior to the event. They had 6 months notice! Further more, we’d booked via credit card which, in the UK, grants us under section 75 of the consumer credit act financial protection if goods have been paid for and nothing received which seems very apt, since we’d paid and received nothing. So we threatened with taking this to our bank, and lo and behold something could be worked out, relying on another team falling for the con and we recieving our entry fee from this team.

So why couldn’t we get this cash ourselves from The Adventurists, why should we as the consumer wait for another team. If you were getting a refund for services not delivered by a builder, you would be irate that you’d have to wait for them to charge another customer before they could refund you so why is this OK in this context? “We’re only a small company” is the excuse given, which is pathetic. But still we wait for the cash to be nice and give them a chance.

This goes on for months, chasing, chasing, chasing and hearing nothing back. Only recieving the occasional vague reponse and being fobbed off. Time to threaten again and finally we get the refund. So why couldn’t they have done this to start with, seems like their financial as well as organisational skills are flawed. Yes, they maybe a small company, but that doesn’t mean we have to put up with poor customer relations, product and a lack of services. It took 6 months in total for a refund. 6 months!!

Have an Adventure with anyone but The Adventurists

All in all I am very happy to be not using their services, I think I dodged a bullet there. I will admit that perhaps for other people involved this wasn’t a concern for them and I’ll be denounced as being over cautious or being against the ‘spirit’ of an adventure. But hey, I’m weird like that, liking to have a plan for traversing a country I’ve never been to before and getting something for the money I’ve paid in good faith. I’d like to think that I’m one of very few people that had any issue with The Adventurists and perhaps this was a one off experience for me, however the 6 month back and forth and poor communication along with snide remarks from them just made me want to publish my thoughts on the experience for others to learn from.

If anyone is considering booking with them follow these tips:

  • Make sure to read all the information up front and ask the questions before giving your cash away
  • Make the booking on a credit card as you’ll have some level of protection
  • If you receive nothing after paying, contact them in the first instance asking for refund and then go direct to your bank – do not bother to wait for them, just get your bank to do it on your behalf

I would really have liked to have done a diary or write up of the mototaxi junket and taken part in the event but instead I’ll do something similar via another operator – take a look at riding motorbikes through Peru, plenty of operators, they may not have as flashy a site as The Adventurists but I’ll bet you have a far better time.

To all the teams entering, good luck and I hope it’s worth it.

Update: 20/12/11

In the comments below, Richard was kind enough to explain the breakdown of the fees paid – something I never got from The Adventurists but it’s worth reading to help you make up your mind in case you wanted to know. Also it’s good to know that I am probably one of the very few people who had any issue with them and that it may just be down to the company growing in size.

Useful links

Just for the purposes of additional information to follow I’d like to list below various blogs and sites detailing experiences good or bad with the Adventurists so that you can make your own mind up. Feel free to comment and post links and I’ll add more as and when I find them, but I’m specifically looking for sites that talk about dealing with The Adventurists rather than the just the adventure itself, actually, scratch that, I’ll chuck up links to anything that’s worth a read if it helps anyone else out.

Mongol Rally

Good diary/ write up of the Mongol Rally experience:

“A blog to uncover the truth about how the Adventurists are run. Teams are unhappy, Visa service was a joke, borders didn’t let cars through. What do we get for our entry fee?”

“Mongol Rally and the Visa Machine (thank God for The Adventurists)”

Mototaxi Junket

Detailed write up of the Mototaxi Junket:

Rickshaw Run

Diary of the Trans India Rickshaw run:

Playing with Peltier Elements

Something I’ve been continuously dabbling in is producing electricity. I figure that it’s not enough just to use it and I should look at ways in which I can produce and scavenge it to understand it better.

This is a simple exercise in which we look at Peltier elements and the Seebeck effect. By running electricity through a Peltier element you can make a device which can either heat or cool something. Not only that but by heating or cooling one side of the Peltier element you can generate electricity from something either hot or cold – note that this isn’t free energy and this is only useful for recovering waste energy.

And if you doubt any of this, then give it a go for yourself.

For this project you’ll need the following items (shown above):

  • Heat sinks – I ripped them out of an old computer, from the CPU and the graphics cards – basically you’re looking for anything aluminium or copper based, sheet or section metal will also work just as well.
  • Batteries – I’m using 3 AAA batteries to generate about 100ma / 3.5 V
  • Breadboard – not essential but useful for a quick circuit
  • Low power LED – I’ve added a couple of short leads to mine
  • Electrical tape (just in case) – balanced the heat sink on above the candle and also taped the multimeter probes to the peltier
  • Candles + lighter/matches
  • Thermometer – this is a medical one, use anything you have to hand (get a proper one, mine was rubbish)
  • Multimeter
  • Toothpaste – Yes! This is correct, it’s not a mistake.
  • A Peltier element

You should be able to find everything you need around the house for free, you don’t need anything fancy except of course the Peltier. To get one of these, they are used in some computers to help cool the CPU but probably, like me, you’ll just have to buy one. I got mine from Farnell Electronics – they have a good range of them on the site between £11 and £125, they also ship worldwide which is handy. The one I chose is a bit pricey at about £20, but it has a good temperature differential, low internal resistance and fairly low voltage/current at maximum temperature differential – meaning I won’t need to use a huge power supply to see it working. This is the Peltier element I used and here’s more Peltier elements listed.

Ideally after doing this experiment, I want to get a few more and you may also want to do that as well once you realise what you can do with them. Anyway, I guess I should actually explain what a Peltier Element is…

What is a Peltier Element

In 1821, Seebeck found by using two different metals that are connected by two separate junctions, they will develop very small voltage if the two junctions at maintained at different temperatures.

In 1834, Peltier discovered the opposite of this, he found that if you apply a voltage to the same setup that it caused a different temperature at each junction, allowing you to generate both heat and cold from the voltage. Although what’s actually happening is heat transfer, the heat is transferred from one side to the other, making this a solid state heat pump.

You may also find they are referred to as TEC’s – ThermoElectric Coolers or in some cases TEG’s – ThermoElectric Generators. Essentially the Peltier Element is a combination of lots of very small thermocouples, junctions between 2 different metals or semi conductors and these are sandwiched between 2 ceramic plates and then encased in silicon.

They are in no way as efficient as regular refrigeration and are used for the benefit that there is no maintenance, no moving parts and they can occupy a much smaller space. They are used when the rapid heating or cooling or something is needed – typically lab work.

So if they’re so inefficient why do we care?…

Energy Scavenging with Peltiers

OK, so you can’t get a lot out of these, but the point is by combining them in systems that produce a lot of wasted heat, we could minimise the waste and reclaim this. Granted, this is not going to amount to much, but scale it up and you can see why car manufacturers such as BMW are beginning to combine them around the exhaust – some of that wasted heat from the engine can be converted to electricity. So if you’re going to waste heat, why not get the most out of it?

Imagine an oven lined with these, or a device that could cook your food and chill something at the same time. Of course, it’s much harder than that, unfortunately Peltiers aren’t able to transfer much heat and because they work by creating a temperature differential, you need a way extract the heat and keep the other side cool at the same time. So just sticking them out in the sun or on the side of your oven isn’t going to generate electricity, it works on a car exhaust because of the air flow when the car moves cools one side.

OK, enough talk, on with the demonstration…

Generating temperatures with Peltier Elements

This circuit is really simple, we’re just going to connect the Peltier to the battery cells and measure the voltage. You can see from the picture above, I’m using the breadboard to connect the two, but this is just me being lazy. Be very careful when you connect this to the battery – one side is going to get very hot. For safety I’m resting this on one of the heatsinks. These temperatures are generated from a 3.5v source and to show room temperature I’ve added another thermometer.

Here’s the hot side giving out 42.6 degrees C

And the cold side was too cold for my thermometer to read – need to get a better one but it felt much like something fetched from the fridge

What I did find is that when I had the heatsink on the hot side, I got a much better result, also there was no notable heat from the hot side, however much more heat off the batteries! It seems these are much better at cooling that heating.

Generating electricity from heat

Still a simple circuit, but this time no batteries! the LED is going to be powered by the Peltier (hopefully), it’ll be really dim and if you can’t see anything, use the multimeter to measure the voltage and current – I did warn you not to expect much! The trick of course is to remember basic physics, heat rises, so ideally you want your peltier to the side of the heat source so that only one side is heated, otherwise you’re not creating the optimum temperature differential – this is what the metal is for – conducting heat to the peltier. First time and I get 0.5volts and 260 mA, not enough to light the LED.

Oh and the toothpaste? So, the surface of the heat sinks and the peltier are going to have lots of imperfections and because of this, they won’t transfer as much heat in between the element and the heatsinks. You could use thermal paste but I don’t have any to hand – I found using toothpaste (seriously!) works just as well for a short time, however, under heat it soon dries out. It’s also much much cheaper to use as you experiment. Basically I think any kind of paste will do, whatever you have to hand. I found that with this, I got additional voltage and current generated (0.67V and 350mA), as below – also just to prove I really did use toothpaste, I added in the picture of the nice striped toothpaste being applied.

I also increased the heat source to 2 candles which proved to substantially improved the readings to 1.05 volts and just over 520 mA!!. Still not enough to fully power my LED and I have a feeling that prolonged temperatures like this even with my toothpaste additive is shortening the life of this Peltier.

If I could generate airflow over the heatsink on the non-heated side, I suspect I could further improve the temperature differential and create more electricity and also further distance the heat source, it was still much too close but Idid the best with what I had.

In conclusion

So there you have it, from 2 candles I very inefficiently generated over a volt of electricity, I could really refine this and improve it but unless I’m using candles anyway, then there’s no point other than for demonstration. I’d be interested in adding in multiple elements to generate more, which I may do in the future, but I’d have to run this from something where there is wasted heat – maybe my motorcycle engine block.

Anyway if you want to get some energy back from the heat you’re wasting, want to heat something, want to cool something then have a look at these. They’re probably not that efficient used to cool electronics, such as computers but there are plenty of niche uses that can be found for them and they’re definitely worth playing with if you get the chance.

I was also surprised that the elastic band holding this all together didn’t snap off! 🙂

One top tip – to remove the toothpaste, the best thing to use is… a toothbrush! And unlike thermal paste, it leaves your heat sink smelling minty fresh.

I now have visions of a candle powered Arduino!!

Google tweaks algorithm to lower value on spam sites

Google content algorithm change stats

Looks like things have shifted again for anyone who follows natural/ organic search trends and I’ve been meaning to share some of the things I’ve seen in the search engines – I’ve even included some base stats but I won’t give exact figures. From all the information I can look at, it would seem that there has been a tweak in Google for long tail search, e.g. the really obscure phrases you think that no one would possibly search for. The site I work on has pretty healthy global traffic and tracking in multiple search engines but my comments are only based upon this so please take with a pinch of salt.

Google content algorithm change stats

7th Feb we see a spike in traffic from Google in general, nothing from Bing or Yahoo for instance. Checking the locality of this reveals that the spike is most prominent for and, other sites don’t show as strong a trend, not to say that nothing has changed in for example but I’m not seeing it in our stats. Compare again to Bing and Yahoo and they don’t show the same trend. In fact Bing and Yahoo both show a dip in the prior week.

Traffic is poor in December due to seasonality, so we can rule that out as it’s a given. So we’re more concerned with performance over January onwards. To further rule out seasonality I checked out our rankings (comparing around 20,000 terms) and for Bing and Yahoo they’re pretty flat but we see uplift in Google which ties in with the traffic increase. Currently there is no activity from ourselves to encourage the upwards ranking change. So what we see is traffic being generated in Google by higher volume/ variance in keywords – we gained around 3,000 terms from com overnight that previously didn’t generate traffic and again they were generally obscure and long tail – none of them you would class as trophy terms. Of course my classifications based on this site are going to be biased as what I class as long tail are somebody’s core terms, sorry I didn’t have time to chart this one out though (maybe if I get chance later).

So what changed? Well hunting around and I think at the end of January there was the switch in Google to apparently ban low value auto/ bot scrape sites – no not the crappy Demand Media content farms because they provide Google with a huge revenue stream. So anyway, checking back in the stats and funnily enough we don’t see any correlation in traffic to this supposed release date – but then it would probably take some time before changes were effective or noticeable.

This change would make sense since we’re now attracting more long tail traffic – I don’t think this is a direct benefit to ‘big brands’ but obviously they’re going to have more of a trust factor. Having a look at my own site and even on a poorly optimised site such as this blog I see a small uplift overall and it seems that well written unique uninterrupted content is starting to gain more importance which is the way it should be (finally). Also checking the link profile to pages that are gaining or losing rank will probably show that the emphasise is shifting to heavily penalising crap links.

Also this highlights the fact that if you want to do questionable tactics for abusing natural search then do it for non-English languages and Google sites as it seems there’s always a delay in rolling out these changes.