Block Recognition Method

The thing I'm trying to make is the following:

There are blocks that represent certain movements (left/right turn, forward, etc.) When the blocks are arranged in a certain order and an activator button is pressed, a car will move according to the movements specified by the order of the blocks. So basically it consists of the blocks and the car and the two communicate through XBee.

Previously I've had a board with slots for the blocks to go into and used potential dividers to recognize the block types. However, I want to do away with the board and connect the blocks directly to each other. In this case, I can no longer use the potential dividers, because there would simply be too many wires and all of them have to go through the blocks themselves.

I've considered putting XBee's in each block, but that would be too expensive. I've also thought of assigning barcodes to each block and scanning them with a sensor. But I'd prefer if the user involvement in reading the blocks was minimal.

I probably did a bad job in explaining so feel free to clarify anything. Basically, I'm looking for any alternative method to recognize the block types. Any examples of products in which this type of technology is employed would also be helpful.

I think a diagram or picture of the existing system would help. Are the blocks arranged in a straight line, or are they arranged in the shape of the movements that are required?

If you do away with the board, what will the blocks sit on - or will someone just hold them all in his/her hands?

How many blocks do you want to use to describe a single set of movements?

Would it be acceptable to have a 3 (say) pin plug connecting each block to the next one and connecting the final one to a base station? If not, describe your requirement.

Can you give some idea of how much you would be prepared to spend on each block?


To be clear, the blocks are cube shaped. They will be connected via magnets in a straight line. So the blocks could stay together without the board.

Each block type will describe only a single motion. ex) a single turn or a single step forward

I’d say a 3-pin plug is reasonable. I’m not exactly sure what you mean by a base station. I’m thinking that there will be two blocks signifying the start and the end with the arduino in the start block. I guess that’s sort of a base station. Then all the other blocks could be connected between those two.

About the cost, I won’t consider it for now. I want to know all the options before narrowing them down.

I attached a diagram of the connected blocks.

No sign of a diagram.

By base station I meant a block (or something) that is connected to the Arduino that sends commands to the car.

Perhaps you could have an Arduino in each block which has a program that can identify its purpose - go straight, turn left etc. Then the base station could poll each block in turn to figure out what to do. Maybe you would need 4 connections between each block - Power, GND, Rx and Tx.

Even simpler might be to give each block a separate ID and the base station would be programmed to associate an ID with a direction. Then it could poll all the ID numbers and the ones that reply represent the actions to take. But how would the base station know the order in which the blocks are connected ?

Maybe each block would be programmed to poll its neighbour and, rather than replying to the base station, the first block would wait until all the blocks had polled their neighbours (i.e. the last block would get no reply) and each block would add its own ID to the list of IDs passed from the previous block.

You could have an Atmega 328 or a Nano in each block and use software serial as well as hardware serial so it can talk separately to both of its neighbours.

Just some blue-sky thoughts.


I did read an academic paper in the 70s that described such a thing but it was quite complex.

You could have an Atmega 328 or a Nano in each block

I think that would be an essential, along with a power supply for each block.

The blocks could communicate with each other through two coils on the opposite sides of the block. One coil would generate a signal and the other would receive it.

There was a product that used something similar a few years back.

What Mike said, but maybe use IR to communicate from block to block. You would need something like a Nano in each block, and you would have to establish some kind of protocol where the first block in the series could detect and identify itself as the first block and what the motion command was. Then send that to the next block, where the next block would detect that it was not the first block, determine what sequence it was (from message received from previous block) and send that sequence and it's movement command to the next block in the series, and do on, and so on,,, for get the start block (it is determined by software and the lack of an incoming signal). Use a "END", or "GO" block as the last one in the series. It will receive the message from the previous block, which contains all the sequence/move commands in order, and somehow relay those to your car.

Each block (except for the "END/GO" block) needs: 1) to be able to send/receive with the previous block (if any) and, 2) send/receive to the next block in the series, and 3) be able to determine what sequence it is in the series from the message received from the previous block (if any), build a message with all previous commands, in sequence, and add it's own command in sequence, 4) send the new message to the next block. The "END/GO" block needs to 1) receive the message, 2) detect the car and establish communications, and relay the message to said car.

you must use physical contact (via close IR, or, Induction) in the blocks to establish sequence (NOT RF). How you talk to the car is up to you.

have done similar with IR. you got a lot of work ahead of you.

It would be sufficient to put a parallel-in, serial-out shift register in each block. Wire the inputs to assign a number to each type of block. Wire the blocks to daisy-chain the shift registers. Read the chain of registers to find the order of the blocks.

The most connectIons you need between blocks is five: ground, power, latch, data, and clock. A clever electronics engineer could probably combine power, latch, and clock to reduce it to three connections. The magnets that hold the blocks together can probably double as electrical contacts.

Basically, I'm looking for any alternative method to recognize the block types.

The Arduino-compatible CMUCam5 (Pixy) can recognize individual colors and two-color signatures.

Grumpy_Mike: The blocks could communicate with each other through two coils on the opposite sides of the block.

I was thinking of a 4-pin plug/socket so that each block can plug into the next one. The 4 pins can carry Power, GND, Rx and Tx.


Thanks everyone for your input! I'll try out the shift registers for now and move on to putting arduino nanos in each block if that doesn't work out.