Interfacing DS1620 with PIC Microcontroller

 Project Over View:

In this project we are interfacing DS1620 chip with the PIC Microcontroller. The Temperature will be read from DS1620, its feature for indication of high , low temperature will also be used. 

Description of DS1620:

The DS1620 is a single chip having two major functionalities combine together named Digital Thermometer and the Thermostat. The DS1620 provides 9bit temperature measurement results the temperature of this chip corresponds to the environmental temperature. The second functionality is thermostatic control with the three alarm outputs correspond to three set points which are also programable. Due to the provision of this feature in this chip, we can say that the DS1620 can be used as a thermostat. The name of the three alarms pins are THIGH, TLOW and TCOM. The THIGH pin will be high if the temperature is greater than or equal to defined temperature named TH. The TLOW pin will be high if the measured temperature is less than or equal to predefined temperature named TL. The TCOM pin will be high when the measured temperature is greater than TH and will remain high until the measured temperature is lesser than TL.

The predefined temperature values for TH and TL are saved in the nonvolatile memory of DS1620.It may be noted that these values can be programmed any time during the execution while going through the procedure for updating these values to DS1620 by using microcontroller. If DS1620 is going to be used as a stone alone system, then these values will be programmed first, so that chip can perform proper operation as required by user. The predefined Temperature values of TH and TL can be written or read to or from the chip DS1620 by using the simple 3 wire interface.

The chip DS1620 measures the temperature using a built-in temperature sensor. The measured temperature value is available to read in a specific format which is a 9bit and two’s complement. The measured values are only possible to read by proper utilization of a “READ TEMPERATURE” command. After receiving the “READ TEMPERATURE” command by DS1620 the measured temperature value is transmitted serially LSB first. The chip DS1620 is usable to measure temperature in the range of -55°C to +125°C with the increment of 0.5°C. The temperature in degree Celsius can be converted to Fahrenheit using a lookup table or conversion factor.

OPERATION AND CONTROL OF DS1620

There is configuration register in the DS1620 which is required to address properly before expecting any useful operation from the chip. The configuration register of DS1620 is defined as under:

Configuration Register of DS1620
Configuration Register of DS1620

The values of this register is explained as under:

DONE is the Conversion Done Bit the value in this bit shows logical 1 if the conversion is completed the logical 0 will show that the conversion is in progress. Then the next bit comes it is THF which corresponds to the Temperature High Flag. This bit will be set to logical level 1 when the measured temperature is greater than or equal to the predefined value of TH. This bit will remain at logical level 1 until reset by writing 0. This is very useful feature which provides a way to determine if the DS1620 has ever high temperatures above TH since it is powered up. The next bit is TLF which corresponds to the Temperature Low Flag. This bit will be set to logical level 1 when the measured temperature is less than or equal to the predefined value of TL. It will remain at the logic level 1 until reset by writing 0. This is a very useful feature of DS1620 which provides a way to determine if the chip measured temperature below TL since powered up. The next bit is NVB which corresponds to the Nonvolatile Memory Busy Flag. The logical level 1 indicates that the writing to memory cell is in progress. Whereas the logical level 0 means that the nonvolatile memory is not busy at this time. The next bit is CPU corresponds to the CPU Use Bit. If CPU is 0, the CLK and / or CONV pin will act as the conversion start control. If CPU is 1, the DS1620 will be used with a CPU communication using the 3 wire port protocol.

Components used in Thermostat Project:

  1. Microcontroller : PIC 16f876A
  2. DS1620, The Digital Temperature sensor and Thermostat
  3. Crystal: 4MHz
  4. Capacitors: 22pF x 02Nos
  5. LCD: The liquid crystal Display; 2line 16 Character
  6.  Resistors: as required and shown in diagram
  7. Power Supply: +5V regulated DC power supply
  8. LEDs: 03Nos of different colors
  9. push button as required
  10. Variable resistors: as required and shown in diagram.

circuit diagram of DS1620 interface with PIC Microcontroller 16F876A:

The following is the circuit diagram in which the electrical connection of various components is described and DS1620 is interfaced with Microcontroller 16f876A along with the other components. The LEDs of three different colors are used to show the functions of thermostat of DS1620. The red LED indicates the high temperature then user defined temperate set value if occur. The Orange LED indicates the low Temperature than the user defined set value if occur. The green LED indicates the normal behavior of thermostat.
DS1620 PIC 16f876A
Circuit diagram of the Digital Thermometer and Thermostat

Software part of project:

The Proton plus basic compiler is used for the coding of this project and source code is placed below:
'*****************************************************************
'*Name : DS1620_PIC16f876A.BAS                                   *
'*Author : Dr.Rana                                               *
'*Notice : https://microcontroller-atmel-pic-avr.blogspot.com/   *
'*: All Rights Reserved                                          *
'*Date : 9/4/2022                                                *
'*Version : 1.0                                                  *
'*Notes :                                                        *
'*:                                                              *
'*****************************************************************
' Display the temperature from a Dallas DS1302 sensor
'
' For use with the ISIS 16F628 Virtual Evaluation Board.
 Device = 16F876A ' PIC 16f876A is selected for this project
 DECLARE Xtal = 4 ' Crystal used in this project is 4MHz
 ''LCD is used in 4 bit interface Mode, Upper four I/O lines
 '' of PortB are connected to the Upper four data lines of LCD
 DECLARE LCD_DTPin = PORTB.4 ' 4 bit LCD interface 
 DECLARE LCD_RSPin = PORTB.1 ' LCD RS PIN connection
 DECLARE LCD_ENPin = PORTB.2 ' LCD E PIN connection
 DECLARE LCD_Interface = 4 ' 4-bit Interface
 DECLARE LCD_Lines = 2 ' 2-Line LCD
 DECLARE LCD_Type = 0 ' Alphanumeric LCD type
' Define DS1620 Pins
 Symbol DQ = PORTC.5 ' DQ = Data pin
 Symbol CLK = PORTC.6 ' CLK = Clock pin
 Symbol RST = PORTC.7 ' RST = Reset pin
' Define Variables
 DIM DSdata AS Word ' Word variable to hold 9-bit data.

' Define variables
 DIM IdCt AS Byte
 DIM HighVal2 AS Byte
 DIM LowVal2 AS Byte
' Define Constants for DS1620 configuration
 Symbol Rconf = $AC ' Read Configuration
 Symbol Wconf = $0C ' Write Configuration
 Symbol CPUon = %10 ' Operate with Microcontroller mode
 Symbol Cont = %00 ' Continuous conversions on start
 Symbol StartC = $EE ' Start Conversion
 Symbol Rdtemp = $AA ' Read Temperature
 ' Define Thermostat functions
 Symbol RhiT = $A1 ' Read High-Temperature Setting
 Symbol WhiT = $01 ' Write High-Temperature Setting
 Symbol RloT = $A2 ' Read Low-Temperature Setting.'
 Symbol WloT = $02 ' Write Low-Temperature Setting.'
 DIM HighVal AS Byte = $32 
