You are on page 1of 25

Smart Battery System Monitor By

Jason Hoban David Atwood

ECE 445, SENIOR DESIGN PROJECT SPRING 2009

TA: Paul Rancuret

May 5, 2009 Project No. 3

ABSTRACT This paper explains the design and verification of our battery monitoring system. This system is intended to provide real time status of a twelve volt lead-acid battery used by automobiles. The in car device displays the voltage of the battery and the battery life remaining on an LCD. Based on the data obtained, once the voltage drops below a critical level, this system will automatically turn off the power draining loads and send an alert wirelessly to a portable receiver for the user. The user then has a simple one pushbutton reset to re-enable the loads when prepared to start the car. This systems intended application is monitoring in the event of forgetting to turn off the headlights or if the user intends to use the vehicle for outdoor activities.

ii

TABLE OF CONTENTS 1. INTRODUCTION ...............................................................................................................1 1.1 Specifications.................................................................................................................1 1.2 Subprojects ....................................................................................................................1 1.2.1 Transmitting Unit ..................................................................................................2 1.2.2 Receiving Unit ......................................................................................................2 DESIGN PROCEDURE ......................................................................................................3 2.1 Transmitting Unit...........................................................................................................3 2.1.1 Microcontroller .....................................................................................................3 2.1.2 Battery ..................................................................................................................3 2.1.3 Monitoring Circuitry .............................................................................................4 2.1.4 Voltage Regulation................................................................................................4 2.1.5 Interrupt ................................................................................................................4 2.1.6 Display..................................................................................................................4 2.1.7 Transmitter............................................................................................................5 2.2 Receiving Unit ...............................................................................................................5 2.2.1 Receiver ................................................................................................................5 2.2.2 Voltage Regulation................................................................................................5 2.2.3 Buzzer...................................................................................................................5 DESIGN DETAILS .............................................................................................................6 3.1 Transmitting Unit...........................................................................................................6 3.1.1 Microcontroller .....................................................................................................6 3.1.2 Monitoring Circuitry .............................................................................................7 3.1.2.1 Current Sense ............................................................................................7 3.1.2.2 Voltage Monitor ........................................................................................8 3.1.3 Voltage Regulation................................................................................................9 3.1.4 Interrupt ................................................................................................................9 3.1.4.1 Switch .......................................................................................................9 3.1.4.2 Pushbutton and Buzzer ............................................................................ 10 3.1.5 Display................................................................................................................ 11 3.1.6 Transmitter.......................................................................................................... 11 3.2 Receiving Unit ............................................................................................................. 11 3.2.1 Receiver .............................................................................................................. 11 3.2.2 Voltage Regulation.............................................................................................. 12 3.2.3 Buzzer Set-up...................................................................................................... 12 DESIGN VERIFICATION ................................................................................................ 13 4.1 DC-DC Tests................................................................................................................ 13 4.2 Microcontroller ADC Tests .......................................................................................... 13 4.3 Voltage Monitor Tests.................................................................................................. 14 4.4 Current Sense Tests...................................................................................................... 14 4.5 BJT Switch Tests ......................................................................................................... 15 4.6 TX/RX Tests ................................................................................................................ 16 4.7 Power Consumption Tests ............................................................................................ 17 4.8 Temperature................................................................................................................. 17 iii

2.

3.

4.

5.

COST ANALYSIS............................................................................................................. 19 5.1 Parts............................................................................................................................. 19 5.2 Labor ........................................................................................................................... 19 CONCLUSIONS ............................................................................................................... 20 REFERENCES .................................................................................................................. 21 APPENDIX A PARTS AND COST.............................................................................. A.1 APPENDIX B PRODUCT PHOTOS ............................................................................ A.3

6.

iv

1. INTRODUCTION The purpose of our device is to monitor the charge time remaining of lead-acid automobile battery. The system will display the voltage and time remaining on an on-board LCD screen. The device is also intended to prevent the battery drain from reaching a critical level. A built in switching unit will cut off external drains on the battery when the battery level reaches a pre-determined level. The device will sound an alarm both in car and on a portable device by means of wireless communication. The user would then be able to restart the car after resetting the device with a one-push reset button. This device would therefore be a means to prevent draining the car battery to a degree that would prevent the user from being able to restart the engine. This is designed to not impose significant power consumption on the battery. The receiving device is small enough that the driver may keep it on their person at all times. 1.1 Specifications The design specifications detailed in our design review were: Voltage level readout accurate to within 0.1 volts of actual battery terminal voltage Accuracy in operating temperatures from 0F to 100F Transmission range of wireless alert system up to 100 yards Battery charge time remaining calculation accuracy to within 5 minutes

