ASSIGNMENTS

Week 13

Networking and Communications

Group Assignment

Send a message between two projects.

For this assignment we chose to send a message between microcontroller boards using I2C. I2C stands for Inter-Integrated Circuit. It is a communication protocol that uses two lines, Serial Data Line (SDA) and Serial Clock Line (SCL). I2C allows communication between multiple devices.

We reviewed DroneBot Workshop's project using two arduino uno boards to communicate with each other via I2C. The master board sends a request to the slave board and the slave board returns a "Hello", then the master responds with a reciept.

We decided to use microcontroller boards we made. There were two boards in the group that allowed I2C connections: Terrence's Terrenino board and Ravi's ATTiny 1614 development board. Connecting I2C is simple, it requires SDA to SDA and SCL to SCL as well as a common ground. A common positive voltage is optional. It is recommended when connecting I2C, to include a pull up resistor on both the SDA and SCL lines for signal stabilizing. Fortunately Terrence's Terrenino has two 4.99K pull up resistors integrated with its I2C port.

We first uploaded the programs to the boards.

I2C master by DroneBot Workshop. The program sends a character to the slave and is set to read a string of five characters sent by the slave. We added a delay to slow down the response a bit when displaying on the serial monitor.

I2C slave by DroneBot Workshop. The program recieves a character from the master and replies with a string of five characters "Hello". The slave contains an address, therfore multiple slaves with differents addresses can be connected.

We then connected the boards

Serial monitor for slave showing the request and reciept from master.

Serial Monitor for master showing the "Hello" sent from the slave.

Source Codes

I2C Master

I2C Slave