Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
21Activity
0 of .
Results for:
No results containing your search query
P. 1
Auto-Range Voltmeter with PIC Microcontroller and a SPI PGA

Auto-Range Voltmeter with PIC Microcontroller and a SPI PGA

Ratings: (0)|Views: 2,019 |Likes:
Published by Sahand Noorizadeh
Design and implementation of a 0-5 VDC auto-range voltmeter using a PI18F4321 MCU and a SPI programmable gain amplifier.
Design and implementation of a 0-5 VDC auto-range voltmeter using a PI18F4321 MCU and a SPI programmable gain amplifier.

More info:

Published by: Sahand Noorizadeh on Mar 16, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

07/20/2013

pdf

text

original

 
Embedded Microcontroller DesignFinal Project Report
December 2009
Auto-Range 0-5V Voltmeter
Ibrahim BarbourSahand Noorizadeh
 
1 Introduction
The PIC4321 MCU has a 10-bit analog-to-digital converter (ADC). The high and low referencevoltages of this MCU can be set to be either the MCU’s positive and ground supply voltage
V  
DD
and
V  
SS 
or an external voltage. This reference voltage determines the ADC’s resolution. Theresolution per bit of the 10-bit AD is given by (1).
Resolution
=
V  
+
REF 
V  
REF 
2
10
(1)To increase the resolution,
V  
+
REF 
V  
REF 
has to be made small but the minimum requirement for theexternal reference voltages of the PIC4321 MCU is
1.8 V 
which sets the resolution to
1.7 mV 
. Formeasuring small voltages less than
50 mV 
, this resolution will not provide accurate measurements.One other way to increase the ADC’s resolution is amplifying the input voltage to be comparablewith the reference voltages. This can be done with a Programmable Gain Amplifier (PGA) thatis controlled by the MCU. A PGA has a predefined set of gains that are set by the data it receivesfrom an external controller.In this project, Microchip’s
MCP6S28
, an 8-input SPI PGA, was used with PIC4321 to scanthe PGA’s output voltage with ADC to find an optimum PGA gain to measure the PGA’s inputvoltage in the
0-5V 
range and display the voltage and its unit (
or
mV 
) on a LCD.
2 Implementation
2.1 Circuit Set-Up
Figure 1 shows the circuit diagram of the circuit diagram of the auto-range voletmeter implementedwith a PIC4321 MCU and a MCP6S28 PGA. Of the 8 input channels of the PGA only
CH0 
wasused.
RB1
was used for the chip select digital signal. The input voltage was applied to
CH0 
and1
 
Figure 1: Circuit diagram of the 0-5V auto-range voltmeter
V0UT 
of the PGA was connected to the analog input
A0 
of the PIC for AD conversion. A 2x24Hitachi LCD which was connected to PIC to display the voltage and its unit.
2.2 Operation
MCP6S28 uses 16 bits of the SDI to either select a channel or set the gain. The first 8 bits arethe instruction bits followed by 8 bits of information. The 8-bit information are either the channelnumber or the gain index depending on the instruction in the first 8-bit. The gain index choosesgains that are predefined in MCP6S28 which are 1,2,4,5,8,10,16, or 32. Details of the timingdiagram can be found in the attached MCP6S28 datasheet.The PIC program that was written for this project, sends an 8-bit serial data to select
CH0 
itthen performs the scanning and optimization routine in a non-stop loop every half a second. Thescanning and optimization routine performs the following steps:1. starts with setting the PG’s gain to 12. reads the 16-bit ADRES register of the ADC3. if the value is above 490, then it multiplies ADRES by the gain and displays the value onthe LCD. If the value is less than or equal to 490 then it increases the gain and goes back tostep 2. If the value is 1024, then it decreased the gain and goes back to 2.2

Activity (21)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Vasi Vali liked this
Kreetha Traison liked this
luveve5 liked this
dmonking liked this
mah_krishan404 liked this
mah_krishan404 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->