The first design specification was met. The voltage readout on the LCD was always accurate to within plus/minus 0.1 volts when compared to a multimeter reading across the battery terminals. The second design specification is met when considering our selection of components with regards to their temperature ratings except for the transmission and receiving components. Therefore, a solution to this issue would need to be found before this specification could be claimed as being met. The transmission range specification was not met because our final device did not have a working transmission and receiving system. The battery charge time remaining was accurate to within a half hour. This however was due less in part to our systems accuracy and more to the equation used to determine time remaining. This will be explained further in section 4.2 1.2 Subprojects The overall system was composed of two major subsystems: the receiving unit and the transmitting unit. This system is shown below in Figure 1.1

Figure 1.1 System Block Diagram 1.2.1 Transmitting Unit The transmitting unit is a device that is placed in car and contains the microcontroller and the monitoring circuitry. This unit also has a buzzer for an audio alert, a switch to cut off the automobiles loads, an LCD display, a push button for reset, and all necessary voltage regulation. 1.2.2 Receiving Unit The receiving unit is a portable device that consists solely of the receiver, battery supply, and a buzzer set-up for audio alert.

2. DESIGN PROCEDURE 2.1 Transmitting Unit The placement of our components within the overall vehicle system is important. Our sense resistor is in series and the first component the battery sees. This is to ensure all the battery current (except ignition current) passes through this resistor for accurate measurements. Our monitoring circuitry must not be shut off when the switch turns off the car loads. These components are needed to reactivate the switch and turn the loads back on. This general setup is shown in figure 2.1.

Figure 2.1 High Level System Diagram 2.1.1 Microcontroller As our design should not impose significant power consumption on the battery system, we chose one of the TI MSP430 family of microcontrollers. This line of microcontrollers is marketed for ultra-low power consumption. Based on a list of our projects I/O needs we narrowed the choice to the MSP430F156. This 64 pin chip has several analog to digital channels and a digital to analog port. In addition it has enough digital I/O pins to handle the rest of our design. 2.1.2 Battery We chose a battery from the senior design lab to simulate the car battery. It is a 12 volt lead-acid battery, just as one found in an automobile. The only significant difference is the amp hour rating is significantly less than a commercial car battery. This lower amp hour rating is to our benefit for testing purposes. The amp hour value is the amount of current draw at 12 volts that would deplete the battery in one hour. This allowed us to run tests near our systems critical level and charge it again in a reasonable time period. To charge the battery, we used the Agilent E3631A power supply set at 13.5 volts and 0.8 amps. This is safe by the recommendation of Professor Philip Krein to limit the current to 20 percent of the amp hour rating. We also placed a 3 amp rated diode in series with the positive terminal to prevent backfeed. Research into car batteries has shown that in general a battery is fully charged at 12.6 and fully depleted at 10.5 V. We chose 11 V as the critical voltage to preserve 25% of the battery capacity. 3

2.1.3 Monitoring Circuitry The monitoring circuitry consists of two separate parts. One part of the system was meant to monitor the batterys voltage and another was needed to monitor the batterys current. Both of these values are needed in order to determine a charge time remaining value for the battery. The current sensing module consists of an LTC6101 IC. This chip is a high voltage, high side current sense module the records the voltage across a negligibly small precision resistor and steps the value up by means of an internal opamp so that a voltage value can be read by the MSPs ADC. The voltage monitoring device was initially chosen to be a MAX6652 System Monitor that would convert the batterys voltage using an onboard ADC and output the data digitally across a serial I2C line to the MSP. This design was eventually abandoned in-favor of a differential op-amp configuration which stepped down the voltage from the battery linearly so that this value could also be read by the MSPs ADC input. This design choice was due mostly in part to challenges involving the I2C code protocol. An explanation into this change is detailed in section 3.1.2.2 2.1.4 Voltage Regulation The voltage regulation circuitry is used to step-down the batteries ~12 V source to values necessary to power the rest of the systems components. This is done with two LM317 3-terminal adjustable regulators to convert the DC source down to 5 V and 3.3 V. The five volt supply is used to power the LCD screen and the 3.3V supply is used to power the MSP, the transmitter, and the buzzer. The transmitter was designed to take a 2.1-4 V input while the MSP430 is intended to have a DC input of 2.2-3.6 V so 3.3 V was selected to meet both of these requirements. The LCD screen is specified to take a supply voltage of 5 V. 2.1.5 Interrupt This component will shut off the car loads that are draining the battery power. We chose to control these loads with a transistor. The transistor is placed in series between the car loads and the negative terminal of the battery. It will see all of the current of the system so when the microcontroller turns it off, the car loads are shut off. Design consideration for the choice of this transistor requires careful observation of the device ratings. It needs to be able to operate with at least 12 volts across it and 10 amps conducting through it. We chose the NTE2598 NPN BJT rated at 25 A continuous collector current and 800 V collector-emitter voltage. In order for this to be an effective solution, this transistor needs to be operated in the saturation region so that minimal power is dissipated when conducting. If our system shuts off this switch and therefore the car loads, the user presses a push button to reset and regain control of the system. To achieve an accurate read of the button press, we implemented a debouncing circuit. A button press brings together two metal contacts to form a path for current to flow. Since this is a mechanical procedure there is some bounce as the contacts are pressed together. To eliminate the error this bounce might cause the MSP to read, a simple RC circuit is added. 2.1.6 Display A display is necessary to inform the user of the current status of the battery. The purpose of this display should be kept as simple as possible to maintain our non-intrusive design. The pertinent information is the voltage of the battery and our calculation of time remaining given current usage. We used a 2x16 4

