Analog-to-digital conversion (ADC) PIC | Anna university questions papers projects for EEE,ECE,IT,MECHANICAL,MBA,MCA Anna university questions papers projects for EEE,ECE,IT,MECHANICAL,MBA,MCA: Analog-to-digital conversion (ADC) PIC Bank Exam question paper, GATE Papers,Combined Defence Service Examination papers ,TANCET,BSNL JTO,ISRO,EBOOKS,DRDO ,BARC, , NTPC ,BHEL ,BEL ,HAL,Anna University Papers,ECE , EEE , CSE , IT , Mech , BIOMEDICAL , Textile , MBA , MCA , Anna University Question Bank , Anna University Syllabus , Anna University 'Q' Papers , Gate Papers , 8051, AVR, 8051 projects, free 8051 microcontroller projects, AVR projects, AVR tutorial, AVR microcontroller projects, circuits, hobby electronics, microcontroller based projects, microcontroller projects, final year projects, electronic projects, electronics projects, circuit diagrams, pin diagram, pin description, interfacing with AT89C51, 8051 tutorials, embedded projects, serial port, sensor, Electronic Components, Electronic Circuits, circuits for hobbyist, electronic schematics, DIY projects, breadboard circuits, at89c51, 8051 code, advanced circuits, hobby projects, circuit ideas, embedded system, embedded C, microcontroller programming in C, LCD interfacing, ADC interfacing, circuit components, hobby circuits, seven segment display, 89c51 projects, circuit description, major projects, minor projects, projects for circuit branches, interrupt, 8051 programming, RS232, 8 bit microcontroller,Microcontroller Tutorials, PIC Tutorial, 8051 Microcontroller Tutorial Resource, Connect to the PIC, PIC Tutorials, Micro Controller Tutorials, PIC Micro controller Tutorial Resource, DALLAS 80C320, DS80C320, Connect to the PIC, PIC Tutorials, Dallas DS80C320, 8051 Introduction, Types of Memory, Special Function Registers, Basic Registers, Addressing Modes, Program Flow, Low Level Information, 8051 Timers, 8051 Serial Port Operations, 8051 Interrupts, Additional Features of 8052, 8052 Instruction Set, Computer Science Seminar Topics, Mechanical Engineering Seminar Topics,Electrical Seminar Topics,Electronics Seminar Topics,Seminar Abstract And Report Downloads,High-Speed Architecture, New Instruction Speed, Variable Length MOVX Instruction, Timer Considerations, Dual Data Pointer, Watchdog Kicking, The Watchdog Watchdog Interrupt, Watchdog System Resets, Power Failure Functions, Power Failure Reset, Power Failure Interrupt, Secondary Serial Port, Timed Access Protection, PIC16F877A Tutorial, Introduction to the PIC16F877A, How to hook up the PIC so it will run?, What do the pins mean?, How to program the PIC?, Miscellaneous Advice, LED Blinker, Photoresistor Input, Analog Input (Photoresistor, Sonar sensor, IR sensor, Digital Input (Switches), Output messages to computer screen, Servo Motor Output, DC Motor Output,Gate sample paper with solution , Engineering E-Books , Free ebook websites , Final Year Projects , Placement papers,anna university previous year question bank, previous year question paper,model question paper, two mark question paper,sex,adult,results,atmel humidity Assembly Language code, Digital Clock Employing Memory Mapping, Humidity Sensing, Microcontroller51,control solid state relays, decoded 74ls138, latech 73ls373, port expander, Solid State Relays,urn ON, turn OFF, Relay Driver, back EMF, holding, current, pullup, resistor, coil, BC547, ULN2003, ULN2803, npn, transistor, microcontroller, Technology, circuit,bharathidasan university,university,thanjavur,madurai,coimbatore,chennai,adult,porn,sastra,sastra university, placement and training cell,java,j2ee,ajax,c,c++,oracle,COMPUTER SCIENCE,embedded, embedded systems, j2ee, dotnet, j2me, dot net, jsp, vb, c#, c, c sharp, computer science, cse, information technology, it, Electrical, Electronics, communication,SURVEY,ONLINE JOB,PAY TO CLICK,SEBOSA, ece, eee, academic, college, instrumentation, control, control systems, best ,project centers, project centres, company, companies, software, telecommunication, telecom, networking, matlab, robotics, Artificial intelligence, automation, cloud computing, cryptography, data mining, dsp, database, digital, image processing, fuzzy logic, gsm, gps, gprs, mobile computing, networks, network security, php, power, systems, vlsi, hardware, web services, wireless, rf, rfid, microcontroller, ns2, 2010, titles, list, download, latest, free, advanced, low cost, placement, zigbee, Chennai, india, uk, SOFTWARE ENGINEERING, APPLIED ELECTRONICS, VLSI Design, M.E,EMBEDDED SYSTEMS, COMMUNICATION SYSTEMS,Memory Organization, Microcontroller to LCD, moving message display using 8051 microcontroller, MOVING MESSAGE DISPLAY USING ATMEL 89C51, PIN Configuration, Programming Aspects, POWER ELECTRONICS, 89c51, 89s51 moving message display board, microcontroller 8051,8051, AVR, 8051 projects, 8051 microcontroller projects, AVR projects, AVR tutorial, AVR microcontroller projects, electronics projects, free electronic circuits, circuit diagrams, circuits, schematics, hobby electronic projects, electronic projects, hobby electronic circuit diagram, final year projects, embedded projects, technical articles. Interfacing microcontroller 8051 with peripherals like ADC, LCD, EEPROM,solenoid valve atmel dc control triac,dimmer bt138,uln2003 microcontroleur interfacing a microprocessor to a power thyristor microcontrol based level mesurement 89c51 as pwm controller,at89c2051 sine wave pwm,8051 lift, circuit design for a elevator, Elevator Lift control for three stories with microcontroller 8051, microcontroller based lift controller for three stories, three stories lift,ericsson at command microcontroller, GSM/ EDGE Modem in PCI Interface, Interface of mobile phone with micro-controller, Supporting AT commands,embedded projects,8051,pic,arm,pic16f877a,qualifity,best project in thanjavur,relay design,product manufuring,dvd,vcd,service,free training,electrical and electronic circuits,pcb board design,help of embedded,earn money with embedded,part time job,home based job,vacancy,ieee transaction,optimization,website design,university, Chapter 2 Liquid Crystal Display, Character Generator RAM, DDRAM or CGRAM, Display on or off control, LCD, microcontroller interface with LCD, PIN Configuration, Pressure monitoring with microcontroller 8051, Pressure sensing and controlling, Pressure Sensing System, Programmable Peripheral Interface, RS-232 serial communication,diploma in embedded,matlab in thanjavur, seo,site design @2900 onwards, 8255 and RS232, 89s51 LCD display LM 35 ADC0804 measurment, construction of a pressure sensing system using 8051, designed pressure sensor and transducer,microcontroller based heart rate meter,8051 pin diagram,invention heart rate meter,heart meter watch,heart beat monitor project,8051,AVR,8051 projects,free 8051 microcontroller projects,AVR projects,AVR tutorial,AVR microcontroller projects,circuits,hobby electronics,microcontroller based projects,microcontroller projects,final year projects,electronic projects,electronics projects,circuit diagrams,pin diagram,pin description,interfacing with AT89C51,8051 tutorials,embedded projects,serial port,sensor,Electronic Components,Electronic Circuits,circuits for hobbyist,electronic schematics,DIY projects,breadboard circuits,at89c51,8051 code,advanced circuits,hobby projects,circuit ideas,embedded system,embedded C,microcontroller programming in C,LCD interfacing,ADC interfacing,circuit components,hobby circuits,seven segment display,89c51 projects,circuit description,major projects,minor projects,projects for circuit branches,interrupt,8051 programming,RS232,8 bit microcontroller,microcontroller based heart beat monitor,8051 isp programmer,heartbeat monitor and display on LCD,heart beat rate monitor with sensor,training heart rate monitor with comaprators ans sensor,8051 microcontroller application,optocoupler based sensor of runner heart rate monitor,how to measure heart beat, calculate heartbeat just in one second,8051 rtos,limitations of heart rate monitors, quick display of heart monitor,advantages of electronic medical records,electronic medical billing,used electronic test equipment,electronic document management solution,fetal heart rate monitor,wrist heart rate monitor,avr 8051,baby heart monitor,heart beat counter using microcontroller 8051, block diagram for ir led and ldr based heartbeat monitor with display on computer, MICROCONTROLLER AT89C2051 BASED HEART BEAT MONITOR (PULSE RATE wth assembly code),ir led and ldr based heartbeat monitor with display on computer,wireless biomedical monitoring system using 89S52 microcontroller,wireless biomedical monitoring system using 89S52 microcontroller,8051microcontroller based heart beat monitor,heart pulse system project,very cheap cost in india,lm35,temperature sensor,heart beat sensor,technology,solutions,sastra university,data base design,speed ,innovative centre,home security system model design, water level indicator for home,COMPUTER SCIENCE, SOFTWARE ENGINEERING, APPLIED ELECTRONICS, VLSI Design,IEEE Project center, IEEE 2010 Projects in Tanjore, trichy, Kumbakonam, Pudukkottai, Ariyalur, Pattukkottai, Best IEEE Projects, final year projects, Project Center in Trichy, Project Company in thanjavur, Project training @ tanjore, Free 8051 Microcontroller projects,8052 projects,microcontroller,projects, Datasheers,circuit diagram,Microcontroller,8051,AVR,8085 Microprocessor,BASCOM,projects,tutorials,codes,Libraries,interfacing examples,embedded projects,serial port,infrared remote controls,rf remote controls,home automation,Intel 8051 microcontroller,electronic projects,embedded systems,control systems,computers,technical books,software,assembly language,programming intels 8051,serial communications,rs232,Electronics Projects,Books,Home Automation,Computer Software,Assemblers,Compilers,applications Programming,Embedded Systems Design,8052,AT89C2051,robotics applications,visualbasic, Microsoft Visual Basic,system, based, solar, control, intelligent, motor, controller, vehicle, monitoring, pwm, detection, home, temperature, tracking, alert, blind, alcohol, automated, automatic, close,Robotics,Kits,Circuit Examples,8051,Robots,micro Code,AT89c51, Programmer,IEEE 2010 embedded systems, embedded programming, PIC Micro projects, Microchip Programming, AVR tutorials, PIC Micro tutorials, ATMEL, Microcontrollers based systems, Microcontroller Projects, Embedded projects, Embedded designing in C, Microchip Lab, Embedded systems tips, DIY Electronics,Project Detail,onlinejob, Data Entry, no fee, no investment, part time, home based,recuirements,job,consultancy,helpline,maths,power,ultimate knowledge,prodigy,trichy,mobile
100% FAT LOSS TIPS Click Here!

Analog-to-digital conversion (ADC) PIC

, Posted by ADMIN at 11:07 AM

Description

Analog-to-digital conversion (ADC) is necessary because, while embedded systems deal with digital values, their surroundings typically involve many analog signals such as, temperature, speed, pressure, the output of a microphone, etc. They all need to be converted into digital data before being processed by the microcontroller. Today, we will see how to read an external analog signal using a PIC16F688 microcontroller, and display the conversion output (a digital number) on a LCD. The input analog signal will be a varying voltage between 0-5V derived using a potentiometer.

Required Theory

The PIC16F688 microcontroller has a built-in 10-bit ADC with eight input channels. The eight channels are available at RA0, RA1, RA2, RA4, RC0, RC1, RC2, and RC3. They have alternate labels, AN0-AN7, for this function, and are multiplexed into a single Sample and Hold circuit. The output of the Sample and Hold is connected to the input of the A/D converter. The 10-bit conversion result is stored  into the ADC result registers ADRESH (A/D Result Higher byte) and ADRESL (A/D Result Lower byte). Each of these registers is 8-bit. The functionality of the A/D module is controlled by three registers: ANSEL, ADCON0, and ADCON1. The details of these control registers are discussed in ADC channels in PIC16F688.

Circuit Diagram

The test circuit to demonstrate the 10-bit A/D conversion using PIC16F688 is shown below. The test input voltage for ADC is derived from a 5K potentiometer connected across the +5V power supply, and is connected to RA2/AN2 pin of PIC16F688. The supply voltage (+5V) is chosen as the reference voltage for A/D conversion. Therefore, the 10-bit ADC will convert any analog voltage between 0-5V to a digital number ranging from 0-1023. The number will be displayed on the LCD.

This circuit diagram is not much different from the one for our previous lab (Lab 4: Interfacing a character LCD), except it has a 5K potentiometer for generating test analog voltage for ADC operation.

Circuit diagram

Circuit setup on breadboard

Circuit setup using the PIC16F688 breadboard module

Software

The programming involves configuring ANSEL, ADCON0, and ADCON1 registers. Since RA2/AN2 is used as analog input, the corresponding ANSEL bit must be set. In ADCON0 register, set CHS1 and clear CHS0 and CHS2, so that the AN2 channel will be connected to the internal Sample and Hold circuit. Clearing the VCFG bit in ADCON0 will select the supply voltage (+5V) as the reference voltage for A/D conversion. The ADCON1 register is used to select the clock source for A/D conversion. However, the MikroC Pro for PIC has got a built-in library function named ADC_Read() that, by default, uses the internal RC clock for ADC operation. So you don't need to initialize the ADCON1 register. The complete program is given below.

/*
 Lab 5: Analog-to-digital converter
 Internal Oscillator @ 4MHz, MCLR Enabled, PWRT Enabled, WDT OFF
 Copyright @ Rajendra Bhatt
 October 10, 2010
*/
// LCD module connections
 sbit LCD_RS at RC4_bit;
 sbit LCD_EN at RC5_bit;
 sbit LCD_D4 at RC0_bit;
 sbit LCD_D5 at RC1_bit;
 sbit LCD_D6 at RC2_bit;
 sbit LCD_D7 at RC3_bit;
 sbit LCD_RS_Direction at TRISC4_bit;
 sbit LCD_EN_Direction at TRISC5_bit;
 sbit LCD_D4_Direction at TRISC0_bit;
 sbit LCD_D5_Direction at TRISC1_bit;
 sbit LCD_D6_Direction at TRISC2_bit;
 sbit LCD_D7_Direction at TRISC3_bit;
// End LCD module connections
// Define Messages
 char message1[] = "ADC Value= ";
 char *temp = "0000";
 unsigned int ADC_Value;
 void main() {
  ANSEL = 0b00000100; // RA2/AN2 is analog input
  ADCON0 = 0b00001000; // Analog channel select @ AN2
  CMCON0 = 0x07 ; // Disbale comparators
  TRISC = 0b00000000; // PORTC All Outputs
  TRISA = 0b00001100; // PORTA All Outputs, Except RA3 and RA2
  Lcd_Init();                      // Initialize LCD

  Lcd_Cmd(_LCD_CLEAR);             // CLEAR display
  Lcd_Cmd(_LCD_CURSOR_OFF);        // Cursor off
  Lcd_Out(1,1,message1);           // Write message1 in 1st row
  do {
   adc_value = ADC_Read(2);
   temp[0] = adc_value/1000 + 48; // Add 48 to get the ASCII character value
   temp[1] = (adc_value/100)%10 + 48;
   temp[2] = (adc_value/10)%10 + 48;
   temp[3] = adc_value%10 + 48;
   Lcd_Out(1,11,temp);
   Delay_ms(2000);
  } while(1);
 }
Download HEX file

Loading the HEX file with my handy iCP01 PIC programmer.

Output

Vary the potentiometer and you will see the 10-bit conversion result also vary proportionally from 0- 1023.


--
With Regards,

s.m.sethupathy,
sms communication,
Tanjore -1.

mobile :9944 186 173           
      www.questionpaperlink.co.cc
      www.sethu-panguvarthagam.blogspot.com





Currently have 0 comments: