Skip to main content

Industrial VS Commercial VS Residential Electrical Installation

Hey, in this article we are going to see the comparison between Industrial, Commercial, and Residential Electrical installation. We will make compare with respect to types, procedure, cost, safety, equipment, and many other essential factors. First of all, let's know what is electrical installation. Electrical installation is a procedure to install electrical circuits, wirings, equipment, and machines. The electrical installation can be divided into three major parts - 1. Installing of electrical equipment or device or machine 2. Make electrical connection or wiring for them 3. Provide them proper voltage and power to operate them. These different types of electrical installation required different types of electricians and management. For example, commercial electrical installation requires commercial electricians, industrial electrical installation requires industrial electricians, and residential electrical installation requires residential electricians. We already published an ...

74HC165 Shift Register and your Arduino UNO

Today in this tutorial I'll explain to you how to control the 74HC165 parallel in serial out(PISO) shift register using your ARDUINO board. Here we used 74HC165 for increasing numbers of inputs of your ARDUINO board. Shift registers are often used for the purpose of saving pins on a microcontroller. Every microcontroller has a limited number of pins for general inputs and outputs (GPIO). Sometimes we have required more inputs and our controller does not provide such inputs at that time parallel in serial out(PISO) shift register is used to increase inputs.

74HC165 Shift Register and your Arduino UNO

An 8-bit shift register needs 4 lines of a microcontroller. One pin to clock for data transfer, one for clock enable, one for shifting/loading/latching the bits, and one for serial data transfer. Here we used only 3 pins of microcontrollers. One pin for loading the bits, one pin to clock for data transfer, one pin to serial data transfer. In 74HC165 Clock enable pin is active low so we connect it to the ground. Two 74HC165 can be cascaded to increase lots of inputs.

 Show in the above image the input pins of the shift register 74HC165 are pin 11 to 14 (D0-D3 Lower 4-bits) and pin 3 to 6 (D4-D7 Higher 4-bits). According to the datasheet of 74HC165, the maximum allowable voltage for VCC is 7V, where the input voltage range is between GND to VCC. But our Arduino board has inbuilt 5V so it is recommended to operate the at 5V.               

74HC165 has three control pins to control the shift register and two output pins which are listed below

  • CP - Clock Input (LOW-to-HIGH edge-triggered),
  • /CE - Clock Enable input (active LOW)
  • /PL - Asynchronous parallel load input (active LOW)
  • DS - Serial data input, used when you want to cascade two or more shift registers together.
  • Q7 - Serial output from the last stage
  • /Q7 - Complementary output of Q7 from the last stage

Working of 74HC165:
74HC165 Shift Register and your Arduino UNO

         According to the datasheet you need to make the Parallel load input high. When the parallel load (PL) input is triggered LOW, parallel data from the D0 to D7 inputs are loaded into the register asynchronously.

       When PL is HIGH, data enters the register serially at the DS input and shifts one place to the right (Q0 ---> Q1 ---> Q2, etc.) with each positive-going clock transition. This feature allows parallel-to-serial converter expansion by tying the Q7 output to the DS input of the succeeding stage.

        Now, Send the clock pulse(LOW-to-HIGH) to the shift register to obtain the serial output. At that time you need to set /CE pin to low to enable clock input. 8-bit parallel data will be sent out in eight clock pulse.  
Show the shift register operation in the Timing diagram 

Connection With Arduino UNO:

As shown in the above connection diagram
74HC165 Shift Register and your Arduino UNO

  • SO-Serial output (Pin 9) of 74165 is connected to the digital pin 2 of Arduino UNO. 
  • SH/LD (Pin 1) of 74165 is connected to the digital pin 3 of Arduino UNO.
  • CLK (Pin 2) of 74165 is connected to the digital pin 4 of Arduino UNO.
  • INH (Pin 15) of 74165 is connected to the GND pin of Arduino UNO.
  • VCC (Pin 16) of 74165 is connected to the 5V pin of Arduino UNO.
  • GND (Pin 8) of 74165 is connected to the GND pin of Arduino UNO.