' High Temperature Setting 25C for Thigh
 DIM LowVal AS Byte = $31 
' High Temperature Setting 24C for Tlow
'----------------------------------------------------------
' Define Push Button Interface
 Symbol Sw1 = PORTC.4 ' Sw1 = Mode Switch "Push Button"
 Symbol Sw2 = PORTC.3 ' Sw2 = Increment the variables
 Symbol Sw3 = PORTC.2 ' Sw3 = Decrement the variables 

' Start of main Program
 DECLARE All_Digital = ON 
' All analog PINs will be treated as Digital
 CLS ' Clear the LCD
 LowVal2 = ERead 0 
' Read the stored data in EEPROM Built in MCU 
 HighVal2 = ERead 1 
' Two bytes are just stored for temperature 
settings
 OUTPUT RST ' Make the RST pin an output
 OUTPUT CLK ' Make the CLK pin an output
 INPUT Sw1 ' push Button Switches are declared as input to MCU
 INPUT Sw2
 INPUT Sw3
 PRINT At 1,1, "WELLCOME"
 PRINT At 2,1,"DS1620 Interface"
 CLEAR RST ' Shutdown the DS1620
 DelayMS 1 ' Time for reset to occur
 Set RST ' Get ready to write data
 SHOut DQ,CLK,LsbFirst,[Wconf\8,CPUon|Cont\8] 
' Set configuration
 CLEAR RST ' Reset teh DS1620
 DelayMS 50
 Set RST
 SHOut DQ,CLK,LsbFirst,[StartC\8] 
' Start a conversion
 CLEAR RST ' Reset the DS1620
' Writes the config byte for THigh, set for 25C
' With a LED connected THigh pin 7, 
'at 25C or higher the LED will light.
 DelayMS 50
 HighVal = HighVal2 << 1 
' the normal number is converted to two complement
 Set RST
 SHOut DQ,CLK,LsbFirst,[WhiT\8,HighVal\9]
 CLEAR RST
' Writes the config byte for the TLow, set for 24C
' With a LED connected TLow pin 6, 
'at 24C or below the LED will light.
 DelayMS 50
 LowVal = LowVal2 << 1 
' the lower value is converted to two complement
 Set RST
 SHOut DQ,CLK,LsbFirst,[WloT\8,LowVal\9]
 CLEAR RST
 
 DelayMS 1000
 CLS
 DelayMS 1
 IdCt = 0
' Start loop, reads temperature. Loop forever
 WHILE 1 = 1
 DelayMS 100 ' Wait 0.1 second between readings
 IF Sw1 = 0 THEN Inc IdCt ' index function for menu
 IF IdCt >=3 THEN IdCt = 0
 SELECT IdCt
 CASE 0
         IdCt = 0
 CASE 1
        CLS
        IF Sw2 = 0 THEN Inc HighVal2
        IF Sw3 = 0 THEN Dec HighVal2
        IF HighVal2 >=99 THEN HighVal2 = 1
        IF HighVal2 <= 0 THEN HighVal2 = 99
        DelayMS 100
        HighVal = HighVal2 << 1
        Set RST
        SHOut DQ,CLK,LsbFirst,[WhiT\8,HighVal\9]
        CLEAR RST
        EWrite 1, [HighVal2]
 
 CASE 2
         CLS
         IF Sw2 = 0 THEN Inc LowVal2
         IF Sw3 = 0 THEN Dec LowVal2
         IF LowVal2 >= 99 THEN LowVal2 = 1
         IF LowVal2 <= 0 THEN LowVal2 = 99
         DelayMS 100
         LowVal = LowVal2 << 1
         Set RST
         SHOut DQ,CLK,LsbFirst,[WloT\8,LowVal\9]
         CLEAR RST
         EWrite 0,[LowVal2]
 CASE ELSE
         DelayMS 100
         IdCt = 0
 EndSelect
 
 CLEAR CLK
 Set RST ' Start the DS1620
 SHOut DQ,CLK,LsbFirst,[Rdtemp\8] ' Request temperature
 SHIn DQ,CLK,LsbPre,[DSdata\9] ' Get temperature
 CLEAR RST
 PRINT At 1,1,"LTp ",Dec LowVal2,"C"
 PRINT At 1,9,"HTp ",Dec HighVal2,"C"
 DSdata = DSdata >> 1 ' Shift the sign bit into the 
correct position
 ' Display signed temperature in Celsius.
 PRINT At 2,1,"RTp ",Dec DSdata.LowByte,"C"
 PRINT At 2,16, Dec IdCt
 WEND
''Microcontroller PIC16F876A has built in EEPROM 
'The user defined values for High Temperature and 
'Low Temperature limits
' are being stored in EEPROM of MCU
 EData AS Byte 25, 30


temperature sensor interfacing using adc and i2c with pic microcontroller projects interfacing lm35 with microcontroller. How to interface temperature sensor with PIC microcontroller? LM35 interfacing with PIC16F877A pic microcontroller projects pdf How to connect temperature sensor to microcontroller? What is DS1620? Digital Thermometer Ds1620& Pic | PDF | Microcontroller ds18b20 temperature sensor with pic microcontroller projects for beginners Appkit: DS1620 Digital Thermometer, pic, PIC Microcontroller based Dallas DS18S20, What is temperature sensor interfacing?, Temperature sensor using PIC16F877A microcontroller, Digital Thermometer using a PIC Microcontroller, Interfacing the DS1620 with a DS5000/8051 Microcontroller, DS18S20 interfacing with pic and avr microcontroller, Interfacing Temperature Sensor (DS1620) with AT89S51, Interfacing Temperature sensor with lcd, Interfacing at89c2051 & PCF8591 in displaying temperature, pic microcontroller projects pdf, pic microcontroller projects for beginners, temperature sensor interfacing using adc and i2c with pic, pic16f877a projects with source code pdf, ds18b20 temperature sensor with pic, pic projects with source code, Temperature sensor using PIC16F877A microcontroller, LM35 interfacing with PIC16F877A, 

Solenoid valve controller with MCU

Introduction of Printer Port and MCU controller for Solenoid Valve

