I'm trying to find a way to detect blocks being placed on grid on a table. The table will have fixed places where you can place the blocks, but the user is allowed to place the blocks in any free slot. I would like to have an Arduino poll the slots on the table and tell me which blocks are placed where.

I'm going to design the blocks with magnetic connections on the top and bottom to create a circuit as soon as they are placed.

What kind of chips can I use so that the arduino can give me the topology of the blocks when placed?

enter image description here

  • You need to constrain your problem further. For example, if the Arduino is monitoring the placement of blocks the order of the stack can be inferred through inspection of the history of sensor activation. However, if the Arduino needs to detect the order with out history - then the problem becomes difficult. – st2000 Aug 7 '19 at 13:43
  • Interesting approach to use the timing / history. However I'm not even sure how to detect the blocks at all at the moment. I don't know what chips to integrate into the table or the blocks to be able to detect them. – Guus Baggermans Aug 7 '19 at 13:48
  • This is a situation where OneWire ROMs with unique serial numbers would be good. – Majenko Aug 7 '19 at 13:51
  • "OneWire ROMs", I'll have to google that. At the opposite end of the spectrum you can key the blocks (cut off a corner) to ensure their orientation with respect to the table and place magnets in unique places for each type. Then use Hall Effect devices to sense them. – st2000 Aug 7 '19 at 14:50
  • fixing the orientation is definitely a step in the right direction @st2000 ! – Guus Baggermans Aug 7 '19 at 15:16

You need to track unique objects in an 8x8 grid of slots? How many unique objects?

If the total number of objects is 112 or less, you could give each one a unique I2C address.

You'd add 4 circular electrical contacts in a "bulls-eye" configuration on the top and bottom of each object so that all the I2C pins would connect regardless of orientation. All objects in the same stack would be connected together on that stack's I2C bus.

You'd have an 8x8 multiplexer to connect to the I2C bus for each of your 64 grid positions in turn, and poll that bus for each of the possible I2C addresses. (Send a ping for each address and look for ACKs.)

Alternately, you could give every object a unique weight, varied by a power-of-two amount. (first object weighs 1000 grams. Second weighs 1001 grams (1000+2^0)) third object weighs 1002 grams (1000+2^1). Fourth object weighs 1004 grams (1000+2^2). Etc.)

Then you'd put a scale on each pad. Weigh the objects, modulo 1000 grams. That result, in binary, would give you flags for every object on that pad.

Or 2 circular electrical contacts on the top and bottom of each object, with resistors that have unique power-of-two resistance on each one, as Juraj suggests in their comment. Measure the resistance and you can figure out which set of objects is present.

The math would be simpler if you rigged the objects so that they made a series circuit through all objects present (put a normally closed switch on the top that shorts the top contacts of that object through its resistor if there's no object on top of it. If there is an object, the switch would open, and the objects on top would close the circuit.)

  • Or do you need to know where objects are located top-to-bottom in each stack? – Duncan C Aug 7 '19 at 16:50
  • Thanks @Duncan! Luckily I don't need to know the order of the objects, as long as I have the count for each stack. I'm going to try your I2C approach first, since I prefer a 'software' solution over a physical solution like weight and resistance. – Guus Baggermans Aug 7 '19 at 19:51
  • How many unique objects do you need to deal with? Is it less than the 112 unique objects I2C supports? – Duncan C Aug 7 '19 at 19:54
  • @GuusBaggermans, I deleted my comment about the solution with resistors, because it would not detect individual objects, only the count on each stack. The I2C solution is not a software solution. You need to put a powered chip with I2C address in each block and you would still not detect the ordering. So the resistor is much simpler and requires only two interchangeable contacts on each side interchangeable side. – Juraj Aug 10 '19 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.