character display available in the lab. Initial research into this parts datasheets indicated a parallel data communication. We discovered that a microcontroller serial backpack was installed to modify communication to the serial protocol of RS-232. Utilizing serial communication as opposed to parallel allowed for a smaller microcontroller with regards to the number of I/O ports needed. 2.1.7 Transmitter The purpose of our transmission is to alert the user if their battery reached critical level and our switch system was activated. The only data needed to be communicated is an on/off signal for the buzzer on the receiving end. 2.2 Receiving Unit The goal of this component was to alert the user if they are away from the vehicle and the battery was switched off. Our original design had a buzzer for alert, a display for battery status and a microcontroller to operate it. We refined that design to keep this component as small as possible with the intention of a keychain sized receiver. We believed by keeping it smaller and lower power consuming, this becomes a more market viable product. 2.2.1 Receiver The receiving unit simply acts to receive the signal from the transmitter and output the square wave to activate the buzzer alert. 2.2.2 Voltage Regulation Since this will be a portable unit, we power it with 3 small button cell batteries. These are 3 V batteries, so we need to step this 9 V down to 5 V for the receiving device. The same voltage regulation device utilized on the transmitting unit was adequate for this as well. 2.2.3 Buzzer This serves as the user alert. A piezoelectric buzzer that can be operated at low voltages will be activated by the receiver chip.

3. DESIGN DETAILS 3.1 Transmitting Unit 3.1.1 Microcontroller The MSP430F156 microcontroller processes all the information collected from the rest of the system and determines the status of the battery and if any action needs to be taken. The 12 bit A/D conversion channels are used to read 2 separate voltages from the monitoring circuitry and determine with software the voltage of the battery and its current output. It then performs the time remaining calculation and outputs that to the LCD using the MSPs UART (universal asynchronous receiver/transmitter) protocol. If it detects the battery voltage is below 11 volts, the MSP performs a series of tasks, then waits for the user input. A software flow detailing these actions can be seen in figure 3.1.

Sample Voltage Sample Current


NO

Time Remaining Calculations Display to LCD Check if Below Threshold

YES

YES

Clear LCD Turn Off Load Switch Send TX

Sound Alarm Wait for Pushbutton


NO

Figure 3.1 Software Flow Diagram The A/D capability of the chip samples the input then compares it to a reference voltage. The reference voltage is software selectable and can be AVcc (the supply voltage), 2.5 V internal, 1.5 V internal, or an 6

external source. Using the 2.5 V internal reference gives a more accurate read than the Vcc reference because there could be some fluctuation in the supply voltage. The 2.5 V internal reference will not vary with fluctuating supply. The A/D module samples it with twelve bit precision. The value read from the appropriate register is a number ranging from 0 to 4095. This value along with the reference voltage determines the analog voltage seen by the MSP430.
V= Register Value *VREF 4095

(3.1)

The D/A port allowed us to precisely control the biasing voltage of the solid state switch set-up. This uses the same reference as the A/D. To generate the signal to be sent to the remote buzzer, we toggled an I/O port. Knowing the system clock is approximately 1 MHz, the XOR function is applied to the value of the pin in a repeating loop with a software delay designed to create a certain frequency. The value of the frequency chosen is explained in section 3.2.3. A while loop decrementing a counter creates the delay. The value of this counter is estimated given the system clock speed and how many instructions are executed but testing is necessary to determine the precise frequency produced. Implementation of these features was completed using software provided by TI and the MSPFET430U64. This FET (Flash Emulation Tool) hardware was donated by TI. This small board provides a clamshell socket for our LQFP package microcontroller and ports accessible to every pin. This board interfaced our device with a computer via JTAG protocol which was converted through another supplied hardware component to a computer USB port. The code to program this microcontroller was written in C using IAR Workbench software available from TI and flashed to the device via the JTAG communication. IAR Workbench also allowed for in system debugging. 3.1.2 Monitoring Circuitry 3.1.2.1 Current Sense The schematic of the current sense module is shown in Figure 3.2

Figure 3.2 Current Sense Schematic 7

The current sense unit consists of the LTC 6101 with an external precision sense resistor and an external gain configuration. The current sense resistor is a 2 W rated 0.005 ohm resistor with a precision of +/1%. With this rating the sense resistor can handle 20 amps which is an ample amount for our requirements. The sense resistor is placed immediately following the output of the batterys positive terminal which forces all of the batterys current to pass through this resistor allowing for the most accurate measurement. The voltage drop across this resistor (which is negligible due to the small resistance value) is then stepped up using an external gain configuration along with the LTC6101s opamp. This output voltage is then read by the MSP using an A/D input. The load current from this voltage is determined by equation (3.1)