In this project our task was to develop a complete circuit to control solenoid using PC interface. Computer system is interfaced with microcontroller with the help of parallel port. This project is to develop a complete system to control Solenoid Valve System. The main part of this project is the interfacing of microcontroller to the PC and with the other devices. The data is provided by the pc to the microcontroller and this data is the provided to the DAC which generates different voltages levels according to the input given this data is the provided to the OPAM which provides us the required voltage levels. This project is divided in to four parts or stages. Which are as under: 

  • PC and Parallel Port Interfacing 
  • Designing Circuit and selection of components or Devices 
  • Microcontroller Programming or Coding 
  • Solenoid valves controlling testing 

Overview of the Project

Before giving the detail description of each equipment used, it is important to describe the general overview over the project circuitry, that is how the data starts from PC and being received by solenoid in the end. First of all the data from PC is send to LATCH 373 using parallel port of PC. The data is received on LATCH on pins D1, D2, D3, D4, D5, D6, D7, D8 from parallel port pins 2,3,4,5,6,7,8,9 respectively. Pin 10 is grounded and pin 20 is been given VCC 20 volts. The is transferred to micro controller on port-I on pins 1-8. The corresponding pins of latch are Q1, Q2, Q3, Q4, Q5, Q6, Q7, and Q8 respectively. The data is then transmitted To port 2 on pins 21 to 28. The next step is to send data on DAC-0800. The data from micro controller pin 2 is then received by DAC on pins 12 to 5 respectively. Then data is received by op-amp on pins 2 and 3 from DAC pins 3 and 4 respectively. Finally, the data received by op-amp is connected to solenoid, which has different variations as requirements of user. This was a brief summary of the data from PC till the last object solenoid. The diagram of above procedure is given below. 

Solenoid Valve Control
Block Diagram of Printer Port Interface to MCU to Control Solenoid

PC Parallel Port Interfacing 

Parallel port of computer is the one of oldest port available with PC to interface devices with computer through it. The interface through printer port is easy for developing computer-controlled system and projects. This feature of parallel port makes programming of parallel port convenient in electronics hobbyist world. The parallel or printer port is very often used in robots, test equipment, microcontroller programmers, home automation, etc. The primary use of parallel port was to connect printers with computer as it was designed for this purpose, thus, it is usually also called Printer Port. The parallel port connector can be searched at the rear side panel of PC. It is a 25-pin female DB25 connector to which normally printer was connected. The PCs have only one parallel port normally. Additional Parallel Ports can be added inserting ISA/PCI cards. 

Parallel or Printer Port
DB25 PIN Connection of Printer Port


We will use parallel port here to connect it to the microcontroller through the latches. The data from PC will be latched and then forwarded to the microcontroller. A simplified diagram of a parallel port along with its pin configuration is given blow. The pin outs of connector is shown in the picture below. Parallel Port Pins The data input and output lines in DB25 connector of parallel port can be divided in to three sub-groups, which are listed as below: 

  1. Data lines (data bus) 
  2. Control lines 
  3. Status lines 

The brief introduction of these groups is as, the data is transferred over data I/O lines, Control lines are used to control the peripheral. The peripheral can return some status signals back to computer, for this purpose the Status lines are used. These I/O lines are connected to Data, Control and Status registers internally inside PC. 

Latch 373 Description 

Latch LMS-373 is 20 pin IC. Which is used here to transfer the data from PC to controller. It received the data on clock pulses. When the enable (pin 11) is taken low the output will be latched at the level of the data that was set up. The eight flip-flops of the 74LS373 are edge-triggered D-type flip flops. When there is the positive transition of the clock, the Q outputs of flipflop/ latch will be set to the logic level which was at D inputs at that time.. The output control of latch does not affect the internal operation of the latches . That is, the old data on the latch can be retained or new data can be entered to it even when the outputs are switched off. 

ATMEL89C51 Description 

The AT89C51 is a low power, high performance 8-bit micro controller with 4K bytes of programmable and erasable read only memory (PEPROM). The device is manufactured using ATMEL’s high density nonvolatile memory technology and comparable with the industry of MCS-51TM instruction set and pinout. The on chip flash can be reprogrammed by first erasing the last program using ultra violet rays and then write new program on it using software. 

OJ0800 DAC

A digital to analog converter (DAC) is an integrated circuit that converts a digital signal input to an analog output voltage or current that is the binary weighted equivalent of the digital input code. Modern DAC s are, effectively, an array of matched current sources optimized for frequency domain performance .To handle both strong and week signals DACS require large dynamic range. Beside these there are a number of the DC parameters such as integral nonlinearities (INL) and differential nonlinearities (DNL), that are considered important because of their influence on SFDR parameters .The resolution of the DAC is dependent upon the type of the DAC, whether it is 16 bit or 8 bit, higher the number of bits smaller will be the quantization error. In our project we have used CJ0800, which is an 8 bits DAC .So the number of quantization levels are equal to 256 levels. The ratio of the input voltage range to the number of quantization levels will determine the output voltage, but remember that larger the input voltage range greater will be the quantization error. Several factors influence the selection of the DACs 

  • DAC resolution 
  • DAC dynamic specifications 
  • Operating frequencies 
  • Type of the signal 
  • Supply voltages 
  • Cost 

DACs error will add to the error caused by the resolution of the converter. A given DAC may or may not include the dc or ac error specifications. Offset error is critical in dc applications. For this reason, a buffer OP AMP must be selected that does not contribute to the problem its own offset voltages should be much less than that of the converter. The settling time of the DAC is time between the switching of the digital inputs of the converter and the time when Its output reaches its final value and remains within a specified error band or the tolerance band. It is the reciprocal of the maximum D/A conversion rate. 

LM741 Operational Amplifier General Description 

An operational amplifier is an integrated circuit that produces an output voltage that is An amplified replica of the difference between the two input voltages. An op amp can be characterized by following transfer function. where is the open loop gain of the operational amplifier . Most op amps are of monolithic type and there are dozens of different manufacturers. Op Amps are used in conjunction with other circuit components such as resisters and capacitors to perform various mathematical operations as well as a multitude of tasks. Two types of inputs are available on the integrated IC such as LM741 which we used in our project. These are named as inverting and non-inverting inputs. The op amp is ideally completely insensitive to the voltage components, which are common to the inputs. The open loop gain is a positive dimensionless constant and is usually very large, often in the range of hundreds of thousands at very low frequencies (0-30) Hz. Op Amps enter the saturation region when operated in the open loop so that a closed loop operation is always recommended, as open loop operations causes severe distortion of the signal. In the feed back configurations the gain of the amplifier is only dependent on the external components (capacitors and resistors) in our project we used the op amp as a non-inverting amplifier in order to get the positive output voltage required for the solenoid operation. The gain of a non-inverting amplifier is calculated using gain equation. Under these conditions op amp is operating as a closed loop system and the fraction of the output voltage is feed back to the inverting input terminal and is called the feed back factor. 

