Tuesday, February 04, 2014

Space Invaders Table

So... I realise that it's not so much that I'm lazy about doing any projects, I'm just lazy at writing up any thing.

And so it was that I was inspired by the light up coffee table on hackaday http://hackaday.com/2014/02/03/ikea-led-table-mod-doesnt-lack-awesome/ today.

Inspired to write up a project that I'd completed about three years ago.

I'll start by saying that this was not my idea, I was inspired to make the coffee table after seeing a similar table on the make blog, http://makezine.com/2008/11/11/space-invader-coffee-tabl/

This coffee table uses what look like regular 4 inch tiles (slightly smaller than the average bathroom tile [6 inches]) to create a mosaic table top, Of course old 8 bit pixel sprites lend themselves very well to being made into tables from normal square tiles. it (and every other table of this type I've seen) takes the option to tile the entire table top, all the way to the edges -I decided to inlay my design in the centre.


The tiles I used were tiny in comparison (to the 4" tiles), I used mosaic tile mats, these are 12" square mats that have lots of 1" square tiles stuck to them in a uniform pattern of random colours, Black, white and two shades of grey.

The first step is to remove the tiles from the flexible backing and sort by colour, -the tiles can be just pulled off the backing -or the backing can be peeled off the tiles which is probably the more accurate way to describe the process.

Next you need to get yourself a LACK coffee table from Ikea, one of the little 50cm square ones, I chose to get a back one.

You can choose to assemble the table, or just work on the top on whatever work bench you have.

Start by arranging your tiles in the pattern that you want, you could either look at a reference picture (as I did) or make up your own design. include all the spacing in your tiles that you intend to put between them (grout lines).

Now mark out (using pencil) a square in the middle of the table, -your tile size, and your intended tile spacing will determine tile size -measure your layout! (I used a pack of tile spacers, but with a 3d printer you don't have to use the off the shelf ones -you could print your own, or you could use matchsticks etc...)

When you have your work area marked out start with a large "Stanley knife" (box cutter) and a metal straight edge and score the lines in the table top.
A good tip (unless you're very good with the knife) is to start in the corners working towards the middle, this means that you won't drag the knife on the table top that will be left.

It is unlikely that you will be able to cut through the top in a single pass of the knife.

Once you have cut out your pattern shape you need to pull it out. this will leave a hole in the table, and leave you with your first challenges.

The challenges are:
That the table is not solid, inside the table is a hexagonal arrangement of cardboard. you cannot set the tiles on that cardboard. not the thin air in the hexagonal gaps.
Secondly
That the tiles are going to be around 5mm (1/4") thick, but the table top (hardboard/melamine type material) is much thinner.

To get around this you need to firstly trim down the cardboard (either using the knife of a pair of scissors) -don't worry about being too careful of the height that is left.

Once you're done trimming down the card you need a can of expanding foam insulation.
carefully squeeze a portion of foam (don't fill because it expands) into each of the hexagonal pockets.
the foam will expand to fill the pockets and slightly dome out of the top of them.

Now using a large flat serrated knife (bread knife) cut the foam so that it's about twice the width of a tile under the surface of the table top.

Spread tile adhesive in a layer on top of the foam. and using the plastic tile spacers, ensure that the gaps remain consistent. push the tiles into the adhesive such that the tops of the tiles are level with the table top.

Now leave the table another day or two for the adhesive to properly dry.
finally fill in the gaps (grout lines) between the tiles with tile grout.

The table I used was a black Lack table. cost £5
The tiles I used were two packs of kitchen/bathroom mosaic tiles (cost £2 each) -and I have plenty left.
Expanding foam I used cost £2 per can, only a small can is needed (whilst there is some left, foam sets in the nozzle making the can useless unless you clean it directly after use)
the tile grout I used was a grey glitter grout.

The final results are here:





Monday, October 14, 2013

summer holiday

So, (and not for the first time)

I reached a lull in posting, not that I was doing nothing, but I had nothing to write about.
I've been doing a few projects, but have yet to write them up.

I'm going to start writing again, but perhaps at a slower frequency.
I've tried posting once every few days, (years ago) and found that far too hard to keep up with.

I wish I'd done once a week, then I'd still have a ton of posts cued for release.

I tried once a week, but without some hardcore time spent writing and having a stack ready and scheduled for release I couldn't keep on top of writing here, making else where and a job and a family!

So now I think I'll just post as and when I need to. when I'm inspired to write a lesson, rather than looking for stuff to pad a blog, and posting when I have completed a project rather than trying to do smaller projects so that I can update more frequently.


Thursday, October 10, 2013

First accidental explosion

http://makezine.com/magazine/what-was-your-first-accidental-explosion/

So Make asks what was your first accidental explosion...

For me it's something that I won't forget. not because it was especially dangerous. but because I was so young and so paniced.

To start with it might be a good idea to set the scene.

1, I have always been interested in hacking electronics, this started from the day I took an old record player out of a skip and salvaged the components out of it using a soldering iron borrowed from my grandad.
I'd borrow books from the library to learn how to put circuits together and how to build different things.

2, As a young boy I was always interested in pirates, as in the swashbuckling kind, I used to have a book about pirates, and frequently would play "make believe pirates" I suspect (thinking about the house I was living in at the time) that I was about 7.

Hence we come to my first accidental explosion...

So one day I'm playing pirates, and I'm make believing that I'm exploring some kind of cave searching for buried treasure, in order to explore said cave I need a candle.

So I go to my "parts box" and select a light bulb, some wire and a 9v box battery. I wrap some wire around the bulb and around the "turret" terminal of the box battery, then press the other terminal of the light bulb directly onto the battery, "et voila" I have a candle, and go back to exploring my imaginary cave.

My candle however is not very reliable, I try securing parts with tape etc, but for some reason the bulb keeps going out.

Then bang, the battery explodes.

(the battery has shorted on my cello taped bits of wire (that bridge the battery connections), the current flowing has heated the insides of the battery, caused the electrolyte to expand and eventually the seal has blown.)

This is where the panic set in, the battery has exploded in my hands, (exploded is not the right term, all that's really happened is the bottom of the battery has blown out) my left hand is now covered in electrolyte, except I'm seven and have no idea what electrolyte is, I've no idea how battery's work -just that they make my toys go, in fact the only thing that I know about battery is the words battery acid. So as far as seven year old me is concerned the electrolyte from the alkaline box battery is acid, and my hand will melt any time soon.

After I realised that my hand wasn't melting I did find that the acid was just a weird murky jelly, and the inside of batteries apparently contained black sticks (carbon rods)...

So that's my first accidental explosion.


Monday, July 01, 2013

Quine McCluskey

Well I'm absolutely thrilled that I've gotten some feed back on a blog post.

That feed back was to point out a mistake, I'd like to thank Dr.K.Veerabhadra Rao, for pointing out my mistake.


I'll leave the original post untouched, save to provide a link to this post to show how it should have been done.

http://ah-screwit.blogspot.co.uk/2012/10/electronics-lessons-quine-mccluskey.html

You could argue that I should edit the original to save someone getting the wrong idea, but then, surely anyone learning should read the whole thing. I want to stand by my mistakes, it's my mistakes that have gotten me when I am today!!

So here goes! So I've looked at boolean algebra, and karnaugh maps.

(I've highlight in red where this post where the original! went wrong!!)

What you may have realised is, first, binary systems become very big very fast.

But second, Boolean algebra, while useful has some pretty head churning limitations, feasibly there are no limitations, practically it's extraordinarily hard to be able to see what reductions may be created when dealing with more than three or four terms.

Karnaugh maps were a lot easier, yes they did require you to keep your wits about you whilst filling them in, the four by four map was filled logically as row 1 column1, row2 column1, row4 column 1, row 3 column 1. this carried on, but you filled column 1, then 2 then 4 then 3. so you sort of feel like you're jumping all over the place, and the logically last filled cell is at the middle of the table.

On top of that there is also the problem that karnaugh maps have a limitation on the amount of inputs that you can deal with practically, (it's difficult to use with a large number of inputs)

Now I'm going to briefly cover a algorithm called Quine McCluskey.

What makes this different is that it's expressed in a tabular formation. except rather than drawing boxes around the table we look for the number of ones in a given row where the output is true.

In order to demonstrate this I'm going to go back to the seven segment display. remember that first table that showed for each state 0 -15 what the 7 output segments on the 7 segment display needed to show;

0 = 0000 = 1 2 3    5 6 7
1 = 0001 =       3          7
2 = 0010 = 1    3 4 5 6
3 = 0011 = 1    3 4    6 7
4 = 0100 =    2 3 4       7
5 = 0101 = 1 2    4    6 7
6 = 0110 = 1 2    4 5 6 7
7 = 0111 = 1    3          7
8 = 1000 = 1 2 3 4 5 6 7
9 = 1001 = 1 2 3 4    6 7
a = 1010 = 1 2 3 4 5    7
b = 1011 = 1 2    4 5 6 7
c = 1100 = 1 2       5 6
d = 1101 =       3 4 5 6 7
e = 1110 = 1 2    4 5 6
f =  1111 = 1 2    4 5

We'll start the demonstration of Quine McCluskey by looking at the table of outputs for segment 1 of the seven segment display.

Then we draw a new table.
This table looks at the number of 1's in a state,
then the name of the state, (which is called a minterm)
and the binary representation of the state.



Now we look at the minterms and see which ones differ by only one bit.
Then we re-write these terms, using a dash to signify the bit that does not matter.

Look at minterms m14 (1110) and m15 (1111)
These are re-written as m(14 15) 111-

So you add these into that first table now, just a column along.
Mark any min term that cannot be combined, in this first case all minterms can be reduced.



OK, so now we have a table that has our first reduced minterms
It looks like we've got more work to do, yes it does look more complex than when we started, but honestly this is reducing the table!!

Now we need to combine our combined minterms.

To combine the minterms first we looked at where the states were just one bit out like m6[0110] and m14[1110]. became m(6, 14) [-110]
also m15[1111] and m7[0111] became m(7,15) [-111]

now we need to look at the conbined minterms where the dashes are in the same place and that only differ by one bit.

so:
m(6, 14) [-110]
m(7,15) [-111]

becomes
m(6, 7, 14, 15) [-11-]

We can conbine -010 and -110 or -011 or -000, as the dash is in the same place and they only differ by one bit
we can't combine -010 with -111 or -001 or -100 as there are two bits different, and we certainly can't combine -010 with -101 as that's three bit different.

We can't combine -010 with 001- as teh dash is in the wrong place for conbination

To start with just read down the chart and fill in ALL possibilities, we'll remove the repeated values later.




Now we can delete duplicates.




So the table has gotten a little smaller, and we can also see that m(5,7) is reduced as it's going to get. so we but an X next to this.

Now we start looking at the table to see where two dashes match but terms differ by only one value.

m(2,6,10,14) = [- - 1 0]
m(3,7,11,15) = [- - 1 1]

becomes m(2, 3, 6, 7, 10, 11, 14, 15) [ - - 1 - ]

In other words all of these terms can be reduced to the expression C

When you've finished matching the pairs your table should look like this:


In this original example I forgot to highlight one of the terms that I was going to reduce.
This is what that chart should have looked like!




now you can see that

m(2,3,6,7,10,11,14,15) - - 1 -
m(2,3,10,11,6,7,14,15) - - 1 - == m(2,3,6,7,10,11,14,15) - - 1 -
m(2,6,10,14,3,7,11,15) - - 1 - == m(2,3,6,7,10,11,14,15) - - 1 -

When we organise the minterms in numerical order

I highlighted the none combinable terms, and you can see that since we only have one term left there are no more combinations that can be made.

m(5,7)
m(8,9,10,11)
m(8,10,12,14)
m(0,2,8,10)
m(2,3,6,7,10,11,14,15)


These minterms represent our prime implicants.
So now we draw a table listing the reduced/combined minterms from the table above.
The states, and their representations
This is called a prime implicant chart.






What this chart represents is the states that must be true.


This example doesn't lead well to what needs to happen next so for a moment pretend that the chart looks like this:


Now we can see that there is minterm2 that is common to two different outputs,
the 8 in the second statement can also be covered by one of the other statements, and the 10 can be covered too.

(so the statement relating to m(2,8,10) [-0-0]{/b./d} could be ignored as it would be covered in other statements.)

In this case where we have a statement that cannot be covered then it's an essential prime implicant, statements where the output states are covered by other statements are non-essential and can be left out.

Back in the real world we do have a minterm 0 on that second statement.




So it looks like they are ALL essential prime implicants.

so our output is m(5,7) OR m(0,2,8,10) OR m(8,9,10,11) OR m(8,10,12,14) OR m(2,3,6,7,10,11,14,15)
looking at the values at the end this makes

m(5,7) = (/A . B .D) (the dash in C means C or NOT C, and as we know, A . B + A . /B = A
m(0,2,8,10) = (/B . /D)
m(8,9,10,11) = (A . /B)
m(8,10,12,14) = (A . /D)
m(2,3,6,7,10,11,14,15) = (C)

So we can write out the expression for the gates as:
Q1 = /A . B . D + /B . /D  +A . /B + A . /D + C