I Load =

Rin However, the gain which is given by the value of the Rout divided by Rin wasnt accurate when applied to the system in practice. Therefore, the resistance values were selected experimentally. The final value of Rout was selected as 3.3k ohms and Rin was chosen to be 100 ohms. Verification for this selection is shown in section 4.4.
3.1.2.2 Voltage Monitor The voltage monitor was initially going to be the MAX6652 System Monitor IC Device. This was eventually scrapped because the data transfer between the MAX6652 and the MSP required I2C protocol which was difficult to implement in practice. Fortunately, the MSPs onboard A/D allowed for us to alter the design so that the voltage could be read by the MSP in an analog fashion. Our first alternative solution was a resistive divider set up. Using two resistors in the mega ohm range would allow for us to step the voltage down to a readable level for the MSP without drawing too much parasitic current. However, this design did not work in practice as the values read from this simple design tended to fluctuate with changing loads. Our final solution was to use a differential op-amp. This set-up is shown in figure 3.3.
Rf 3.24k

Vout R .005* out

(3.2)

R1 19.9k R2 Battery 12Vdc 19.9k

LMC6032IN 11 2 -

VOUT 1 TO MSP A/D

+ 4 U20A V+

Rg 3.24k

Figure 3.3 Voltage Monitor Schematic With this op-amp configuration, the voltage to be sent to the MSP is determined by: 8

Vbattery R1 With the set-up shown, the theoretical inverse gain is 6.14. This value is verified in section 4.3.

Vout =

Rf

(3.3)

3.1.3 Voltage Regulation The voltage regulation circuit using the LM317 adjustable regulators is shown in figure 3.4

