Author Topic: Best way to select the ID of each board?  (Read 1595 times)

0 Members and 1 Guest are viewing this topic.

Offline mrburnzieTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: cs
Best way to select the ID of each board?
« on: September 16, 2019, 12:05:18 am »
Hi!

I'm working on a project where I have 100+ boards. All of them will have unique ID (1-100).
What is the best way to assign these unique IDs using hardware?

My idea was to have one switch on each of them, and the master which communicates with them wirelessly sends out the "configured ID", and the node which has the switch ON will assign itself to the received "configured ID". Others won't do anything.

Any suggestions?
« Last Edit: September 16, 2019, 12:07:14 am by mrburnzie »
"Talk is cheap, show me the code"

Anyone need of freelance software/hardware developer, hit me up!
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15797
  • Country: fr
Re: Best way to select the ID of each board?
« Reply #1 on: September 16, 2019, 12:13:28 am »
To begin with, if your ID range is 1-100, how is that going to work to get unique IDs for more than 100 boards (which is what 100+ would imply)? ;D

And now that's settled, do you absolutely need to be able to set a specific ID for each board, or does it just need to be unique? In the latter case, my favorite approach is to use some kind of ID chip, like such: https://www.microchip.com/ParamChartSearch/chart.aspx?branchID=7046

absolutely no individual configuration needed at production time.
 

Offline mrburnzieTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: cs
Re: Best way to select the ID of each board?
« Reply #2 on: September 16, 2019, 12:16:12 am »
To begin with, if your ID range is 1-100, how is that going to work to get unique IDs for more than 100 boards (which is what 100+ would imply)? ;D

And now that's settled, do you absolutely need to be able to set a specific ID for each board, or does it just need to be unique? In the latter case, my favorite approach is to use some kind of ID chip, like such: https://www.microchip.com/ParamChartSearch/chart.aspx?branchID=7046

absolutely no individual configuration needed at production time.

Haha, the testing would be done on 100 devices but it can go up to 300, so I didn't want to exaggerate :D

This is a one time, custom thing. These devices should be configured once, but just to be sure I want to add an option to change the ID. I would like to have them labeled as numbers :)
"Talk is cheap, show me the code"

Anyone need of freelance software/hardware developer, hit me up!
 

Online MarkF

  • Super Contributor
  • ***
  • Posts: 2762
  • Country: us
Re: Best way to select the ID of each board?
« Reply #3 on: September 16, 2019, 12:19:24 am »
Do they each have a micro-controller on them?

Burn the ID into its EEPROM.  Then have the program use the ID when receiving messages.
The EEPROM can be changed independent from the program space.
 

Offline mrburnzieTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: cs
Re: Best way to select the ID of each board?
« Reply #4 on: September 16, 2019, 12:21:36 am »
Do they each have a micro-controller on them?

Burn the ID into its EEPROM.  Then have the program use the ID when receiving messages.
The EEPROM can be changed independent from the program space.

Great idea! The thing is that I'm giving these devices to a client who has no experience with burning EEPROM :D
I want to give the client the freedom to easily change the ID of each device.

Btw. yes on the microcontroller.
"Talk is cheap, show me the code"

Anyone need of freelance software/hardware developer, hit me up!
 

Online coromonadalix

  • Super Contributor
  • ***
  • Posts: 7008
  • Country: ca
Re: Best way to select the ID of each board?
« Reply #5 on: September 16, 2019, 12:27:47 am »
a dallas one wire eeprom ??   you have easy and free software to do so    ??
 

Offline mrburnzieTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: cs
Re: Best way to select the ID of each board?
« Reply #6 on: September 16, 2019, 12:29:36 am »
a dallas one wire eeprom ??   you have easy and free software to do so    ??

The microcontroller already has its own eeprom. What do you mean by easy and free software? Easy microcontroller integration or easy program that the client can use?
« Last Edit: September 16, 2019, 12:31:23 am by mrburnzie »
"Talk is cheap, show me the code"

Anyone need of freelance software/hardware developer, hit me up!
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3279
  • Country: us
Re: Best way to select the ID of each board?
« Reply #7 on: September 16, 2019, 12:38:45 am »
I want to give the client the freedom to easily change the ID of each device.

Btw. yes on the microcontroller.

Use some DIP switches:

836406-0
836412-1

Two of the hexadecimal switches can configure 256 addresses.




« Last Edit: September 16, 2019, 12:40:35 am by ledtester »
 
