Networking and Communications

Group assignment:

  • Send a message between two projects

  • Individual assignment:

  • Design, build, and connect wired or wireless node(s) with network or bus addresses
  • Introduction to Networking and Communications


    What is I2C?


    The I2C communication bus helps us to implement it very easily in many electronic designs that require communication between a master and multiple slave devices or even multiple master devices. Its easy implementation is due to the fact that it helps us that by means of and the use of two cables for communication we can connect between up to almost 128 (112) devices. when we use 7-bit addressing and up to almost 1024 (1008) devices when using 10-bit addressing.


    Each I2C bus can support up to 112 devices. All devices need to share GND. The speed is around 100 kb/s—not very fast but still respectable and quite useable. It is possible to have more than one master on a bus, but it's really complicated and generally avoided. A lot of sensors use I2C to communicate, typically Inertial Measurement Units, barometers, temperature sensors, and some Sonars. Remember that I2C is not designed for long cable lengths. Depending on the cable type used, 2 m might already cause problems. Connecting more devices If we need to connect more than two devices on an I2C bus, we just have to connect all SDA and SCL lines together. We will need the address of every slave to be addressed from the master Arduino.


    ADVANTAGES

    Only uses two wires Supports multiple masters and multiple slaves ACK/NACK bit gives confirmation that each frame is transferred successfully Hardware is less complicated than with UARTs Well known and widely used protocol


    DISADVANTAGES

    Slower data transfer rate than SPI The size of the data frame is limited to 8 bits More complicated hardware needed to implement than SPI. We have connected micro controller, so these steps to connect two Arduinos using I2C: First step Connect pin A4 and pin A5 on one Arduino to At mega 25600 pin 20 SDA , and pin 21 SCL . Second Step the GND line must be common for both Arduinos. Connect it with a jumper. Third Step Remember never to connect 5 V and 3.3 V Arduinos together. It won't hurt the 5V Arduino, but it will certainly annoy its 3.3 V.

    Types of Commuincation protocols


    There are different types of data transfer available in the digital electronics such as serial communication and parallel communication. Similarly the protocols are divided into two types such as Serial Communication Protocol and Parallel Communication Protocols. Examples of Parallel Communication Protocols are ISA, ATA, SCSI, PCI and IEEE-488. Similarly there are several examples of Serial Communication Protocols such as CAN, ETHERNET, I2C, SPI, RS232, USB, 1-Wire, and SATA etc.


    Types of communication


  • 1 Serial communication
  • 2 Parallel communication
  • Comparision of Serial Vs Prallel communication


    Image taken from circuitdigest


    About Serial Commuincation Protocols


    Before starting with Serial Communication Protocols, Let’s break the terminology in three parts. The communication is very well known terminology which involves the exchange of information between two or more mediums. In embedded systems, the communication means the exchange of data between two microcontrollers in the form of bits. This exchange of data bits in microcontroller is done by some set of defined rules known as communication protocols. Now if the data is sent in series i.e. one after the other then the communication protocol is known as Serial Communication Protocol. More specifically, the data bits are transmitted one at a time in sequential manner over the data bus or communication channel in Serial Communication. Refer from circuitdigest.com


    Image taken from circuitdigest


    Synchronous Serial Communication


    SPI Protocol Communication in SPI is done by a master and slave relationship, in which master initiates data frame. When the master generates the clock and selects a slave the data can be transferred either in one or in both the direction simultaneously.

    we can find references in the following link signoffsemi.com


    Image taken from signoffsemi


    Serial Communication


    I2C interface is a simple bidirectional interface which uses a single data line to transmit and receive the data. I2C is a serial 2 wire bus designed to communicate between the IC’s using a minimum number of pins. It is half duplex, synchronous serial communication protocol. The data transmission always initiated by the master. Each device on the I2C bus has a specific device address to differentiate between other devices that are on the same I2C bus. The I2C interface consists of a Serial Clock Line(SCL) and Serial Data Address(SDA). Data transfer may be initiated only when the bus is idle. A bus is considered idle if both SDA and SCL lines are high after a STOP condition. I2C supports transfer speed of around 100kHz (original standard, or 400kHz using the most recent standard).


    Image taken from signoffsemi


    Serial Communication


    For this week's assignment I will use the pcb board built in the week of outputs, we can find the entire manufacturing process in the following link



    Serial Communication using, ATtiny 44 turning on a led on the ATtiny44


    Two ATtiny44s were connected by using the rx tx pins, when the button is pressed, the master pcb board sends a character to the slave pcb board, thus turning on the led integrated in the pcb board.


    Image taken from circuitos-electricos


    Download the arduino master codes

    Download the arduino slave codes


    Serial Communication using, ATtiny 44 sending a character through a button to Atmega328p


    The ATtiny 44 was configured as a sender, when pressing the button a character will be sent to the Atmega 328p receiver, when checking the received character we will light a led, to verify the shipment we can do it through a serial motor, because our 328p pcb board is connected to the computer through the FTDI module " see connections in the output assignment."


    Image taken from electronoobs



    Download the arduino sender codes

    Download the arduino receiver codes


    Serial Communication AtMega 328p and Bluetooth


    Through the pcb board with the AtMega 328p we carry out communication through the HC-05 Bluetooth module, this module communicates through the rt tx pins, but these are already occupied with the FTDI module " see connections in the output assignment.", so it was declared as SoftwareSerial mySerial2 to the pins (10, 11) to communicate with the bluetooth module


    Image taken from prometec



    To see the manufacturing process of pcb boards please follow the following link



    Download bluetooth pcb files




    Download the arduino codes

    General Conclusion:

    This week's work was quite interesting and opened the doors to new ideas and design possibilities that I had not explored before, there is a lot to learn in design tools, but expertise is not learned overnight.

    Finally, you have to remember all the safety parameters to make good use of the machines, especially the laser cutter, which can be very dangerous. When it comes to cutting vinyl, it was a lot of fun to be able to make custom stickers, although the job of removing excess material is a bit stressful


    Return