Let's Make Robots!

How I can identify a robot using an unique ID?

For the Swarm Robot Project I need a unique ID to identify each single robot and also let the robot only execute program parts which are assigned to it's ID.

Why I wanna do that?

As we are planning to reprogram all the robots at once via IR we need a way to "place" an unique ID into the robot. This should happen without much additional stuff like an external DIP switch. To write that ID into the program code would not work since all the robots are receiving the same code. So we need a kind of internal identifier which µC the robot has and create/use this as an ID.

Here some suggestions from the SB:

FrankNeon: something like "I've been on the longest, I am 1." I'me next on, I'm 2...
FrankNeon: what about writing a startup void that has each bot find its place in line.


This would be a good idea but it also has a flaw. What happens when the robot is switched off for a reason...after switching it on again it will get another ID -> so the robot can not execute the code he is supposed to run.

Chris the Carpenter: Well, that one is easy --just do your own mac address for each bot and stick it in the eeprom of the chip during programming

That seems to be doable.

What's your suggestion? And no, we don't want to put more hardware on the robot just for this!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Could you not use Frank's method, but with a twist.  In the EEPROM, if the number is blank, then find it's number by hierarchy and store in EEPROM.  This means if the robot is switched off then the number is still retained by the EEPROM so when switched back on the number is present.  Alternatively store two numbers - Robot number and highest number already used.  Then interogate any swarm that are on and if required update the highest number as well on switch on.



A decent random number generator can be made with a reverse biased diode (google hardware random number generator and you can probably find a simple circuit) You can test if this is the units first power on, by checking its EEPROM for invalid data (ie CRC the first 8 bytes) If it is, use the hardware random number generator to generate the unique id. Write it to EEPROM along with its CRC and you're set. Of course you may encounter collisions and you'll never know what the id is chosen, unless you can query your micro controller So, if you're using an Ethernet shield you can use the MAC address instead, or if you're using and avr look at this link: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=112706 Hope that helps!!

Thanks for your suggestion. We do not want to add more hardware for this, so we need to find a way with the given situation. I guess using the timer to create an unique ID is a good way to go.



And how short?

Ever considered A globally unique identifier?

From Wikipedia: "GUIDs generated from random numbers contain 6 fixed bits saying they are random and 122 random bits, the total number of unique such GUIDs is 2122 or 5.3×1036. This number is so large that the probability of the same number being generated randomly twice is negligible."

Useful for a 64 bit machine perhaps but not an 8 bit micro.
How many processor cycles will it take to process a number that big? I would go the opposite end and fit it in an 8 bit number just number robot 1 = 1 robot 2 =2 up to 255.
If you want more than 255 robots in the swarm then 16 bits should do.
Oh and hi rik why don't I see you around as much anymore?

A good idea would be to use the http://www.myrobots.com/ and robots will be submitted there and they can communicate too .

But you have to have a master computer that process the data


It looks like you have IR receivers so I do not see the problem. In your code you tell the robot that if it receives a certain IR code then the next code it receives will be it's ID. This ID is then stored in the EEPROM.

That way you can use a universal TV remote to program the ID of each robot.

If your using the standard Sony protocol then you have 7 data bits and 5 device ID bits. If you modify the protocol to suit your needs then you could have as many data bits as you want and use the device ID to tell the robot which robot sent the data. Have 1 ID set aside for telling the robot that the data it received was actually it's new ID.

I only suggest the Sony protocol because it is very easy to use and manipulate.

I agree with Oddbot. Storing a unique ID in the EEPROM, like a serial number, is very common. The EEPROM is independend from the FLASH where the program is stored. You can use an ISP programmer to program each processor with an individual number. Loading another program via bootloader will not effect the EEPROM ID.

Print a label with the ID and glue it on each processor, after you have programmed the ID.

Yes, i guess that's the way we ned to go. first running an initializing program to get the ID and later the final programming.

Thanks for your input :-)


Thanks OddBot, that option is a good intend but I guess it will not work for what we are planning, to update their program all at once via IR overhead emitter.