Demonstrate workflows used in network design.
Implement and interpret networking protocols and/or communication protocols.
Group assignment: Send a message between two projects.
Individual assignment: Design, build, and connect wired or wireless node(s) with network or bus addresses.
This week's assignment to make multiple boards and have them talk to each other. In this week I will send a message between two projects, design, build and connect wired or wireless nodes with networkor bus addresses. Search about implement and interpret networking protocols and/or communication protocols.
To understand more about Networking andCommunications, I started searching form the very beginning to understand whatis networking and network protocol I remember I studied the basics in high school, I learned about the telecommunications network, Computer network, Transport network.I didn’t remember all the information,so I did small research for networking and embedded communications focusing on serial communication.
Interpret networking protocols
Network: In a network, a group of computers and peripheral devices are connected. The smallest possible network is the one in which two computers are connected.
Networking: Networking is nothing but implementing tools and tasks for linking computers so that they can share resources over the network.
Network protocols:
Are formal standards and policies made up of rules, procedures and formats that defines communication between two or more devices over a network.
Networks protocols types:
Communication, such as Ethernet.
Management, such as the Simple Mail Transfer Protocol (SMTP).
Security, such as Secure Shell (SSH).
Communication protocols:
A communication protocol is a system of rules that allow two or more entities of a communications system to transmit information via any kind of variation of a physical quantity. Protocols may be implemented by hardware, software, or a combination of both.
Types of communication protocols:
Telnet.
Gopher.
IP: Internet Protocol.
POP: Post office Protocol.
FTP:File Transfer Protocol.
UDP: User Datagram Protocol.
HTTP:Hyper Text Transfer Protocol.
TCP: Transmission Control Protocol.
HTTPS: Hyper Text Transfer Protocol Secure
TCP/IP is a stream protocol. This means that a connection is negotiated between a client and a server.
Implementing network protocols
How Network Protocols Are Implemented? In order for network protocols to work, they must be coded within software, either a part of the computer's operating system (OS) or as an application or implemented within the computer's hardware. Most modern operating systems possess built-in software services that are prepared to implement some network protocols. Other applications, such as web browsers, are designed with software libraries that support the high-level protocols necessary for that application to function. For some lower-level TCP/IP and routing protocols, support is implemented in direct hardware (silicon chipsets) for improved performance.
Wireless Network Protocols
Wi-Fi, Bluetooth, and LTE, wireless networks have become commonplace. Network protocols designed for use on wireless networks must support roaming mobile devices and deal with issues such as variable data rates and network security.
Network Routing Protocols
Routing protocols are special-purpose protocols designed specifically for use by network routers on the internet.
Embedded systems Networking
Embedded systems connected internally on same IC or systems at very short, short and long distances can be networked using a type of the Input/Output device buses- CAN, I 2C, USB, PCI.
Bus Communication for networking
Each specific Input/Output device may be connected to other using specific interfaces, for example, with Input/Output device for example, LCD controller, keyboard controller and print controller.
Bus communication simplifies the number of connections and provides a common way protocol of connecting different or same type of I/O devices.
Serial bus protocols A communication protocol is a protocol about how two parties should speak to each other. Serial communication protocols assume that bits are transmitted in series down a single channel.
Serial Communication Protocols such as CAN, ETHERNET, I2C, SPI, RS232, USB, 1-Wire, and SATA etc.
Synchronous Serial Protocols The synchronous type of serial protocols such as SPI, I2C, CAN and LIN are used in different projects because it is one of the best resources for onboard peripherals. Also these are the widely used protocols in major applications.
SPI Protocol
The Serial Peripheral Interface (SPI) is a synchronous interface which allows several SPI microcontrollers to be interconnected.
I2C Protocol
Inter integrated circuit (I2C) two-line communication between different ICs or modules where two lines are SDA (Serial Data Line) and SCL (Serial Clock Line). Both the lines must be connected to a positive supply using a pull up resistor.
USB Protocol
USB (Universal Serial Bus) is widely protocol with different versions and speeds. A maximum of 127 peripherals can be connected to a single USB host controller.
CAN Protocol
The Controller Area Network (CAN) is used in e.g. automotive to allow communication between ECUs (Engine Control Units) and sensors. The CAN protocol is robust, low-cost and message based and covers in many applications - e.g. cars, trucks, tractors, industrial robots.
I choose I2C to apply for this assignment, I2C network, as I mentioned before, is one of the few different solutions for making tow circuits talk to each other. There needs to be at least one master chip, but as long as they take turns, it is possible to have multiple masters on the network, and slave and it can be multilabel. Each Slave device has to have its own unique address and both master and slave devices need to take turns communicating over the same data line.
I2C Between tow Uno Arduino:
Arduino 1, the Master, is programmed to send 6 bytes of data every half second to a uniquely addressed Slave. Once that the message is received, it can then be viewed in the Slave board's serial monitor window opened on the USB connected computer running the Arduino Software (IDE).
Connection:
The Arduino Uno board has only one I2C module, but it provides these SDA and SCL lines at two different locations.
I connected the SCL and the SDA.
Then I connected the 5V line from the master to the slave to power it with one USB cable.
Last I connected the GND.
I uploaded the Master code to the master Arduino, and the slave code to the slave Arduino.
Make sure to use the same port.
From Wire library, we are using here master writer for Arduino as master and slave receiver for Arduino as a slave. This example will transfer data from master to slave and slave display it on a serial monitor.
You can use this library from.
File -> Examples -> Wire -> master writer
File -> Examples -> Wire -> master receiver
Arduino Master code:
Code explanation
The master reader including the wire.h library, in this code wires begin then he filled a salve device
in the bracket so you would put your address so serials up again initializing the serial
interface and will request some data from adress 8 on the bus and in this code it requesting 6 bytes
of data, the slave will send it and the master print that data up to the serial monitor.
Arduino slave code:
Code explanation
I used the wire.h library in this code initializing the wire library with address #8 and then we are creating a handling function here, so wire.onRequest event what this does is it creates a separate function that can be accessed whenever the on request is sent, so a request event a
a function that executes whenever data is requested by the master.
The connctions between the master and the slave arduino.
After uploaded the codes and the serial monitor shows the message.
The serial monitor and the message.
The connection between the master and slave arduino boards.
The Arduino is still working even there are no pull up resistors because there is an embedded pull-up resistor inside the Arduino itself.
So I realized that the I2C works in two modes namely:
Master mode
Slave mode
SDA (serial data) wire is used for data exchange in between the master and slave device.
SCL (serial clock) is used for the synchronous clock in between master and slave device.
Master device initiates communication with a slave device. It requires a slave device’s address to initiate conversation. The slave device responds to a master device when it is addressed by a master device.
Connecting Attiny 44 to Arduino: After finishing the solrdring and test the PCB , by using Arduino ISP I uploaded the master code to the attiny 44 PCB and conncting the water sensor also with the same board, then I conncted the I2C LCD to Arduino UNO to creat a connection betwwen each othrs.
A4= SDA
A5=SCL
Connect the ATtiny44 Pin 1 to 5 volts (VCC)
Connect the ATtiny44 Pin 14 to ground.
RESET: Connect the ATtiny44 Pin 4 (Reset) to Arduino Pin 10.
MOSI: Connect the ATtiny44 Pin 7 to Arduino Pin 11.
MISO: Connect the ATtiny44 Pin 8 to Arduino Pin 12
Programming the node by using the code below:
I added the comments withen the code.
Arduino as sleave:
I added the serial print to test the code, then I used I2C LCD as an output to display interactive short sentences with the user.