Figure 3.4 DC-DC Conversion Schematic According to the datasheets supplied by the manufacturer of the LM317 this is the correct setup to perform DC-DC conversions. The equation to determine the output voltage is:
R2 (3.4) ) R1 The reference voltage is the voltage between the Vout port and the adjust port. This is specified to be 1.25 volts. Given this knowledge and a pre-determined selection of R1 to be 1k ohm, the value of R2 required for a 3.3 V conversion is 1.82k ohms and the value necessary for a 5 V conversion is 3k ohms. This device is particularly useful because the output voltage is independent of the input voltage as long as the input voltage is 2 volts above the output voltage. Verification of these resistances and the output voltages is shown in section 4.1 Vout = Vref (1 +

3.1.4 Interrupt 3.1.4.1 Switch The original design did not account for the current required to drive the base of the transistor into saturation. The digital I/O of the MSP430 cannot supply much current so an additional gain stage needed to be added. Initially one MPS2222 NPN BJT was added to boost the current into the base of the NTE2598. Consulting the manufacturer data sheet for the MPS2222, a base current of 15 mA draws 150 mA through the collector in saturation. TI states not to exceed 6 mA for any I/O port on the MSP430 so this design is not enough. 9

By cascading a second MPS2222 to amplify the current of Q1 as shown in figure 3.5, the microcontroller can supply a safe amount of current which will get amplified twice to drive the high power NTE2598 into saturation. The digital I/O of the MSP430 is voltage high at VCC which is 3.3 V. The voltage from the microcontroller must have enough headroom to turn on all three transistors but not be too high to draw too much current through the MPS2222 as these are rated at a maximum collector current of 600 mA. Testing showed that a voltage of 2.3 V accomplished this. In order to achieve 2.3 V the D/A module of the MSP430 must be used.

Figure 3.5 Load Switch Schematic 3.1.4.2 Pushbutton and Buzzer The buzzer required a transistor to boost the current supplied by the MSP430. It uses the same general purpose MPS2222 as shown in figure 3.6.

Figure 3.6 Buzzer Schematic The pushbutton required a debouncing circuit shown in figure 3.7. This RC circuit serves to charge the capacitor while the button is not being pressed so that when the button is pressed a short to ground is made and the capacitor discharges. Since the settling time of the capacitor is given by the time constant of the RC circuit, the output voltage is predictable. The values of R and C chosen yield a time constant of 10 s. This design allows for a very quick press of the button with accurate results.

Figure 3.7 Debouncing Circuit 10

3.1.5 Display The display selected was a 2x16 LCD display with a pre-installed serial backpack that used RS-232 communication. This meant that the input to the LCD could be accomplished with just one input from the UART device on the MSP430. A couple of issues arose with this set-up. First off, timing between the MSP430 and the baud rate input to the LCD had to be carefully calibrated. The UART output baud rate is determined from a clock source that is divided by a register value to determine the baud rate. This clock source was initially going to be a 32 kHz crystal but unfortunately this crystal broke during the final week so the source needed to be switched to the MSPs internal DCO (Digitally Controlled Oscillator). This DCO clock needed to be measured on an oscilloscope to determine its exact frequency so that the division registers could be determined. Once this value was measured it was possible to match the LCD anticipated baud rate of 2400 bps. Another issue was that the UART output was based on the standard criteria that a high voltage would be seen as a digital 1 while a low voltage would be seen as a digital 0. RS-232, however, has an opposite standard. Initially we attempted to resolve this issue by inverting the MSP430s output in software but this didnt have the desired effect because this failed to invert the start and stop bits signaling the beginning and end of each communication. This issue was eventually fixed by adding in a simple inversion transistor set-up. The MSP430 would power the base of another MPS2222 transistor so that when the MSP430 was high, the UART output path would be connected to ground creating a low signal. After these two issues were resolved the LCD screen functioned as initially expected 3.1.6 Transmitter The transmitter selected was a LINX TXM-916-ES. This was chosen due to its very low current consumption as well as its ability to be paired with an ANT-916-JJB antenna which is a very small antenna at only 0.69 inches tall and 0.28 inches wide. The transmitter only uses seven milliamps of current. The set up between the transmitter and the MSP430 was fairly simple. The data line into the TXM unit received a standard I/O port output from the MSP430. When transmission was necessary a square wave at a frequency of 18.9 kHz was sent to the transmitting unit. The transmission unit had a bandwidth of 20 Hz to 28 kHz so this was a reasonable signal. This data signal did not need to be modified because the sole purpose of the transmission is to power on the receiving buzzer. There was no actual digital data that needed to be sent and received so the application was a fairly simple one. 3.2 Receiving Unit The receiving unit was designed to be as small as possible. The only components on the receiving end were the receiving unit and its antenna, a voltage regulation conversion, and a piezoelectric buzzer solution. This small size is necessary for the end-user to be able to carry the device around on their person at all times without it becoming a bother due to bulk. 3.2.1 Receiver The receiver selected was the LINK RXM-916-ES to match its TXM counterpart used on the transmitting side. This was also paired with the small ANT-916-JJB antenna. The receiving unit would simple take the signal from the transmitting unit and output the frequency on its data line to a frequency to voltage converter chip which is explained in section 3.2.3 3.2.2 Voltage Regulation 11

Voltage regulation on the receiving side used the same LM317 adjustable voltage regulators as on the transmitting unit. Here the voltage was stepped down to five volts because the receiving unit required a 4.5-5.5 volt input. This was achieved using the same set-up for the five volt conversion as explained before. This unit was powered from three 3 V button cell batteries in series thus creating a nine volt input. Three were necessary because the input to the conversion needed to be at least two volts higher than the intended output, or in this case, seven volts. 3.2.3 Buzzer Set-Up Initially our buzzer was going to be powered directly from the output of the receiving unit but we determined that this was not feasible because the receiver could not output the necessary current. Instead we needed to use a transistor set up to drive power to the buzzer, much like on the transmitting end. However, because the output from the receiver is a square wave rather than a dc voltage level, a conversion was necessary. To fix this problem, a frequency to voltage conversion chip was used. This chip contained an internal BJT that was turned on whenever a certain frequency threshold was reached at its input. This frequency threshold was determined by placing an external resistor and capacitor. The formula used to derive this power on frequency was:
f on = 1 2 RC

(3.5)

We selected a 3.3 k resistance and a .01 F which yields a turn on frequency of 15.15 kHz. Therefore, sending our 18.9 kHz signal would have met this requirement.

12

4. DESIGN VERIFICATION 4.1 DC-DC Tests To verify the functionality of the DC-DC conversion we performed a test by varying the input to the voltage conversion systems using the Agilent E3631A dc power supply. We tested the 3.3 V conversion by varying the input between 10 14 volts, thus simulating a car batterys range of values. The output from the conversion was recorded. This data is shown in table 4.1 Table 4.1 3.3 V Conversion Tests Input [V] 10 10.5 11 11.5 12 12.5 13 13.5 14 Output [V] 3.18 3.18 3.18 3.18 3.18 3.18 3.18 3.18 3.19

The output voltage was nearly perfectly steady around 3.18 volts. This was in-fact a more beneficial result than exactly 3.3 V because we needed to be careful not to exceed the MSP430s upper threshold of 3.6 V. For the 5 V conversion we tested the output across a range of inputs from 6 9.5 V to simulate inputs from the button batteries. As noted earlier, except for the case when the input is only 1 V above the output, the results were very steady around 4.9 V. This was an acceptable input to the receiving chip and was therefore accepted. The results of this test are shown in table 4.2 Table 4.2 5 V Conversion Tests Input [V] 6 6.5 7 7.5 8 8.5 9 9.5 4.2 Microcontroller ADC Tests Output [V] 4.76 4.89 4.90 4.90 4.90 4.90 4.90 4.90

13

We initially tested the A/D capability as a single module of our system by applying a voltage to the A/D input port of the MSP430. Using IAR Workbench debugging software, we were able to step through the code and look at the values of registers and variables. Using the debugger we were able to determine that our code to set up and run the A/D module functioned properly as shown in table 4.3 Table 4.3 A/D Accuracy Tests A/D Voltage Input 1.899 V 1.899 V 1.899 V 1.899 V 1.899 V Conversion Value in Memory 3138 3120 3115 3112 3112 Voltage Determined by MSP 1.916 V 1.905 V 1.902 V 1.8999 V 1.900 V

The voltage input was provided using the Agilent E3631A Power Supply. 4.3 Voltage Monitoring Tests To test our final solution for the voltage monitor system, we supplied various voltage inputs from the Agilent power supply and recorded the output voltage. As stated earlier in section 3.1.2.2 the expected inverse gain from our set-up was 6.14. After performing the tests shown in table 4.4 we found that the average actual inverse gain was 6.10 which conformed nicely to our expected value. Table 4.4 Voltage Monitor Tests Voltage Input 14 V 13 V 12 V 11 V 10 V 4.4 Current Sensing Tests As explained in section 3.1.2.1 the gain from the current sense IC did not conform to the expected output as dictated by the mathematically expected value. Therefore, it was necessary to figure out exactly what the gain was based on the selection of the input and output resistors. Using the resistor values selected previously, tests where run to find the actual gain from the voltage across the output resistor to the voltage seen at the input to the MSP430s A/D input. This was accomplished by testing the system at different supply voltages outputted from the Agilent supply as well as at varying load resistances to draw various currents. The output voltage to the MSP430 and the voltage across the sense resistor were both read using the Keithley multimeter and were recorded. The gain was determined by dividing the voltage out by the voltage across the sense resistance. As shown in table 4.5, the gain was shown to be fairly steady around 64 except for one outlying value. This gain meets our requirement that the voltage input to the MSP430 needed to be less than 2.5 volts because the current needed to reach 2.5 V out with a gain of 64 is 7.8 A and that is an acceptable threshold for our purposes. Voltage Output 2.29 V 2.13 V 1.97 V 1.80 V 1.64 V Inverse Gain 6.11 6.10 6.09 6.11 6.10

14

Table 4.5 Current Sensing Tests


Source Voltage 11.70 V 11.71 V 11.75 V 12.79 V 12.73 V Load Resistance 2.96 ohms 3.48 ohms 4.21 ohms 4.21 ohms 3.48 ohms Voltage Out 1.077 V 0.915 V 0.762 V 0.820 V 0.987 V Voltage Sense 16.80 mV 14.58 mV 11.78 mV 12.66 mV 15.38 mV Gain 64.1 62.8 64.7 64.8 64.2

4.5 BJT Switch Tests Initial tests of the NTE2598 BJT were to determine what biasing conditions were needed to put this device in saturation. The set-up for this test is shown in figure 4.1.

Figure 4.1 Initial Test Set-up With this set up we were able to vary the value of R2 to determine what current was needed given an applied base voltage of 3.3 V to drive Q1 into saturation. The results are shown in table 4.6. Table 4.6 Initial Test Results V1 12 V 12 V 12 V 12 V 12 V 12 V V2 0.393 V 3.3 V 3.3 V 3.3 V 3.3 V 3.3 V R2 0 1 k 3.3 k 330 120 56 VR1 1.2 V 1.5 V 0.4 V 4.9 V 11.7 V 11.76 V VCE 10.7 V 10.5 V 11.6 V 6.7 V 0.220 V 0.200 V VBE 0.4 V 0.58 V 0.56 V 0.59 V 0.65 V 0.66 V IC 147 mA 56 mA 15 mA 200 mA 432 mA 437 mA IB 12 mA 2.6 mA 3 mA 11 mA 25 mA 50 mA

The load resistor R1 alone with the battery should draw 444 mA. These results showed what conditions are needed to drive this transistor to operate with minimal voltage drop across it and maximum current through it. The resistor R2 was needed to convert the voltage at the base into a current as indicated by the first row of table 4.6. The Agilent E3631A was used to provide these voltages and without R2, the supply would be current limited and not output the full 3.3 V. The values of VBE and IB are the important biasing conditions to take away from this test. Only the last two set-ups with a value of R2 as 120 and 56 operated the transistor in the correct region. 15

Based on these results and the MSP430 limitation of 6 mA for output, we ran tests using the setup shown in figure 3.5. Using the lab power supply to provide the 3.3 V supply rail and to simulate the MSP430 output from its D/A module, we set up the Sorensen DCS 33-33 high voltage, high current power supply to simulate the battery. These tests differed by the value set for the current limit on the Agilent power supply providing the control signal for Q1. By limiting the current to the device, the resultant voltage from the power supply would tell us what value we needed to set the D/A in order to achieve that base current. The results are shown in table 4.7. Table 4.7 Final Transistor Biasing Results Vbattery 11.95 V 11.95 V RLoad 6.15 6.15 VB,Q1 2.34 V 2.26 V IB,Q1 8 mA 6 mA VCE,Q3 114 mV 124 mV IB,Q3 332 mA 300 mA

This shows that for an output from the MSP430 of 2.26 V, only 6 mA will be drawn. At these conditions, the VCE shows an even lower value than the previous tests and the value of IB,Q3 show that at these conditions, the max collector current of the MPS2222 is not exceeded. The NTE2598 can sustain 12 A base current so there is no danger. 4.6 TX/RX Tests To test the transmitting and receiving portion of the design it was necessary to make sure the input to the TXM chip was the correct frequency. To do this we observed the output frequency from the MSP430 on an oscilloscope. The result is shown in figure 4.2.

Figure 4.2 TX Transmission Input As shown, the frequency is greater than the frequency required to turn on the receiving buzzer as the signal is at 18.9 kHz. When this set up was tested using a power supply, the data was received from the RXM chip and the buzzer sounded. The signal was generated from the PM 5139 function generator and 16

the transmitting and receiving chips were powered from two separate dc sources supplied by the Agilent E3631A. Unfortunately, when this set-up was switched to its final configuration using the MSP430 as the signal source and the button batteries as the power source, the device did not function correctly. This was the case at the time of the final demo. Further, testing is still needed to find a solution. 4.7 Power Consumption Tests Our project is intended to save a battery if it starts to become depleted. It is then necessary that our monitoring system does not impose significant power consumption to the vehicle battery. To determine what parasitic drain our system imposed, we ran tests at full system integration and capacity. We ran the system with various simulated loads and took measurements of key components to determine the drain imposed by the microcontroller, the BJT switch, and the rest of the system in general. To determine the power consumption of the microcontroller, we placed the Keithley 2000 Multimeter in series with the voltage supply to the chip. Since the voltage supplied is known, the power consumption can be determined. Determining the drain caused by the rest of our system such as the LCD, voltage regulators, transmitter, buzzer, and other components is not as simple a measurement. To do so we determine the total current produced by the battery and subtract the current through the simulated loads. At several resistive load setups, we used the multimeter to measure the voltage across the sense resistor, voltage across simulated loads, current into MSP430, voltage across battery terminals, VCE of power transistor, and the voltage of the D/A output of the MSP430 controlling the switch. Knowing the value of the precision sense resistor to be 0.005 and the resistive loads we had in place, we could calculate the remaining values found in table 4.8. Table 4.8 Power Consumption Test Results Test 1 2 3 Vbattery [V] 11.42 11.29 11.46 Vsense [mV] 9.3 12.64 6.92 Rload [] 6.15 4.44 9.22 Vload VCE VD/A IMSP [V] [mV] [V] [mA] 11.06 94.5 2.30 5.64 PMSP = 17.9 mW Pswitch = 170 mW 10.82 135 2.33 5.5 PMSP = 17.5 mW Pswitch = 329 mW 11.21 69 2.32 5.54 PMSP = 17.6 mW Pswitch = 84.2 mW Isense [A] 1.86 2.53 1.38 Iload [A] 1.80 2.44 1.22 Isystem [mA] 60 90 160

These results show a consistently low current draw from the microcontroller. The power dissipation of the switch and the current draw of the system are relatively low but do contribute somewhat to the depletion of the battery. Test 1 shows our system consuming 3.23% of the total current. Test 2 shows 3.56% and Test 3 shows 11.6% of the current through our system. 4.8 Temperature As our system is intended to be used in an automobile it needs to be resilient to all outdoor temperatures. We decided that a range of 0 100 degrees Fahrenheit was a good requirement to set. This range could be stated as -18 to 38 degrees Celsius. The manufacturers specified operating temperatures for our critical parts are shown in table 4.9. Our final design came together too late for us to be able to test the finished product at these temperature extremes. Further testing would be needed to claim our design requirement met. However, from the manufacturers stated data, the transmitting and receiving chips would not work in freezing temperatures so solutions would need to be found for these two devices. The rest of the devices can theoretically work within our temperature bounds. 17

Table 4.9 Device Temperature Data Device MSP430 TXM-916-ES RXM-916-ES NTE2598 BJT LTC6101 PC 1602-Q LCD MPS2222 Transistor LM317 Minimum Operating Temp (C) -40 0 0 Unknown -40 -20 -55 -40 Maximum Operating Temp (C) 85 70 70 150 125 70 150 125

18

5. COST ANALYSIS 5.1 Parts A summary of the individual part prices is in Appendix A. Table A.1 shows the prices for the transmission side and table A.2 shows the prices for the receiving side. The total cost of the combined system is $159.32 5.2 Labor In order to determine our estimated total amount spent working on this project we have broken down our estimated time spent working on this project by week. This is shown in table 5.1 below. The hours shown are a combination of time spent on an individual basis and combined multiplied by two to factor in for the two person team. Table 5.1 Estimated Time Worked Week 2/9 2/16 2/23 3/2 3/9 3/16 3/23 3/30 4/6 4/13 4/20 4/27 Total Time Estimated Hours 10 20 10 20 30 30 0 40 40 50 60 60 370

At an hourly wage of $35/hr, which is relatively proportional to a $65,000 annual salary, the total labor cost then can be calculated as:
Labor Cost=Hourly Rate*Hours Spent*2.5

(5.1)

Thus the total labor cost is $32,375. This brings the total cost of the project to $32,534.32 with parts and labor. If we were to sell this device at a price of $200, we would need to sell 796 units to cover our research and development cost.

19

6. CONCLUSIONS Overall, our system came together very well. Our original design was mostly followed through to our end product except for a few changes. This is indicative of our original planning and research stage. The only major change from initial design to final design was the voltage monitoring solution. Other than that, only minor changes were needed to adjust for current issues. During our planning stages we were able to achieve a desired scope for this project. The design incorporated a broad range of electrical engineering topics so a good knowledge base was required in order to implement a finished product. The final system, on the transmission side of things, was overall a great success. When attached to a battery, the system immediately began monitoring the voltage and current. The system continuously displayed the voltage and charge time remaining values on an LCD screen. The charge time remaining was depictive of the instantaneous current drain on the loads. The magnitude of the time remaining was proportional to the current. When no current was being drawn the time remaining displayed pound signs in place of a time remaining value as we had planned for. When the voltage reached the threshold voltage, simulated by turning down the voltage by tenths of volts on the Sorensen DCS 33-33 power supply, the interrupt routine responded immediately. The LCD display went blank, the switch cut off the loads, the buzzer sounded, and the TX signal was sent to the transmitter. Then, when the user pressed the reset button the system fired back up again as we had intended. The main drawback to the system was the inability to have the transmission and receiving systems functional by end of semester. Theoretically it should work, but further investigation needs to be done to find a solution. Other than this issue, a few things could be done to improve on the system. The parts selection could be optimized to further reduce the parasitic drain on the car battery caused by our system. Certain parts were chosen due to availability rather than low power function and given our systems purpose, a final end-user product would need to be as optimized as possible. One uncertainty that would also need to be addressed is whether or not our cut-off voltage is a practical value. This could be tested by trying to start a car with a battery at different voltages to find a reliable minimum. However, overall we believe this project was a large success. The marketability of this project is very evident. Accidental battery drain is a very common occurrence and protection against this is definitely a needed option. With more time to test against real world scenarios, this device could potentially be one of high value. Ethically, this device does not seem to cross over any dangerous bounds. We would possibly have to work with the car manufacturers themselves to make sure that our device would not be imposing on any of their warranty guidelines. Also, we would need to make sure our transmission complies with FCC regulations. In addition, professional installation would be required due to possible dangerous current flow within an automobiles electrical system.

20

REFERENCES [1] [2] Absolute Astronomy, Lead-acid battery, Feb 3 2009, http://absoluteastronomy.com/topics/lead -acid_battery Texas Instruments, MSP430x15x, MSP430x16x, MSP430x161x Mixed Signal Microcontroller, [Online Document], [cited 15 Mar 2009], Available HTTP: http://focus.ti.com/lit/ds/symlink/msp430f156.pdf Linear Technology, Application Note 105: Current Sense Circuit Collection, [Online document], [cited 2 Feb 2009], Available HTTP: http://www.linear.com/ad/current_sense.jp Linear Technology, High Voltage, High-Side Current Sense Amplifier in SOT-23, [Online Document], [cited 2 Feb 2009], Available HTTP: http://cds.linear.com/docs/Datasheet/6101fg.pdf Maxim, Temperature Sensor and System Monitor in a 10-pin uMax, [Online Document], [cited 12 Feb 2009], Available HTTP: http://www.maximic.com/quick_view2.cfm/qv_pk/2486/t/do#Data%20Sheet Texas Instruments, MSP430x1xxx Family User Guide, [Online Document], [cited 15 Mar 2009], Available HTTP: http://focus.ti.com/lit/ug/slau049f/slau049f.pdf Texas Instruments, MSP-FET430 Flash Emulation Tool (FET) Users Guide, [Online Document], [cited 30 Mar 2009], Available HTTP: http://focus.ti.com/lit/ug/slau157i/slau157i.pdf Texas Instruments, Datasheet: 3-Terminal Adjustable Regulator, [Online Document], [cited 18 Feb 2009], Available HTTP: http://focus.ti.com/lit/ds/symlink/lm317.pdf Linx Technologies, ES Series Transmitter Data Guide, [Online Document], [cited 18 Feb 2009], Available HTTP: http://www.linxtechnologies.com/Documents/TXM-xxx-ES_Data_Guide.pdf

[3] [4] [5]

[6] [7] [8] [9]

[10] Linx Technologies, ES Series Receiver Data Guide, [Online Document], [cited 18 Feb 2009], Available HTTP: http://www.linxtechnologies.com/Documents/RXM-xxx-ES_Data_Guide.pdf

21

You might also like