The task fell on me to realize a wireless, daisy chained communication system. The communication must be wireless, esp. via infrared diodes. The end of the chain is connected to a PC (wired). The whole system consists of n members. Each member has two sides with a sending and receiving diode.
The target is:
- The PC must be able to send an initialization command and the system containing of n members must figure out how many modules are installed ("find n").
- The PC must be able to send a command to all modules
- The PC must be able to send a command to a certain module
- The modules are close together, but the distance must be able to vary between about 1 and 3 inches.
My approach so far:
- The PC sends a command to module 1. Module 1 sends back its presence to the PC, as well as wirelessly to the second module. Until now the PC knows that 1 module is present. When module 2 receives the init command it sends back its acknowledgement to the first module which transfers 2's message to the PC. Also, module 2 sends the init command further to module 3, and so forth. The init phase ends, when the last module (n) gets the init command and its presence message reaches the PC. After that no more message arrives at the PC's side and it knows that n modules are present.
- Further commands contain a header byte addressing the "destination" module. Or, if all modules are meant, the command starts with a "zero"-byte (0x00).
The challenge is:
- Physically: I don't know how to prevent the fact that module x could "talk" to module x+1 and x+2 simultaneously (cross-talking) by reflections or mirroring. I need to get the system self-learning. Until now, I dim the diodes until they can only reach a very small distance. But this isn't very fault tolerant.
- Logically: Day light and other sources of infrared light cause a lot of fuzzy and gibberish messages. Real messages are currently preceded or even disturbed by external influences.