CHARACTERISTICS OF AN IDEAL OP AMP 

The ideal characteristics of ideal op amp are given as follow; • Infinite impedance • Zero output impedance • Infinite open loop gain The op amp diverges from the ideal characteristics due to many reasons. There are even more severe problems with op amps namely CMRR and input and offset voltages nulls. 

INPUT OFFSET VOLTAGES 

 All op amps require a small voltage between their inverting and no inverting inputs to balance the mismatches due to unavoidable process variations. The require voltage is known as input offset voltage and is normally modeled as no inverting input deriving source. The input offset voltage is of concern anytime when dc accuracy is required for the circuit. The method to null the offset voltages is to use external components to null the inputs on a single op amp chip. A potentiometer is connected between the null inputs with adjustable terminal connected to the negative supply through the series of the resisters, the input offset voltages can be nullified by shorting the inputs and adjusting the potentiometer until output voltage is zero. 

Solenoid Valve 

Solenoid is defined as a device used to control the motion of an iron bar according to the voltage applied to it. A coil of insulated wire is the main component of solenoid in which a magnetic field is produced with the flow of electric current through the coil. A coil which is surrounding a movable iron core which is pulled when the coil is electrically energized. This movement can be used to perform some specific mechanical work, such as opening a mechanical process valve, or operate an electrical switch. Cylindrical coil having larger length as compared to diameter of coil. When the current is passed through the coil of the solenoid, it comes a magnet until the current is there. The magnetic field is established due to passing current from the coil of solenoid. Therefore, it can be said that the solenoids are electromagnetic switches. When electricity passes through the solenoid, the magnetic field formed which forces to move a metal piston. The piston of solenoid is usually connected or attached to a mechanical mechanism that performs the desired specific function. The movement of metal piston causes actually to execute the application work. The application work is like operation of a mechanical valve, operation of a switch, or mechanical linkage process. In engineering fields, the solenoid is a electro-mechanical device that converts electrical energy into some where linear motion of a part. The Solenoids are usually developed or constructed to use electricity for control of compressed air, or pressurized fluids i.e. the hydraulic solenoids. The Solenoid valves are operated with electric power supply and used in variety of industrial application where the fluids are required to control automatically. Parallel to the technologic development its fields of usage have been increasing. The Solenoid valves have been derived from the principal that a magnetic field, forced by the electric energy with the help of a coil, moves some mechanical parts. Depending upon the use of project or system or application, the Solenoid valves can be developed with 02 or more ways and in different sizes as per needs. The electric supply to solenoid can be 6, 12, 24, 48, 72, 110, 220 VAC or VDC according to application or system or project usage. In Solenoid Valves the widely used body material is brass, but stainless steel, bronze, cast iron, steel or plastic body valves can be produced as well. According to the working principle of the Solenoid Valves, these can be classified into two main classes as Direct Acting Solenoid and pilot operated Solenoid. The Solenoid valves can also be classified in accordance to the fluid types control by these. The Solenoid Valves are also designed as ON or OFF type valves subject to availability of electricity. Thus, the solenoid valves can be the valve which are Normally Open or Normally Closed. Whenever we are concerned with the design of the solenoid then the major concerns are of these two areas. Determining the number of turns and the design related to electrical parameters and Design related to the mechanical parameters.

Software for Parallel Port Interface


/* Include the right header file, the library files*/
#include<iostream.h> 
#include<conio.h>
/* main program starts here*/
void main(void)
{
clrscr(); // Clear the screen of computer
int data=0x378; \\ initializing the parallel port
int n;	\\ Declaring variables
char ch; // declaration of a temporary variable
do{	\\ multiple input loop
cout<<"\t\tInput any hex value to be transfered\n";
cin>>hex>>n;
cout<<"The Data is  ";
cout<<hex<<n<<endl;
outportb(data,n); \\ sending data on port
cout<<"\t\t\tPress any key to continue\n";
cout<<"\t\t\tPress e twice to exit\n";
ch=getche(); // get a character from keyboard
clrscr();
}
while(ch!='e');	\\ program exit condition check
getch();
}
How to connect solenoid valve to microcontroller? What is a solenoid controller? Which microcontroller is best suitable to drive 4 solenoid What are the three 3 components of solenoid? Arduino Uno Micro controller c. Solenoid valve What is solenoid valve in mechatronics? Adafruit Mini Push‑pull Solenoid uxcell a14092600... Open Fram... Adafruit Lock‑style Solenoid Adafruit 412 Push‑Pull Solenoid solenoid valve arduino code solenoid valve arduino relay code solenoid valve control using microcontroller 12v solenoid valve arduino proportional solenoid valve + arduino control 24v solenoid with arduino 5v solenoid arduino arduino solenoid water valve solenoid valve arduino Plc Industrial Control Board Mcu Control Panel solenoid valve arduino code How to wire 12V Solenoid Valve - 3/4'' to Node MCU solenoid valve arduino relay code Nodemcu-esp8266 Wifi controlled motor, solenoid, valve, 5v solenoid valve arduino MCP23017 16-Channel 8W 12V FET Solenoid Driver 12v solenoid valve arduino How to control a Solenoid Valve with Arduino control 24v solenoid with arduino Solenoid Valve Interfacing With Arduino arduino solenoid driver arduino solenoid water valve control 24v solenoid with arduino solenoid valve arduino relay code control 12v solenoid valve with arduino 5v solenoid arduino solenoid valve control using microcontroller arduino solenoid relay solenoid valve arduino code arduino solenoid driver, Switching multiple solenoid valves with microcontroller, solenoid working principle, Isolating the solenoid and driving relay power supply
How to avoid voltage spikes from solenoid valves?, Battery-powered 3-5 V MCU, but 12 V solenoids 
application of solenoid actuator, What all do I need to control a 12V solenoid valve , application of solenoid valve, What should I use to drive a solenoid that requires 12, What is an industrial solenoid?, Which industry used solenoid valve?, What are the applications of solenoid in automotive?, How are solenoids useful?, what are solenoids used for in cars, uses of solenoid in daily life, 4 applications of solenoid, what is solenoid, solenoid engine project

DESIGNING AUTOMATIC GATES USING MICROCONTROLLERS FOR PARKING

