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 ...

Interfacing Push button switch with AT89S52 Microcontroller.

This tutorial is for beginners in the field of micro-controller. The purpose of this tutorial is to use of push-button switch with the micro-controller. It will be useful whenever a decision is to be made according to the press of a switch.

Interfacing Push button switch with AT89S52 Microcontroller.

Input/output devices are very critical components of an embedded system. The first input device we will study is the switch. It allows the human to input binary information into the microcontroller. Typically we define the Two-state, logic as true when the switch is pressed. logic false, when the switch is not pressed. A single pole single throw (SPST) switch has two connections. The switches are shown as open circuits in Figure 1. which is a normally open switch (NO), the resistance between the connections is infinite (over 1000 MΩ) if the switch is not pressed and zero (under 0.1 Ω) if the switch is pressed.

 A switch has a two-state open state and a closed state. And the state of the switch is monitored by the microcontroller at a digital input pin. A switch requires a pull-up or pull-down resistor to produce a definite high or low voltage when it is open or closed. A resistor placed between a digital input and the VCC(5v) is called a "pull-up" resistor because it normally pulls the pin's voltage up to the VCC(5v). A resistor placed between a digital input and the GND(0v) is called a "pull-down" resistor because it normally pulls the pin's voltage to the GND(0v).

In positive logic input pin of the microcontroller is normally in a low state(0V logic 0) when we press switch pin becomes a high state (Vcc-5V logic 1).

In negative logic input pin of the microcontroller is normally in a high state(Vcc-5V logic 1)when we press the switch pin becomes a low state (0V logic 0).

Circuit Diagram
Interfacing Push button switch with AT89S52 Microcontroller.

Show in above circuit diagram switch is connected with P2.0 of AT89S52. In a normal state, P2.0 is pull-up by a 10k resistor so normally P2.0 is in the high state. When we press switch P2.0 becomes low and it's monitored by the digital input pin of the AT89S52 microcontroller.

Sample Code

#include <reg51.h>// Include address of register

sbit Switch = P2^0;//Switch is connected to P2.0 of AT89S52

void main()//main function

{

 while(1)//Infinite loop  

 {

  if(Switch == 0)//switch is pressed

  {

   //When Switch is pressed  

   //type your code here ex. turn on led 

  }

  else

  {

   //In normal condition switch not pressed

  }

 }

}

Download Complete Project:

You can download entire project files here

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...

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. 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...

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...