Sensing stacked bricks

For a computer science project I'm going to experiment with LEGO bricks (The bigger Duplo kind) as a tangible user interface. I imagine a floor with studs and many 2x2 studs square bricks. The bricks can be attached to the floor. The bricks can also be attached to other bricks (stacked) creating towers (Still attached to the floor). I would like to be able to differentiate between differently coloured bricks, say red, green and blue.

I would love hear some thoughts on how one could build such a thing. Ignoring camera solutions, my first thought is equipping the bricks with resistors. The resistance would be read on the (wired) floor. Stacking more bricks would increase the resistance indicating how many bricks had been stacked. Resistor values could map to brick colours.

Another thought: Inserting magnets in to the bricks could possible allow me to sense their positions in 2 dimensions (directly on the floor) with magnetic sensors beneath the floor. Would I be able to sense stacked bricks/magnets?

Yet another thought: Would I be able to register the resistance of a brick? If yes, I can see how I would be able to register a single brick. But how about stacked bricks?

Any thoughts on the above or ideas on alternative approaches? All input very much appreciated.

Thank you.

seema to be an intresting project

my first thought is equipping the bricks with resistors

yes that could be done :slight_smile:

Another thought: Inserting magnets in to the bricks could possible allow me to sense their positions in 2 dimensions (directly on the floor) with magnetic sensors beneath the floor. Would I be able to sense stacked bricks/magnets?

no you cant sense the stacked magnets directly with sensors at the base
though tou could scan the height using a motor combined with the sensor and see how many magnets are present based on the no of magnets sensed by the sensor
Hmm what kind of sensor are you planning to use ?

you could also try adding weight to the bricks and weighing it beneath
using forse sensitive resistors ( though they are not that accurate ) you could give them a try !

.... you could scan the height using a motor combined with the sensor ....

Are you talking about mechanically moving the sensor along the tower of bricks? How would the sensor be moved? A robotic arm?

you could also try adding weight to the bricks and weighing it beneath

would this work for a studded floor? The bricks are supported by a combination of studs and floor. I like the studded floor as it limits the possible positions on the floor.

Thank you for your input!

How about a light arm (just a piece of wire really) on a servo or stepper motor. approach the stack with the arm retracted, then rotate it until it hits a brick. The angle will tell you how high the stack is and therefore the number of bricks.

How to tell when the arm hits? Measure stall current on the motor/servo, or maybe a sensor that touches the bottom brick or the floor and the bricks and arm are conductive.


Rob

thinkingoutloud
How about adding a onewire device, e.g. DS18B20 or DS1307 etc in every brick. These onewire devices have an unique ID and only need 3 wires (=5V GND and a data line). If you could make the contacts at least you could determine in which order they are connected.

If you make every bump of the lego a separate onewire line (z-axis) you could determine / identify the position of all bricks above it. By combining which bricks are above which bump (and because you know the order it would be possible to determine te position of every brick.

But it will take quite an amount of Hardware.

Variation, put a resistor in every brick (under every bump) and if a brick is connected the resistor is put in parallel with other ones, changing the total resistance. If you know the delta R you can calculate what resistor has been added.

my 2 cents.
Rob

How about a light arm (just a piece of wire really) on a servo or stepper motor.

I'm looking for a child-compatible solution. I don't think a robotic arm will last long with the users in mind :wink:

Thank you for sharing your thoughts!

How about adding a onewire device, e.g. DS18B20 or DS1307 etc in every brick.

I'm not familiar with one-wire devices. I will investigate. Thank you for the input.

? How would the sensor be moved? A robotic arm?

well it need not be a complex robotic arm but rather two motor's one to tontrol the height and the other to the latitudial distance it will become simple like just plotting the value's in the form of a X,Y co-ordiante system :wink:

My first thought was resistors as well.

I will throw out that this sounds like an good application for RFID. I will admit I don't have any direct experience in this field, but this is routinely done with pallets of goods in commercial applications.

How many bricks?

A solution, which should work for 6-ish bricks would be a 100K resistor in each brick, with contacts such that all the bricks together are in parallel. The delta in resistance would be measurable by the Arduino's A2D up to around 6-ish bricks. You might have to pick your parts fairly carefully to get 6 close values.

If you put a capacitor in each one, the capacitance adds up linearly, but you need to have an R/C circuit -- maybe a 555 -- and as things add up, timing becomes less accurate again. This method might get you to 10 or 12 bricks since you can time things with the Arduino to greater accuracy than A2D measurement can.

If one peg carried common, then the three other pegs could carry different ladders indicating the colour. You would have to be able to guaranty a specific orientation of the bricks for this to work.

onewire device

I definitely like this idea. Each brick has a unique identity -- which can indicate its colour and everything.

To make an brick-orientation-insensitive bus might be interesting. If you could have a contact on the "inside edge" of each peg separate from the on on the "outside edge" then you could get your one-wire bus to work I think.

If you could guaranty orientation of the bricks, and have enough bus lines to work with, you could make a diode-array ROM. 4 address lines and 4 data lines would let you detect 15 different bricks.