The following users thanked this post: Fire Doger

Offline mrburnzieTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: cs
Re: Best way to select the ID of each board?
« Reply #8 on: September 16, 2019, 12:39:52 am »
I want to give the client the freedom to easily change the ID of each device.

Btw. yes on the microcontroller.

Use some DIP switches:

(Attachment Link)
(Attachment Link)
okay what is the best option to assign 300 different ones with dip?
"Talk is cheap, show me the code"

Anyone need of freelance software/hardware developer, hit me up!
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3279
  • Country: us
Re: Best way to select the ID of each board?
« Reply #9 on: September 16, 2019, 12:48:08 am »
You can get the DIP switches in various configurations:

https://irishelectronics.ie/Electronic-Components/Page-/-Category-11/DIP-SWITCHES

For 300 addresses you would need 9 bits controlled by switches. You can use three of the hexadecimal switches, or two hexadecimal switches plus a 2-position switch.

For a cheaper solution use a 9 position dual row header and make connections with jumpers:

836418-0

But let's back up a bit... why would the customer want to change the address? Doesn't that just give them the opportunity to mess things up if they give the same address to two boards?


 

Offline mrburnzieTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: cs
Re: Best way to select the ID of each board?
« Reply #10 on: September 16, 2019, 12:52:03 am »
You can get the DIP switches in various configurations:

https://irishelectronics.ie/Electronic-Components/Page-/-Category-11/DIP-SWITCHES

For 300 addresses you would need 9 bits controlled by switches. You can use three of the hexadecimal switches, or two hexadecimal switches plus a 2-position switch.

For a cheaper solution use a 9 position dual row header and make connections with jumpers:

(Attachment Link)


Okay not a bad option, will look into it more. Thanks!


Quote
But let's back up a bit... why would the customer want to change the address? Doesn't that just give them the opportunity to mess things up if they give the same address to two boards?
Totally agree with you. They requested that feature.
"Talk is cheap, show me the code"

Anyone need of freelance software/hardware developer, hit me up!
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3279
  • Country: us
Re: Best way to select the ID of each board?
« Reply #11 on: September 16, 2019, 01:51:46 am »
Totally agree with you. They requested that feature.

I'd go back to the customer and figure out why they think they need to change addresses. Seems like they have a different idea of what the address is used for. There should be another mapping in software from "identity" to actual hardware device.
 

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1950
  • Country: us
Re: Best way to select the ID of each board?
« Reply #12 on: September 16, 2019, 06:05:02 am »
Keep it simple: Solder bridges on pairs of pads on the PCB. Costs $0 and can be changed in the field, but not accidentally, not vibration sensitive, etc.
 

Online AndyC_772

  • Super Contributor
  • ***
  • Posts: 4315
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Best way to select the ID of each board?
« Reply #13 on: September 16, 2019, 07:11:26 am »
I wouldn't fancy setting up DIP switches on 100+ boards without ever making a mistake, and certainly wouldn't want to solder that many links by hand.

All you need is a way to uniquely identify one board at a time, so it can then become the only unit which responds to a "set ID" message from the master. The master can increment a counter to set IDs sequentially without repetition, or it can assign a single, nominated ID (so you can replace individual units and have the new one keep the same ID as the old one).

Perhaps in this case you could have a single pushbutton, with some logic along the lines of "if the button is pushed within 10 seconds of power-up, request a new ID from the master".

Then all you need is for each slave board to store its ID, and every non-trivial microcontroller has EEPROM or Flash that can be used for this purpose.

My favourite design in this respect was a magnetic sensor, which used multiple, 'smart' sensor boards on a common bus. The criterion for assigning an ID to each board was "if you can see a magnet, and don't already have an ID, then request one from the master". Assigning IDs was a simple as putting the system into configuration mode, then swiping a magnet along the length of the bus. Total time required, about 5 seconds if you type slowly.
 
The following users thanked this post: mrburnzie

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14117
  • Country: gb
    • Mike's Electric Stuff
Re: Best way to select the ID of each board?
« Reply #14 on: September 16, 2019, 07:41:22 am »
Unless the board has enough of a user interface to set IDs with a couple of buttons, I pretty much always use DIP switches.
The main reason is long-term maintenance.
 
You set up a system, and have some spare boards left on-site as part of a service kit. In 5 years' time, when something dies and needs fixing, chances are that documentation has been lost, whoever installed it can't be contacted, or if they can, doesn't remember the details, or any special-purpose setup software borks on the  current version of windows etc. etc.

