15. Networking and Communication

I2C Communication Protocol

In consideration of the wiring complexity of the final project electronic system the I2C communication protocol semmed to me the most effetcive one. Only two wires between master and slave boards, with the slave board identified by a unique address.
The only issue is relevant to the type of data I need to send from one board to the other: temoperature in floating pint number. In fact, the I2C Arduino library only sends and receives bytes.
I searched the web for a solution and found a very interesting post of how the I2C works, with specific reference to the Arduino Uno: Nick Gammon I2C - Two-Wire Peripheral Interface - for Arduino - licensed under the Creative Commons Attribution 3.0 Australia License.
The post makes available a library named "I2C_Anything.h" which beautifully solved the problem.

I drafted the code usinf an Arduino uno as Master and the Sashakit as Slave. Qonce everything worked correctly, I moved the Master code to the Freezer Board. The complete solution is described in the relevant final project section System Control - Putting Everything Together.

In this last image we see the first temperature recorded by the arduino, transferred to the Slave where it appears as the second temperature.

The assignment ends by connecting two boards with processors that I have made which, being part of the final project assignment, is detailed in the relevant sections: Putting everything together.

Link to .ino sketches: Thermistor_master_writer, Thermistor_slave_receiver