Aim and Objective of Microcontroller based Automation Project:

 The main Aims and Objectives of this project is to design and develop an automatic car parking system having fully automatic gates. The use of automatic gates for various purposes can be seen in many application in different industries as well as in security systems and also at tool plazas. Same is here, we will implement this idea in our automatic car parking system. Introduction of Project: The application of the automatic control systems in different system can be observed rapidly grown during the past few decades. Same as the automatic barrier control system. The manual working or handling of any application has less accuracy as compare to the automated microcontroller based control systems. The project is basically giving an initial theme that how we can approach to an automatic barrier control system using 8051 microcontrollers. “Two gates or doors located at the entrance and exit of car parking will be opened and closed through the use of two stepper motors which be governed by Microcontroller at back of the whole system. Some of the application of automatic door controls are airports, toll gates, railway crossings etc.

 Overview of the Automatic Car Parking System: 

The parking system is based around an At89C51 micro-controller and U-shaped photo sensors. It is quick and efficient in operation. The microcontroller is serially interfaced to the PC using serial port and the RS-232 Transmitter/Receiver. The components like u-shaped Photo sensors, stepper motor and At89C51 microcontroller will be configured to each to have the control of the entire operation of the car parking control system collectively. The seven segment display units along with the serial interface will be responsible to display the number of cars already parked in the parking lot. Block diagram of the system is shown in figure 1 below. 

Automated Car Parking System
Block Diagram of The Automated Car Parking System

Basic Components Required for development of Automatic Parking System:

 In the context of design and implementation of car parking control system required the use of following the important components: 

  • Stepper Motor 
  • U-shaped Photo Sensors 
  • Seven segment Display 
  • Serial Interfacing 

The components used in this automation project will be discussed here briefly one by one. 

Stepper Motor

A stepper motor is a digital electrical device used in various electronics application for controlled and precise motion of various rotary devices. The step motor moves under the commands of digital instructions accurately, through a specific electronics control circuit. This is the unique functionality of a step motor. In brief, the step motors are electrical motors which are driven through the digital pulses in contrast to other motors where continuously voltage are applied to have motion. The pulse give to stepper motor is equal one step. The Two stepper motors are used in this project. One is for incoming gate and other is for outgoing gate. To step a motor in a particular direction a specific switching sequences need to be followed. There are two configurations of electric connections with stepper motor: 6-wire configuration and the second is 8-wire configuration. 

U-shaped Photo Sensors

The u-shaped photo sensor is a device has two main electronics components inside it which are emitting-light sources and the detectors. The LED and photo transistor or photo diode are mounted face-to-in the sensor. The collector of the phototransistor acts as an output pin, connected to microcontroller pins. If an object comes between the gap between the LED & photo transistor the light will be blocked. The logic level will be changed on the output of the sensor, indication the interruption. This condition generates required signal which will be read by microcontroller. 

Optocoupler U type sensor
U-shaped input Optocoupler sensor

Seven segment Display

The LED seven-segment display is used in many electronic devices to display useful information to the user of that device. The construction of the seven segments display is very simple as the 7 LEDs are combined into one casing to make a device for the displaying numbers from 0 to 9. The one wire of all the seven LED are kept common. Therefore, these are constructed in two ways, the common anode type or common cathode type. In common anode type display unit, the positive leg of each LED is made internally common and tied to Vcc, whereas the other negative legs are open for external interface. The assembly is reversed for common cathode type units. 

7 segment display
Common anode configuration Seven segment display

Serial Interfacing

The micro-controller is interfaced to the PC by serial port through ICL232 logic level converter. The personal computer and AT89C51 microcontroller are interfaced through RS-232 for serial communication. RS-232 Serial Communication The RS-232 is a serial communication standard which enables data to be transferred in serial form between two devices. The data is transmitted in serial bit stream from one device to another. The parameters specify an RS-232 link between two devices are usually the baud rate, data width, parity and stop bits and are described below. 

  • Baud rate: The baud rate is defined as the number of bits per second. The baud rate determines the quantity of information communicated in a unit time. It may in some where in range of 110 and 76800 bits per second. 
  • Data width: The data width of a byte can be either 8 bits or 7. 
  • Parity: The parity bit in serial communication is used to check the correctness of the transmitted or received data. Parity bit can be zero or one corresponds to even, odd.
  • Stop bits: The stop bit in serial communication is used as the terminator bit.

Serial data is transmitted and received in frames where a frame consists of: 1 start bit, 7 or 8 data bits, Optional parity bit, 1 stop bit. In many applications 10 bits are used to specify an RS-232 frame, consisting of 1 start bit, 8 data bits, no parity bit, and 1 stop bit. For Example, character ‘A’ has an ASCII bit pattern ‘01000001’ and is transmitted. Two types of connectors are used for RS232 communication. These are 25-way (known as DB25) and the 9-pin D-type connector (also known as DB9). 

  • SG: signal ground. This pin is used in all RS-232 cables for ground connection. 
  • RD: Received data. Data is received at this pin. This pin is used in all two-way communication.
  • TD: Transmit data. Data is sent out from this pin. This pin is used in all two-way communication. 
  • RTS: Request to send. This signal is asserted when the device requests data to be send. 
  • CTS: Clear to send. This signal is stated when the device is ready to accept data serially. 
  • DTR: data terminal ready. This signal is asserted to indicate the device is ready. 
  • DSR: Data set ready. This signal indicates, by the device at another end, that is ready. 
  • CD: Carrier detect. This CD shows that a carrier signal has been detected by a modem or device which is connected to the line. 

RS232 Signals Levels A voltage of +3 to+12 indicates an on state, while a voltage of -3 to -12 indicates an off stage. Standard TTL logic devices, including 89c51 microcontroller. Operate with TTL logic levels between the voltages of 0 and +5V. The Voltage level converter ICs convert the voltage levels between the TTL level and RS232 voltage levels. E.g. ICL-232, MAX-232 etc. 

The Hardware Description and Construction of electronics circuit boards

The whole system is consisting of some small electronics board separately developed to make clear understandings of working of system.

Stepper Motor Control Board 

The electronics circuit board to drive stepper motor is designed to handle up to four stepper motors. But the requirement of this project is only the two. Remaining the slot of two stepper motors can be used for the further modification in project. The port 0 of microcontroller is used to drive the above said two motors. The P0.0 to P0.3 drive one motor while P0.4 to P0.7 for second stepper motor. A TTL latch IC is used to latch the logic level of these port pins. The P3.5 is connected to enable of the latch. Figure below shows the complete circuit diagram of stepper motor driver board. An optocoupler is used to have electrical isolation between the motor controller board and the rest of electronics. The microcontroller AT89S51 actually determines the needs and then send the control signal to the stepper motor controller board for appropriate rotation of stepper motor with energizing coil of the stepper motor so that each step of it covers about 1.8 degree of rotation. The current of each motor coil is about 1Amp. There is a diode is used in parallel to the coil of stepper motor to prevent the damage of transistors with high back current due to change in emf of the coil. These diodes setup like this are often known as freewheeling diodes. 