INHIBIT Section of the Sequence.

            During the Inhibit section of the sequence, state (HIGH or LOW) of D0 – D7 pins of 74HC165 (this state will be considered as the parallel data) will be stored in 74HC165.

SERIAL SHIFT Section of the Sequence.

         During the Serial Shift Section of the sequence, data stored during the inhibit section of the sequence will be serially shifted through the QH pin of 74HC165

Arduino Sketch:

/*parallel data read into Arduino and send out to serial monitor of Arduino.*/


#define SO  2     // SO-Serial output (Pin 9) of 74165 is connected to the digital pin 2 of Arduino UNO.
#define SH_LD  3  // SH/LD (Pin 1) of 74165 is connected to the digital pin 3 of Arduino UNO.
#define CLK  4    // CLK (Pin 2) of 74165 is connected to the digital pin 4 of Arduino UNO.
// variables will change:
int i = 0;         // variable for reading 8-bit data
int PinState = 0;   //read the state of the SO pin
int Parallel_data = 0;//To store parallel data
void setup() 
{
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  // initialize the SH_LD & CLK pin as an output:
  pinMode(SH_LD, OUTPUT);
  pinMode(CLK, OUTPUT);  
  // initialize the SO-Serial output pin as an input:
  pinMode(SO, INPUT); 
}
void loop()
{
  digitalWrite(CLK, LOW); 
  /*Parallel data that will be entered through D0 - D7 Pins of 74165  **/
  digitalWrite(SH_LD, LOW); 
  delay(5);
  /*******************  INHIBIT SECTION START HERE  *****************/
  digitalWrite(SH_LD, HIGH);
  /*******************  INHIBIT SECTION ENDS HERE ******************/
  /************** SERIAL SHIFT SECTION START HERE **********/ 
  //Read 8-bit data from 74HC165
   Serial.print("Parallel Data:");
   for(i=0;i<8;i++)
    {
        PinState = digitalRead(SO);// read the state of the SO:
       digitalWrite(CLK, LOW);
        delay(1);
        digitalWrite(CLK, HIGH);
        delay(1);
        Serial.print(PinState); //Send out one by one parallel data to serial monitor 
        Parallel_data = (Parallel_data<<1)|PinState; //Store the value in Parallel_data
    }
   Serial.println();
   delay(1000);
}

Comments

Popular posts from this blog

What is a Positive Temperature Coefficient (PTC) | Positive Temperature Coefficient Thermistor

PTC is an initial for Positive Temperature Coefficient PTC thermistors are resistors with a positive temperature coefficient, meaning their resistance rises as the temperature rises. PTC thermistors are classified into two types depending on the materials used, the structure of the device, and the production method. Solicitors are the earliest type of PTC thermistors, and they employ silicon as the semiconducting material. Because of their linear feature, they are employed as PTC temperature sensors.  The switching type PTC thermistor is the second category. The resistance-temperature curve of a switching type PTC thermistor is very nonlinear. When a switching type PTC thermistor is heated, the resistance initially decreases until a critical temperature is achieved. As the temperature rises above the critical point, the resistance rises substantially. This kind of PTC thermistor is commonly utilized in PTC heaters, sensors, and other applications. This second group includes polyme...

What is the Joule Thief Circuit and how does it work

A joule thief is a compact, low-cost, and easy-to-build self-oscillating voltage booster that is often used to drive small loads(3.3v 5mm LED). Other names for this circuit include blocking oscillator , joule ringer , and vampire torch . The circuit is a blocking oscillator variation that functions as an unregulated voltage boost converter. The output voltage is increased at the price of a larger input current draw, but the output integrated (average) current is reduced and the luminescence brightness is reduced. This joule thief Circuit uses a 1.2 V or 1.5 V single-cell electric battery to power LEDs. However, as the supply voltage reaches 3V, the LED begins to light. The theory of operation of a Joule thief circuit Joule Thief Circuit The joule thief circuit operates on a fairly basic basis. It operates by quickly switching the transistor. When the transistor is first switched off, a tiny amount of current flows via the resistor, primary winding, and base-emitter junction, assistin...