Networking and Communications

Task for Week 13

- Group Assignment
send a message between two projects
- Individual Assignment
design, build, and connect wired or wireless node(s) with network or bus addresses

Group Assignment

  • Here is the Link to our group Assignment.
  • Serial Communication

  • Serial COmmunication protocol is a way of transmitting data in a line, one digital data after another.
  • For example if we want to send the 198 which in binary which are just ones and zeros will be 11000110. So in parallel communication, we connect one wire for each bit and send a high digital poles for ones, low value for zeros and do that at the same time. This means that at one moment we can send all the bits at the same time but the disadvantage is that for this type of communication, you will need to use 8 connections plus a ground reference so in total it will need 9 cables for sending 8 bits of data. Similarly, if we want to send 16 bits of data, then we will need 17 cables to do the communication which will be very hectic and confusing too. Traces
  • So instead in Serial Communication we will place the bits in series and then we send each one after another using just one cable. The disadvantage of this type of communication is if we send 19 bits in parallel, we need only one clock pulse but if we send the same data using Serial communication, we will need 16 clock pulses which will make the communication 16 times slower.
  • Traces
  • Depending on the clock pulses, the serial communication can be Synchronous or Asynchronous. Synchronous uses the clock to send data at specific speed and time where as Asynchronous doesn't have a clock.
  • Types of Serial Communications

    1. UART Communication(Universal Asynchronous Receiver Transmitter) - Asynchronous
    2. I2C Communication(Inter-Integrated Circuit) - Synchronous

    Individual Assignment

  • For this weeks assignment we are suppose to design, build, and connect wired or wireless node(s) with network or bus addresses. So I decided to use my input/output board which i designed during the output week.
  • Since I've already tired Wired communication during my group assignment, I decided to go on with Wireless Communication.
  • I found a Bluetooth module in our local lab and decided to try using that to communicate with my board. The bluetooth module is the DSD Tech HM-11 Bluetooth 4.0.
  • Bluetooth Module

    Traces Traces Traces Traces
  • Here is the user module that was with the module.
  • Traces Traces
  • And here is the link to the DATASHEET of the bluetooth module.
  • This bluetooth module uses BLE(Bluetooth Low Energy) protocol which is very much convenient for transferring small amounts of data between nearby devices and it also consumes low power compared to Bluetooth. So devices using this protocol runs for years by using small battery. Also since it consumes less power, it can be used on mobile systems.
  • Since I was going to use a wireless communication for the first time, I went through a lot of tutorials and documentations that used bluetooth or anything related to that.
  • Arduino Tutorial 1 Arduino Tutorial 2 HC-05 Module

    Connections made

    1. VCC of my Board to the VCC of the Module
    2. GND of my Board to the GND of the Module
    3. RX of my Board to the RX of the Module
    4. TX of the Board to the TX of the Module
    5. Traces

    Programming

  • This is the code I used which I got from HERE.I made the changes for the RX and TX pin which for my board I used 8 and 9 pins of ATTINY1614 and LED that was soldered to my board was connected to the PIN 3 of ATTINY1614.
  •   #include <SoftwareSerial.h> 
      SoftwareSerial mySerial(8,9); 
      int ledpin=3; 
      void setup() 
      
      { 
          mySerial.begin(9600); 
          //Serial.begin(9600); 
          pinMode(ledpin,OUTPUT); 
      } 
      
      void loop() 
      
      { 
          int i; 
          if (mySerial.available()) 
          { 
      
              i=mySerial.read(); 
             // Serial.println("DATA RECEIVED:"); 
              if(i=='2') //means that that when i type 1 in the app, the LED light will turn on
              { 
                  digitalWrite(ledpin,HIGH); 
                 // Serial.println("led on"); 
                  delay(500);
              } 
      
              if(i=='3') // similarly when i type 0 then the LED will turn off
              { 
                  digitalWrite(ledpin,LOW); 
                 // Serial.println("led off");
                  delay(500); 
              } 
         } 
      
      }
      
      
  • Then I complied and uploaded the code. Used ATTINY 1614 board and Programmer as "SerialUPDI-SLOW-57600 baud".
  • Traces Traces

    To Connect Bluetooth

    1. Now to connect to the bluetooth, I downloaded a BLE app for my android phone. I downloaded BLE Scanner.
    2. Traces
    3. After installing the app, Open the app and this is what appears in the screen. It will show all the devices available to connect.
    4. Traces
    5. The app is showing the bluetooth module by its name. So connect to that.
    6. Before we connect to the Bluetooth, the red LED on the module will simply "Blink".
    7. After the Bluetooth gets connected, the the bluetooth module will stop BLINKING.
    8. Traces
    9. CLick on the "CUSTOM SERVICE" to write our command.
    10. Traces
    11. Then click on the Write Value and select TEXT. Now simply type 2 of turning ON the LED and 3 for turning OFF the LED.
    12. Traces

    Working Video

    Reflection

  • It was a fun week again. I was able to learn about communicating boards using wired and wireless communication. Learnt a lot about the connections since I made enough mistakes doing the group assignment. I was able to figure out how to light LED using Bluetooth module which was high level for me. Definitely came out wiser again this week.
  • Main things to keep in mind that all the pins in the Arduino or any other board will not be applicable as RX where TX wont be a problem.
  • Design Files

  • Bluetooth Code
  • Attiny1614 Board