Sensors Board:

This hardware unit or board has six photo sensors. The output pin of every sensor is connected to one pin of the controller. As shown in figure 08 sensors generate a high pulse as beam is cut by ant small object. Three sensors used to operate one motor. Port1 is dedicated to the sensors as shown in figure below. By cutting beam of sensor S1 Motor start rotating in clockwise direction, then cutting the beam of sensor S2 motor stops for some time then start rotating in counter clock wise direction. At the end-cutting beam of S3 motor stops. The second stepper motor will operate the sensors S4, S5 and S6 when operated as discussed earlier. 

Steper Motor Driver
Stepper Motor Controller and Opto Coupler input Board

Seven Segment Display Board:

 This hardware is used to display the number of cars in the parking lot. The display board has six-segment display units or digits on it. The segment driver IC named SN7447AN which is a TTL IC is used to drive the seven-segment digit along with a three to eight-line decoder to select the corresponding digit. The figure below shows the circuit diagram of the seven-segment board. The Port2 of the Microcontroller is use to operate the display board for appropriate digit display on the respective unit. Serial Interfacing Board The PC placed in the control room for the help of operator will display the useful information about the parking capacity of car parking space in real time. The Microcontroller have input data from sensor and have the basic information of parking which will be transmitted to PC through the use of serial communication as discussed earlier. The circuit diagram of the serial communication board is show along with the display board in figure below.

LED Seven Segment Display Driver and RS-232 serial communication Board

Software description of the project

As we have discussed the hardware of this project has four peripherals section interfaced with the microcontroller. Therefore, the whole software program written for this project for microcontroller At89s51 is consisting of four main routines to make system functional, the subroutines of the program are listed below: 

  • Stepper motor subroutine 
  • Optical Sensor subroutine 
  • Seven segment subroutine 
  • Serial interrupt subroutine 

Stepper Motor Subroutine 

The Port0 of the microcontroller is used for controlling the stepping sequence of stepper motors at the entry and exit gates of car parking system. The Lower Nibble of Port0 of MCU is used for controlling the stepper motor number 01 which is mounted and placed at the entry gate. The Upper Nibble of Port0 is used to control the stepper motor number 02 which is mounted and place at the exit gate. The bits of port0 of MCU are set and reset according to the stepping sequence of each motor as listed in program. There are total six control bits in this sub-routine in which the two control bits are used to select and initiate the operation of stepper motors at the entry or exit gate. The three control bits of the stepper motor has specific function, one bit is used to initiate or select the motor and remaining two bits are used to control the motion. It may be noted that the operation of stepper motors is directly related to the input from sensor which is interpreted in the MCU and execution is accordingly done by passing appropriate commands to motors. 

Optical Sensor Subroutine

Optical sensors are connected to the port1 of the microcontroller. These input signal from these sensors are bases for the suitable initiation to the stepper motor subroutine. Each sensor is installed at a special location for performing a desire task such as to detect a entering vehicle or leaving the parking space, to detect gate current position whether it is fully opened o fully closed or in between the opening and closing position through the implementation of limit switches. The system remains in waiting condition until one of the sensor is triggered by arrival of a car or leaving of any vehicle. The sensors are placed at the entry and exit points of parking area gates to detects the vehicles passing through each gate. The two sensors are used to detect opening limit of each gate and other two to detect closing limit of each gate. When an entry gate sensor give signal then the seven-segment display subroutine is called along with the serial interrupt subroutine. The display unit will update the current number of cars present in the parking area. The count will be incremented correspondingly with entry gate control bit set and reset sequence. When an exit gate sensor is triggered the corresponding control bit will be set and the seven-segment display subroutine will also be called along with the serial interrupt subroutine. This will update the current number of cars present in the parking area and will be display accordingly on local display unit as well as in the computer screen placed in control room for the use of operator. Similarly, the count will decrement in response of the exit gate control bit set and reset sequence. The open limit gate sensors turn the motor in reverse direction after a delay and the close limit gate sensor turns the motor off for entry and exit gate. 

Seven Segment Subroutine 

The Port2 of At89s51 is used for the interfacing of the display unit, the data on port2 will updates the seven-segment display every time the entry or exit gate sensor operates. 

Serial Interrupt Subroutine 

 A SERISR (serial interrupt service routine) is defined and used in the main program. The TxD @ P3.1 and RxD @ P3.0 are used in serial interfacing between PC and Microcontroller. The display of parking position on computer screen is updated serially on the operation of sensors as discussed earlier. The 9600 baud rate and mode 01 for serial interfacing is implemented in this project. Instantly we have used the “Labview” software for serial communication and presentation of display of parking project.

Assembly Language Program Listing For Microcontroller

;================================================
;==================BITS ASSIGNMENTS==============
;================================================
OLG1            REG             P1.0    ;OPEN LIMIT GATE1
CLG1            REG             P1.1    ;CLOSE LIMIT GATE1
G1IL              REG             P1.2    ;GATE1 INTERLOCK
OLG2            REG             P1.3    ;OPEN LIMIT GATE2
CLG2            REG             P1.4    ;CLOSE LIMIT GATE2
G2IL              REG             P1.5    ;GATE2 INTERLOCK
;==================
M1P1            REG             P0.0    ;MOTOR 01 PHASE 1            
M1P2            REG             P0.1    ;MOTOR 01 PHASE 2
M1P3            REG             P0.2    ;MOTOR 01 PHASE 3
M1P4            REG             P0.3    ;MOTOR 01 PHASE 4
M2P1            REG             P0.4    ;MOTOR 02 PHASE 1            
M2P2            REG             P0.5    ;MOTOR 02 PHASE 2
M2P3            REG             P0.6    ;MOTOR 02 PHASE 3
M2P4            REG             P0.7    ;MOTOR 02 PHASE 4
;==================
A_SSD           REG             P2.4
B_SSD           REG             P2.7
C_SSD           REG             P2.6
D_SSD           REG             P2.5
;==================
A_SEL           REG             P2.2
B_SEL           REG             P2.0
C_SEL           REG             P2.1
E_SEL           REG             P2.3
;==================
ENB             REG             P3.5    ;ENABLE 74LS245
BUZ             REG             P3.4    ;BUZZER
;================================================
;=================FLAG ASSIGNMENTS===============
;================================================
FLG1            REG             00H     ;BIT 0 OF 20H
FLG2            REG             01H     ;BIT 1 OF 20H
FLG3            REG             02H     ;BIT 2 OF 20H
FLG4            REG             03H     ;BIT 3 OF 20H
FLG5            REG             04H     ;BIT 4 OF 20H
FLG6            REG             05H     ;BIT 5 OF 20H
BINC            REG             06H     ;BIT 6 OF 20H
BDEC            REG             07H     ;BIT 7 OF 20H

