Exercise 14 Networking and Communications

group assignment: send a message between two projects

We used two of our boards to communicate between the serial ports of our computers. We used this raspberrypi4dummies tutorial we uploaded the individual master and slave code to each individual boards then and connected the A4 and A5 ports and the 5V and ground between the two boards. When we typed in "H" in the serial moniter, we got the message "yo, what's up?" and when we typed "L" we got "cool, cool"

Arduino connection wiring
Master code
Slave code

individual assignment: design and build a wired &/or wireless network connecting at least two processors

I have never done anything like this before and it was the hardest week yet. As such I decided to do the simplest design using the I2C Master Reader/ Slave Sender in arduino using this tutorial . What I learned is that the I2C synchronous serial protocol is a multi-master, multi-slave bus that allows microcontrollers to communicate information. To do this through arduino, the Wire Library must be downloaded. The first microcontroller, the master, is programmed to request and read data sent from the second microcontroller, called the slave. Once this information has been read, we can see it in the master serial monitor. Here are the steps I took:

  • on arduino.cc I downloaded the Wire Libarary
  • opened the separate codes for the master and the slave.
  • Master code
    Slave code
  • Used two satshakit boards: labelled one the Master, the other the Slave.
  • Uploaded the master code to the master and the slave code to the slave microcontroller.
  • Attached analog pin 4 and 5 on one board to the corresponding pins on the other board.
  • opened the serial monitor for the master and saw the world "hello" appear over and over again- this means the boards are communicating!!!
  • I played around with the code and got the monitor to say "meow" instead of "hello". I also changed the speed from 500 to 1000.
  • communicating 'hello'
    communicating 'meow'