Difference between revisions of "Team:Aachen/Notebook/Construction Manuals/Communication Protocol"
(→Slave to Slave) |
|||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Team:Aachen/Header}} | {{Team:Aachen/Header}} | ||
− | + | __NOTOC__ | |
− | How do the Master Control Program and the reactor controllers communicate with each other? | + | =Talking Between the Harware and the Software= |
+ | How do the Master Control Program and the individual reactor controllers communicate with each other? | ||
{{Team:Aachen/Figure|Aachen_BioreactorCommunicationProtocol.png|title=Communication Flow|size=large}} | {{Team:Aachen/Figure|Aachen_BioreactorCommunicationProtocol.png|title=Communication Flow|size=large}} | ||
Line 7: | Line 8: | ||
− | + | =Slave to Slave= | |
+ | |||
+ | If every reactor needs one USB port for itself, we will quickly run out of USB ports on normal lab computers. Therefore it is necessary that the reactors can communicate between each other so that only one reactor needs to be connected to the computer. | ||
− | + | The communication system we invented works in principle as shown above. Every rector must be able to communicate with two others, so we used the normal serial port and the SoftwareSerial library to establish another serial connection via two digital pins. In our program we used pin 5 as receiver and pin 8 as transmitter. The first reactor was connected as usual to the computer with the USB port. Now, to connect a second reactor to this one, we connected pin 5 of the first with pin 0 (the TX pin) of the second and pin 8 with pin 1 (RX pin). | |
− | |||
If now a message reaches one reactor from direction of the MCP the reactor program checks if the receiver ID in the message matches with the reactor ID. If so, the rest of the message is evaluated and the program reacts. If not, the message is forwarded to the next "deeper" reactor. This one checks again for the receiver ID and so on, until the targeted reactor is reached. | If now a message reaches one reactor from direction of the MCP the reactor program checks if the receiver ID in the message matches with the reactor ID. If so, the rest of the message is evaluated and the program reacts. If not, the message is forwarded to the next "deeper" reactor. This one checks again for the receiver ID and so on, until the targeted reactor is reached. | ||
− | If a message goes in direction | + | If a message goes in direction of the MCP it will be forwarded immediately, since every message towards the MCP contains measuring data because the reactors do not send messages to each other except to forward them from the MCP. |
− | = | + | =MCP to Slave= |
− | Using the protocol definition outlined on this page, multiple reactor controllers can communicate with the MCP to send online data | + | Using the protocol definition outlined on this page, multiple reactor controllers can communicate with the MCP to send online data or receive new setpoints. |
Messages consist of a three-byte header and a payload with data data. | Messages consist of a three-byte header and a payload with data data. | ||
Line 75: | Line 77: | ||
|} | |} | ||
− | + | =Files= | |
+ | Final Arduino-Bioreactor Firmware(Slave system) | ||
+ | #with inter slave communication: [https://static.igem.org/mediawiki/2015/2/28/Aachen_Slave_Com.zip Aachen_Slave_Com.zip] | ||
+ | #without inter slave communication: [https://static.igem.org/mediawiki/2015/0/0b/Aachen_Slave_without_Com.zip Aachen_without_Com.zip] | ||
Latest revision as of 02:58, 19 September 2015