B_0             REG             08H     ;BIT 0 OF 21H
B_1             REG             09H     ;BIT 1 OF 21H
B_2             REG             0AH     ;BIT 2 OF 21H
B_3             REG             0BH     ;BIT 3 OF 21H
B_4             REG             0CH     ;BIT 4 OF 21H
B_5             REG             0DH     ;BIT 5 OF 21H
B_6             REG             0EH     ;BIT 6 OF 21H
B_7             REG             0FH     ;BIT 7 OF 21H
;================================================
;================BYTE ASSIGNMENTS================
;================================================
OUTPRT          REG             P0      ;PORT ZERO
DISPRT            REG             P2
DATREG           EQU             21H
DLYREG1         EQU             30H
DLYREG2         EQU             31H
DLYREG3         EQU             32H
DLYREG4         EQU             33H
D_UNI               EQU             34H
D_TEN              EQU             35H
D_HUN             EQU             36H
CNTR                EQU             37H
DISPREG          EQU             38H
;================================================
;==================DIRECTIVES====================
;================================================
                ORG             00H     ;RESET
                LJMP            INI
                ORG             0BH
                LJMP            T0ISR
                ORG             23H
                LJMP            SERISR
                ORG             30H
;================================================
;===========INITIALIZATION ROUTINE===============
;================================================
INI:
                MOV             D_UNI,#00H
                MOV             D_TEN,#00H
                MOV             D_HUN,#00H
                MOV             OUTPRT,#00H
                CLR             ENB
                CLR             FLG1
                CLR             FLG2
                CLR             BUZ
                CLR             BINC
                CLR             BDEC
                CLR             E_SEL
                CLR             C_SEL
                MOV             DLYREG1,#FFH
                MOV             DLYREG2,#0FH
                MOV             DLYREG3,#FFH
                MOV             DLYREG4,#0FH
                MOV             TMOD,#21H       ;16 BIT TIMER MODE
                MOV             TL0,#DFH
                MOV             TH0,#B1H
                MOV             TH1,#-3
                MOV             SCON,#50H
                MOV             IE,#92H
                MOV             A,CNTR
                MOV             SBUF,A
                SETB            TR1
                SETB            TR0
;================================================
;================MAIN ROUTINE====================
;================================================
MAIN:
                CALL            INR_0    ;INPUT ROUTINE
                CALL            INR_1    ;
                CALL            INR_2
                CALL            INR_3
                CALL            M1R     ;MOTOR1 ROUTINE
                CALL            M2R
                CALL            IDR     ;INCREMENT/DECREMENT ROUTINE
                CALL            DIVR
                LJMP            MAIN
;================================================
;========INPUT ROUTINE 01 FOR FOR MOTOR 1========
;================================================
INR_0:
                JB              G1IL,INR1
                JB              FLG1,INR2
                RET
INR1:
                SETB            FLG1
                RET
INR2:
                JNB             FLG1,INREXT1
                DJNZ            DLYREG1,INREXT1
                DJNZ            DLYREG2,INREXT1
                SETB            BINC
                CLR             FLG1
INREXT1:
                RET
;================================================
;=========INPUT ROUTINE 02 FOR MOTOR 1===========
;================================================
INR_1:
                JB              OLG1,INR3
                JB              CLG1,INR4
                RET
INR3:
                SETB            FLG2
                CLR             FLG3
                RET
INR4:
                SETB            FLG3
                CLR             FLG2
                RET
;================================================
;========INPUT ROUTINE 01 FOR FOR MOTOR 2========
;================================================
INR_2:
                JB              G2IL,INR1_1
                JB              FLG4,INR2_2
                RET
INR1_1:
                SETB            FLG4
                RET
INR2_2:
                JNB             FLG4,INREXT2
                DJNZ            DLYREG3,INREXT2
                DJNZ            DLYREG4,INREXT2
                SETB            BDEC
                CLR             FLG4
INREXT2:
                RET
;================================================
;===========INPUT ROUTINE 02 FOR MOTOR 2=========
;================================================
INR_3:
                JB              OLG2,INR3_3
                JB              CLG2,INR4_4
                RET
INR3_3:
                SETB            FLG5
                CLR             FLG6
                RET
INR4_4:
                SETB            FLG6
                CLR             FLG5
                RET
;================================================
;===========MOTOR NUMBER 01 ROUTINE============
;================================================
M1R:
                JB              FLG1,M1R_1
                JB              FLG2,M1R_2
                RET
M1R_1:
                JNB             FLG2,M1R_3
                CLR             M1P1
                CLR             M1P2
                CLR             M1P3
                CLR             M1P4
                RET
M1R_3:
                CALL            M1CLK
                RET
M1R_2:
                JNB             FLG3,M1R_4
                CLR             M1P1
                CLR             M1P2
                CLR             M1P3
                CLR             M1P4
                RET
M1R_4:
                CALL            M1CCLK
                RET
;================================================
;======MOTOR NUMBER 01 CLOCK WISE==============
;================================================
M1CLK:
                SETB            M1P1
                CLR             M1P2
                CLR             M1P3
                CLR             M1P4

                CALL            DLYRM1

                CLR             M1P1
                SETB            M1P2
                CLR             M1P3
                CLR             M1P4

                CALL            DLYRM1

                CLR             M1P1
                CLR             M1P2
                SETB            M1P3
                CLR             M1P4

                CALL            DLYRM1

                CLR             M1P1
                CLR             M1P2
                CLR             M1P3
                SETB            M1P4

                CALL            DLYRM1

                CLR             M1P4
                RET
;================================================
;===MOTOR NUMBER 01 COUNTER CLOCK WISE========
;================================================
M1CCLK:
                SETB            M1P4
                CLR             M1P2
                CLR             M1P3
                CLR             M1P1

                CALL            DLYRM1

                CLR             M1P4
                SETB            M1P3
                CLR             M1P2
                CLR             M1P1

                CALL            DLYRM1

                CLR             M1P1
                CLR             M1P3
                SETB            M1P2
                CLR             M1P4

                CALL            DLYRM1

                CLR             M1P3
                CLR             M1P2
                CLR             M1P4
                SETB            M1P1

                CALL            DLYRM1

                CLR             M1P1
                RET
;================================================
;=================DELAY ROUTINE==================
;================================================
DLYRM1:
                MOV             R0,#0FH
W1:
                MOV             R1,#FFH