With DIP switches, you just pull a board from the spares kit, set the DIP switches the same as the one being replaced, job done.
Bonus points if you'd stuck labels at each board location ( NOT on the boards) with the switch settings for that location.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14117
  • Country: gb
    • Mike's Electric Stuff
Re: Best way to select the ID of each board?
« Reply #15 on: September 16, 2019, 07:55:01 am »
I wouldn't fancy setting up DIP switches on 100+ boards without ever making a mistake, and certainly wouldn't want to solder that many links by hand.

All you need is a way to uniquely identify one board at a time, so it can then become the only unit which responds to a "set ID" message from the master. The master can increment a counter to set IDs sequentially without repetition, or it can assign a single, nominated ID (so you can replace individual units and have the new one keep the same ID as the old one).

Perhaps in this case you could have a single pushbutton, with some logic along the lines of "if the button is pushed within 10 seconds of power-up, request a new ID from the master".

Then all you need is for each slave board to store its ID, and every non-trivial microcontroller has EEPROM or Flash that can be used for this purpose.

My favourite design in this respect was a magnetic sensor, which used multiple, 'smart' sensor boards on a common bus. The criterion for assigning an ID to each board was "if you can see a magnet, and don't already have an ID, then request one from the master". Assigning IDs was a simple as putting the system into configuration mode, then swiping a magnet along the length of the bus. Total time required, about 5 seconds if you type slowly.

I've used systems like this a few times, it's particularly useful where a node ID needs to be associated with a physical location, more so if the same kit needs to be re-installed multiple times.
It can actually be even simpler, and also work where comms are primarily 1-way ( like LED nodes) by instead of requesting  an ID from a master, the message from the master says "If you can see your local switch (or whatever) being actuated, set your ID to <xx>"

Even with 1-way comms, this can be automated if there is any way for the master to detect that the ID program has been successful to increment the ID - this can often be done by looking for changes in power draw - e.g. a LED node turning on or off after it sets its new ID, or the node MCU drawing more current by temporarily changing its clock rate or going to sleep.

I've done this using all sorts of local actuators including  buttons, touch pads, contact pads, light sensors, accelerometers, and in one case, a high-frequency high voltage signal from a CCFL inverter on the end a long stick that gets waved near a node.
The latter was used on this https://www.jasonbruges.com/art/#/digital-ornithology/
Most nodes were addressed on the bench, but we needed the ability to fix wrong any addresses without getting a cherry-picker to access them.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 
The following users thanked this post: mrburnzie

Offline mrburnzieTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: cs
Re: Best way to select the ID of each board?
« Reply #16 on: September 16, 2019, 09:19:26 am »
I wouldn't fancy setting up DIP switches on 100+ boards without ever making a mistake, and certainly wouldn't want to solder that many links by hand.

All you need is a way to uniquely identify one board at a time, so it can then become the only unit which responds to a "set ID" message from the master. The master can increment a counter to set IDs sequentially without repetition, or it can assign a single, nominated ID (so you can replace individual units and have the new one keep the same ID as the old one).

Perhaps in this case you could have a single pushbutton, with some logic along the lines of "if the button is pushed within 10 seconds of power-up, request a new ID from the master".

Then all you need is for each slave board to store its ID, and every non-trivial microcontroller has EEPROM or Flash that can be used for this purpose.

My favourite design in this respect was a magnetic sensor, which used multiple, 'smart' sensor boards on a common bus. The criterion for assigning an ID to each board was "if you can see a magnet, and don't already have an ID, then request one from the master". Assigning IDs was a simple as putting the system into configuration mode, then swiping a magnet along the length of the bus. Total time required, about 5 seconds if you type slowly.

Yes, this is exactly what I was thinking!
"Talk is cheap, show me the code"

Anyone need of freelance software/hardware developer, hit me up!
 

Offline mrburnzieTopic starter

  • Regular Contributor
  • *
  • Posts: 139
  • Country: cs
Re: Best way to select the ID of each board?
« Reply #17 on: September 16, 2019, 09:21:42 am »
Thank you all for the suggestions, I will be going with AndyC_772 solution. That is the easiest for this specific project and for the client.  8)
"Talk is cheap, show me the code"

Anyone need of freelance software/hardware developer, hit me up!
 
The following users thanked this post: AndyC_772


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf