MSP430 BASED 30V VOLT METER:
This is a simple application of internal 10-bit ADC(analog to digital converter) of MSP430G2231 microcontroller.you can use this circuit to measure up to 30 v dc.. the possible applications are on bench top power supply or as a panel meter in various system.
Overview of the project:
TEXAS INSTRUMENTS MSP430G2231 is the heart and brain of this circuit .the internal adc of the mcu with a resistor network voltage divider is used to measure the input voltage. Then 3 digest of comm anode 7 segment display is used to display final converted voltage. As you can see in the schematic the displays are multiplexed with each other. means we switch on one display and put the corresponding digit on this while other two displays are off this cycle go for each of the display.
the only problem with MSP430 mcu is there is very less I/O lines are available to use so we need 7 +3 lines to drive the display and maybe one more pin for adc input (if adc input is not multiplexed with other pin) total 10to11 lines are required but we don't have that much lines from mcu so we have to use 74LS47 bcd to 7segment decoder ic which enable us to display any digit with only 4 i/o lines instead of 7 lines so now we require only 4+3+1 lines total 8 lines. in this circuit the refresh rate is about 50hz.
Voltage Divider Front End
as you can seen in the schematic the 82k resistor and 10 k trim pot is connected ias a voltage divider configuration .we all know very well that by default MSP430 microcontroller ADC reference voltage can be set to 2.5 volts internal reference . so what we have to do is make such voltage divider that can divide out maximum range 30 volts to 2.5 volts . so we need is Vin/12 ==> 30/12 =2.5v voltage divider . and to keep as less as possible attenuation on the under test voltage we have to keep the voltage divider resistor value in few thousand ohms because it takes very little current from the target but as much to drive adc of MSP430.
10bit adc resolution we get 1023 maximum count
with 2.5 v reference we get 2.5/1023 = 0.0024437 V/Count
means if the adc count is 188 then input voltage is 188 * 0.0024437== 0.459 volts
But now with the voltage divider the maximum voltage is 30v so the calculations Will be 30/1023= 0.02932 volts/count
if now we get 188 then 188*0.02932==5.5 Volts
you can also increase or decrease the range by changing resistor network and the calculations a little bit.
the capacitor 0.1uf makes the adc input a bit stable because 10bit adc is really sensitive . the 2.7v zener will provide over votage protection to the internal adc because it wont allow voltage more than 2.7v.
Accuracy and calibration
Overall accuracy of this circuit is great but it totally depends on the values of 82K resistor and 10k trim pot . as fine as you can go by adjustment of the trim pot your accuracy goes fine.
calibration of this circuit is done by adjustment of the 10k trimpot around value of 7.45k or so . all you have to do is take any standard power like 5v or 12v and apply that to the input of the resistor network and adjust the trimpot until you get correct value on the display
Software Sorce code and Firmware
the sotware is written in c and complied ti ccs 5.1 studio.
Code Composer Studio is an integrated development environment for developing applications for Texas Instruments embedded processors. Texas Instruments embedded processors include DSPs, ARM based devices and other processors such as MSP430. Code Composer Studio includes a real time operating system called DSP/BIOS or SYS/BIOS. Code Composer Studio or CCS includes support for OS level application debug as well as low-level JTAG based development. CCS is based on the Eclipse open source software framework. Code Composer Studio...