W2:
                
                DJNZ            R1,W2
                DJNZ            R0,W1
                RET
;================================================
;=========MOTOR NUMBER 02 ROUTINE==============
;================================================
M2R:
                JB              FLG4,M2R_1
                JB              FLG5,M2R_2
                RET
M2R_1:
                JNB             FLG5,M2R_3
                CLR             M2P1
                CLR             M2P2
                CLR             M2P3
                CLR             M2P4
                RET
M2R_3:
                CALL            M2CLK
                RET
M2R_2:
                JNB             FLG6,M2R_4
                CLR             M2P1
                CLR             M2P2
                CLR             M2P3
                CLR             M2P4
                RET
M2R_4:
                CALL            M2CCLK
                RET
;================================================
;========MOTOR NUMBER 02 CLOCK WISE============
;================================================
M2CLK:
                SETB            M2P1
                CLR             M2P2
                CLR             M2P3
                CLR             M2P4

                CALL            DLYRM2

                CLR             M2P1
                SETB            M2P2
                CLR             M2P3
                CLR             M2P4

                CALL            DLYRM2

                CLR             M2P1
                CLR             M2P2
                SETB            M2P3
                CLR             M2P4

                CALL            DLYRM2

                CLR             M2P1
                CLR             M2P2
                CLR             M2P3
                SETB            M2P4

                CALL            DLYRM2

                CLR             M2P4
                RET
;================================================
;=====MOTOR number 02 COUNTER CLOCK WISE========
;================================================
M2CCLK:
                SETB            M2P4
                CLR             M1P2
                CLR             M1P3
                CLR             M1P1

                CALL            DLYRM2

                CLR             M2P4
                SETB            M2P3
                CLR             M2P2
                CLR             M2P1

                CALL            DLYRM2

                CLR             M2P1
                CLR             M2P3
                SETB            M2P2
                CLR             M2P4

                CALL            DLYRM2

                CLR             M2P3
                CLR             M2P2
                CLR             M2P4
                SETB            M2P1

                CALL            DLYRM2

                CLR             M2P1
                RET
;================================================
;=================DELAY ROUTINE==================
;================================================
DLYRM2:
                MOV             R2,#0FH
W3:
                MOV             R3,#FFH
W4:
                
                DJNZ            R3,W4
                DJNZ            R2,W3
                RET
;================================================
;==========INCREMENT DECREMENT ROUTINE===========
;================================================
IDR:
                JB              BINC,IDR1
                JB              BDEC,IDR3
                RET
IDR1:
                MOV             A,CNTR
                CJNE            A,#FFH,IDR2
                MOV             CNTR,#FFH
                CLR             BINC
                RET
IDR2:
                INC             CNTR
                CLR             BINC
                RET
IDR3:
                MOV             A,CNTR
                CJNE            A,#00H,IDR4
                MOV             CNTR,00H
                CLR             BDEC
                RET
IDR4:
                DEC             CNTR
                CLR             BDEC
                RET
;================================================
;================DIVISION ROUTINE================
;================================================
DIVR:
                MOV             A,CNTR
                MOV             B,#0AH
                DIV             AB
                MOV             D_UNI,B

                MOV             B,#0AH
                DIV             AB
                MOV             D_TEN,B

                MOV             D_HUN,A
                RET
;================================================
;==============SERIAL INTR. ROUTINE==============
;================================================
T0ISR:
                PUSH            A
                CLR             TR0
                MOV             TL0,#DFH        ;20mSEC
                MOV             TH0,#B1H

                MOV             A,D_UNI   ;SEND THE UNIT PLACE NO.
                CALL            DSHIFT    ;TO ADJUST PIN CONFIG
                ANL             A,#F0H    ;TO SEND ONLY UPPER NIBBLE
                MOV             DISPRT,A  ;MOVE DATA TO P2
                SETB            A_SEL
                SETB            B_SEL     ;INITIALIZE UNIT PLACE SEG(3)
                CALL            DSPDLY    ;CALL DELAY

                MOV             A,D_TEN   ;SEND THE TENTH PLACE NO.
                CALL            DSHIFT
                ANL             A,#F0H
                MOV             DISPRT,A
                CLR             A_SEL
                SETB            B_SEL     ;INITIALIZE TENTH PLACE SEG(2)
                CALL            DSPDLY

                MOV             A,D_HUN   ;SEND THE HUNDREDTH PLACE NO.
                CALL            DSHIFT
                ANL             A,#F0H
                MOV             DISPRT,A
                SETB            A_SEL
                CLR             B_SEL
                CALL            DSPDLY
                CLR             A_SEL     ;INITIALIZE HUNDREDTH PLACE SEG(1)
                CLR             B_SEL
                POP             A
                SETB            TR0
                RETI
;================================================
;================DATA SHIFT ROUTINE==============
;================================================
DSHIFT:
                MOV             DATREG,A        ;21H=DATAREG
                MOV             C,B_0   
                MOV             B_4,C   
                MOV             C,B_1
                MOV             B_7,C
                MOV             C,B_2
                MOV             B_6,C
                MOV             C,B_3
                MOV             B_5,C
                MOV             A,DATREG
                RET
;================================================
;===================DISPLAY DLAY=================
;================================================
DSPDLY:
                MOV             R7,#FFH
DW1:
                DJNZ            R7,DW1
                RET
;================================================
;====================SERIAL INT.=================
;================================================
SERISR:
                PUSH            A
                JNB             TI,REC
                MOV             A,CNTR
                MOV             SBUF,A
                CLR             TI
                POP             A
                RETI
REC:
                JNB             RI,SEREXT
                CLR             RI
SEREXT:
                POP             A
                RETI
;================================================
                END
                

automatic gate control system pdf The microcontroller based automatic gate control is a better solution. automatic gate opening and closing system What are the examples of microcontroller based system? This system consists of a set of sensors connected to a stepper motor through an 8-bit microcontroller (AT89S52). What are the different designs of automated gates? automatic gate opening system project pdf Are microcontrollers used in control systems? Microcontroller based automate controller is a project design of a system that is used in operating a gate automatically. Can you make your own automatic gate? What is the use of logic gate in microcontroller? electric gate entry systems electric gate keypad wiring What is microcontroller based system design? CONSTRUCTION OF A MICROCONTROLLER BASED GATE motor for automatic sliding gate Microcontroller Based Bi-directional Vehicle Counter diy automatic sliding gate sliding gate electric Microcontroller based Automatic Railway Gate Control automatic gate opening and closing system electric gate wiring diagram What mechanism is used in automatic gates? sliding gate machine automatic sliding gate What are the components of an automatic gate? electric swing gates

Popular Post (All Time)