an3183 - weight scale application using mcp3564 24-bit
TRANSCRIPT
AN3183Weight Scale Application using
MCP3564 24-Bit Delta-Sigma ADC
INTRODUCTIONThis application note describes a weight scale designusing Microchip's MCP3564 24-bit Delta-SigmaAnalog-to-Digital Converter (ADC) and PIC24microcontroller. The weight scale uses an automaticcalibration process and techniques to minimize powerconsumption. The design takes advantage of theADC's dynamic reconfigurability features ofoversampling ratio (OSR) and Gain settings todemonstrate the impact of certain configurations on theprecision and the accuracy of the device. Thesesettings can be made from a dedicated graphical userinterface (GUI) which also allows the calibration of theweight scale and much more.
Starting from the sensor (the load cell) and itsspecifications and ending with the digital filterimplementation, this application note providesinformation about each feature of the weight scale andtheir importance in the application.
WEIGHT SCALE SYSTEM DIAGRAM
Figure 1 shows the weight scale demo using theMCP3564 24-bit Delta-Sigma ADC. Figure 2 shows anexample of weight scale system diagram, containingthe front end load cell circuit, gain amplifier, MCP3564Delta-Sigma ADC and PIC24 16-bit microcontroller(MCU).
FIGURE 1: Photo of the MCP3564 Weight Scale Demo, P/N ARD00906.
FIGURE 2: Weight Scale Block Schematic.
Author: Dana Diaconu,Microchip Technology Inc.
AVDD
AGND
OUT+
OUT- MCP3564 MCU(PIC24FJ256GB410)
CH0CH1 SPI
CH2CH3
Low Noise
Differential Amplifier
VREF+
VREF-
2019 Microchip Technology Inc. DS00003183A-page 1
AN3183
Load Cell
The most popular type of sensor for weight scales isthe strain gauge load cell. The load cell is a transducerwhich converts an applied mechanical force into anelectrical signal directly proportional with the magni-tude of the force. The resistive load cell used in thisapplication is composed of four strain gauges: two thatmeasure tension and two that measure compression.These four strain gauges correspond to four resistorsorganized in a Wheatstone Bridge type of circuit,shown in Figure 3.
FIGURE 3: Wheatstone Bridge Resistive Load Cell.
The four strain gauges sense the bending contortion ofthe load cell under load translating to changes in theelectrical resistances.
Power to the Wheatstone Bridge is supplied by aknown excitation voltage (VE) and its output voltage isdefined by Equation 1.
EQUATION 1: WHEATSTONE BRIDGE OUTPUT VOLTAGE
The bridge reaches a balanced state (VOUT = 0) whenno strain is applied (i.e. no load conditions). In thiscase, Equation 1 shows that the output voltage is nullif: (R1/R2) = (R4/R3).
Any resistance variation in any arm of the bridge leadsto an unbalanced state and to a nonzero outputvoltage. Ideally, if no strain is applied there is novariation in the resistances (R1-4 = 0). In practice,these variations can occur due to changes intemperature load cell manufacturing imperfections andaging. These changes can lead to an offset outputvoltage which needs to be calibrated out of the system.
Other types of load cells have different strain gaugeconfigurations. The one presented in Figure 3 is calleda Full Bridge Configuration because it has four activeelements (the strain gauges) which form the entireWheatstone Bridge. There are two other types: quarterbridge and half bridge. The quarter bridge configurationhas a single active strain gauge element, while the halfbridge has two elements. The downside of theseconfigurations is that additional passive elements(resistors) are required in order to complete the bridge.
The full bridge configuration load cell is more sensitiveto bending contortion and less sensitive to temperaturechanges. The temperature change effect is more visi-ble in the quarter and half bridge designs because theadditional resistors used to complete the bridge willreact to the temperature variation differently than thestrain gauges, as they are made of different materialswith different temperature tolerances.
One method of minimizing temperature effects is usingthe full bridge configuration where the strain gaugesrespond to temperature variations with the samechange in resistance. This means that the ratios of theresistances are kept constant. Some load cells evenhave an additional resistive element which is not usedfor measuring the applied force. However, it is used inan instrumentation amplifier configuration as a gainsetting resistor. This resistor will have a similar thermalcoefficient as the resistive bridge and the temperaturevariation effect on output voltage will be minimized.This method was not investigated in this applicationnote.
Another solution is to implement temperature driftcorrection using software, but the necessity of thissoftware correction depends on the chosen load cell'sspecifications and the conditions in which the sensor isused. For instance, it is important to know thetemperature operating range of the load cell and howthermally unstable the environment in which it isused/integrated will be. Also, the temperature effect onoutput is often specified in the sensor's specificationstable and this gives the maximum difference in theoutput caused by a change in temperature of ±1°C,when the load remains constant. In addition, evenusing a high excitation voltage for the load cell couldcause the sensor to overheat and affect the accuracyof the measurement. These aspects should be takeninto consideration when deciding if a temperature driftsoftware correction is required.
Table 1 shows the key specifications of the load cellused for this application.
VE+VOUT
R1 - R1
+
R3 - R3
R4 + R4
R2 + R2(tension)
(tension)(compression)
(compression)
VOUT
R3
R3 R4+-------------------
R2
R2 R1+-------------------– VE=
DS00003183A-page 2 2019 Microchip Technology Inc.
AN3183
The output of the Wheatstone Bridge composed ofstrain gauges is a very low-level voltage signal(typically in the range of µV to mV) which needs to begain amplified before feeding into the ADC.
Equation 2 can be used to estimate the load cell outputvoltage range using Table 1. For example, the outputsensitivity of the load cell used in this application is1 mV/V. This means that when the excitation voltage is3.3V, the output signal will be 3.3 mV at full load. Fullload is the maximum capacity of the sensor, in this case2 kg. Equation 2 shows that for a 1 gram load changethe output will vary with 1.65 µV. This is a quickestimation before selecting a right load cell based onsystem requirements.
EQUATION 2: LOAD CELL OUTPUT VOLTAGE
Also, the capacity of the load cell should be selectedcarefully. If the maximum overload limit of the sensor isexceeded, it can be permanently damaged.
As mentioned before, a balanced state of the bridge isachieved when an excitation voltage is applied andthere is no load. Under these conditions the outputvoltage of the bridge would ideally be 0V. In practice,the maximum output voltage deviation of the load cellfrom 0 is given by the Zero Balance and theTemperature Effect on Zero specifications of the sensor(See Table 1). This deviation can be corrected throughoffset calibration.
Sensor temperature drift can be corrected in softwareusing a digital temperature sensor and a compensationalgorithm which accounts for variation of the sensoroutput voltage over temperature. The TemperatureEffect on Zero and Temperature Effect on Output spec-ifications are key to implementing a compensationalgorithm for the output voltage variation over tempera-ture.
For adding extra precision and accuracy to a weightscale, a thermocouple can be used together with thedigital temperature sensor. The thermocouple providesa voltage which is dependent on the temperaturedifference between its hot and its cold junction, but itsoutput is in the µV range. Therefore, it requiresamplification before converting the output to digitaldata. The digital temperature sensor can be used tomeasure the cold junction temperature. There areADCs which provide both an analog gain stage and aninternal temperature sensor, such as the MCP3564ADC used in this application. The thermocouple can beconnected directly to the converter without additionalcircuitry and the cold junction temperature can beestimated with this internal temperature sensor.However, an external digital temperature sensor, suchas Microchip’s MCP9800, is highly recommended as itincreases the accuracy of the measurement.
TABLE 1: LOAD CELL SPECIFICATIONS
Specification Description Specification ValueSpecification Value for a Load Cell
with a 2 kg Capacity
Output Sensitivity 1.0 ± 15% mV/V
Safe Overload 150 %F.S(1) 3 kg
Maximum Overload 200 %F.S 4 kg
Nonlinearity ±0.05 %F.S ±1g
Non-repeatability
Hysteresis
Creep (5 min.)
Temperature Effect on Output ±0.05 %F.S/°C ±1g/°C
Temperature Effect on Zero ±2.0 %F.S/°C ±40g/°C
Zero Balance ±10 %F.S/°C ±0.2 kg
Input/Output Resistance 1000 ± 10
Excitation Voltage 6V
Operating Temperature Range -10°C to +40°C
Note 1: Where F.S is full scale.
VOUTOutput Sensitivity mV V Excitation Voltage V
Maximum Capacity g ---------------------------------------------------------------------------------------------------------------------------- Load g =
VOUT1 mV/V 3.3V
2000g----------------------------------- 1g 1.65 µV= =
2019 Microchip Technology Inc. DS00003183A-page 3
AN3183
Table 1 shows four other specifications whichrepresent errors that can appear in the output of anon-ideal sensor.
• The nonlinearity parameter indicates the maximum deviation of the output curve from the ideal curve over the entire operating range.
• The non-repeatability specification is the maximum difference between load cell outputs for repeated measurements of the same weight and under the same conditions.
• The hysteresis effect can be observed by checking the difference in the output, measured once when the load increases from 0 up to a certain value and once when the load decreases from the maximum capacity down to that same value. There will be a difference between the two readings caused by hysteresis. It is important to note that the maximum value of this error is seen over the full range of the sensor and it decreases with smaller weight changes.
• Creep is defined as the change in the output when the load cell is under a fixed load for a certain period of time.
For the load cell used in this application, creep iscomputed over five minutes, as indicated in Table 1.This effect appears as a result of the load cell's materialstretching over time while under the same load.
Depending on the load and how deformable thematerial is, it may take a while for the load cell torecover after the load is removed assuming it hasn'tbeen damaged. This change in output after the removalof the load is known as creep recovery and is specifiedin the specifications table for some load cells.
The simplest Wheatstone Bridge circuit is shown inFigure 4. The load cell output voltage needs to beconverted to a digital value such that the data can beacquired and processed by the microcontroller.However, to get the best precision and ensure theaccuracy of this measuring process other importantaspects must be considered.
As previously stated, the load cell’s output voltageneeds to be amplified in order to take advantage of thefull input span of the ADC and to get more accurateresults. Since the bridge output is differential, adifferential amplifier can be used prior to the ADC'sinput. Another option is using a high resolution ADC,such as the MCP3564, which can be connected directlyto the Wheatstone Bridge without using additionalfront-end circuity. The differential input and theon-board programmable gain amplifier (PGA) of theMCP3564 make it ideal for this application as iteliminates any external circuitry which may be neededfor Common-mode noise rejection or signalamplification on the front-end of the ADC.
FIGURE 4: Simplified Block Diagram of Weight Scale Measurement System.
MCU(PIC24FJ256GB410)
SPI
AVDD
AGND
OUT +
OUT -
MCP3564VIN+
VREF+
VREF-VIN-
Load Cell
DS00003183A-page 4 2019 Microchip Technology Inc.
AN3183
MCP3564 Delta-Sigma ADC Features
The MCP3564 Analog-to-Digital Converter utilizes anoversampling Delta-Sigma architecture to achieve a24-bit resolution.
The MCP3564 offers eight single-ended and fourdifferential analog input channels with a programmablegain stage with gain factors from 1/3x to 64x. Inaddition, the device has the option for differentialreference voltage input. It also includes an internaloscillator, an internal temperature sensor and a burnoutcurrent source used for open/short circuit detection ofexternal sensors.
When using differential inputs, the input signal isdefined by Equation 3.
EQUATION 3: DIFFERENTIAL INPUT VOLTAGE
Ideally, only the differential voltage seen between theVIN+ and VIN- inputs would be amplified and convertedand any Common-mode voltage seen at these inputswould be rejected. In reality, however, this is not thecase. Any unwanted Common-mode voltages seen atthe inputs would also be amplified before differentiallyconverted. The Common-Mode Rejection Ratio(CMRR) of the device is an important specificationwhich indicates a device’s ability to reject these Com-mon-mode voltages.
The Common-mode input voltage is defined byEquation 4.
EQUATION 4: COMMON-MODE INPUT VOLTAGE
EQUATION 5: COMMON-MODE REJECTION RATIO
The CMRR specification values of the MCP3564 ADCare presented in Table 2. The DC CMRR is computedfor a Common-mode input voltage which takes multipleDC values and the AC CMRR is computed for aCommon-mode input voltage which is a sine wave.
The MCP3564 also has configurable OversamplingRatio (OSR), from 32 to 98304. This provides a methodof trading data conversion speed for precision. LowerOSR is used for applications which need fast data ratesbut do not require high accuracy. Higher OSR valuesare used when the application requires higher accuracybut doesn't need high conversion speed.
Table 3 shows how the noise is influenced by the OSRand the GAIN values. Table 4 shows their impact on theEffective Number of Bits (ENOB). Here the results arenot presented for all the possible OSR values, but onlyfor some values distributed over its entire range.
The MCP3564 has an analog gain stage which can beconfigured from 1/3x to 16x, and a digital gain with arange between 1x and 4x. When gain values largerthan 16x are selected, the analog gain stage staysconstant at 16x and the extra gain is added in the digitaldomain. In Table 3 and Table 4, the gain is consideredonly up to 16x, because the digital gain does notchange the noise performance significantly.
VIN VIN+ VIN-–=
VINCOM
VIN+ VIN-+
2----------------------------=
CMRR(dB) 20logVOUT
VINCOM---------------------- =
Where:
VOUT = the equivalent voltage of the ADC output code obtained with the ADC transfer function.
TABLE 2: COMMON-MODE REJECTION
Parameters Sym. Min. Typ. Max. Units Conditions
DC Common-mode Rejection Ratio
DC CMRR — -126 — dB VINCOM varies from 0V to AVDDVIN = 0V
AC Common-mode Rejection Ratio
AC CMRR -122 VINCOM = 0 dB at 50 HzVIN = 0V
2019 Microchip Technology Inc. DS00003183A-page 5
AN3183
TABLE 3: NOISE RMS LEVEL VS. GAIN VS. OSR
Total OSRRMS (Peak-to-Peak) Noise (µV)
GAIN = 0.33 GAIN = 1 GAIN = 2 GAIN = 4 GAIN = 8 GAIN = 16
32 365.02(2932.548)
120.80(981.899)
60.79(489.771)
30.70(243.707)
15.69(125.985)
8.23(65.940)
256 24.83(212.312)
8.94(73.354)
4.94(40.625)
2.94(23.384)
1.88(15.173)
1.29(10.109)
2048 11.47(91.513)
4.08(32.008)
2.26(18.037)
1.34(10.693)
0.86(6.795)
0.59(4.575)
16384 4.16(30.557)
1.50(10.805)
0.84(6.122)
0.50(3.650)
0.32(2.285)
0.22(1.596)
40960 2.70(18.794)
0.98(6.528)
0.55(3.829)
0.32(2.222)
0.20(1.407)
0.14(0.956)
98304 1.94(12.198)
0.68(4.367)
0.38(2.387)
0.22(1.370)
0.14(0.893)
0.09(0.588)
TABLE 4: EFFECTIVE NUMBER OF BITS
Total OSRENOB (Peak-to-Peak) RMS (bits)
GAIN = 0.33 GAIN = 1 GAIN = 2 GAIN = 4 GAIN = 8 GAIN = 16
32 15.7(12.7)
15.7(12.7)
15.7(12.7)
15.7(12.7)
15.7(12.7)
15.6(12.6)
256 19.6(16.5)
19.5(16.5)
19.4(16.3)
19.1(16.1)
18.7(15.7)
18.3(15.3)
2048 20.7(17.7)
20.6(17.7)
20.5(17.5)
20.2(17.2)
19.9(16.9)
19.4(16.5)
16384 22.2(19.3)
22.1(19.2)
21.9(19.0)
21.6(18.8)
21.3(18.5)
20.9(18.0)
40960 22.8(20.0)
22.7(20.0)
22.5(19.7)
22.3(19.5)
21.9(19.2)
21.5(18.7)
98304 23.3(20.6)
23.2(20.5)
23.1(20.4)
22.8(20.2)
22.5(19.8)
22.1(19.4)
DS00003183A-page 6 2019 Microchip Technology Inc.
AN3183
Figure 5, Figure 6 and Figure 7 show themeasurement distributions with different OSR settings.It can be easily noticed that the standard deviation (orrandom noises) decreases significantly with theincrease of the Oversampling Ratio.
Using the weight scale's dedicated graphical userinterface (GUI), the gain stage of the ADC and the OSRcan be dynamically reconfigured and their effect onmeasurements can be analyzed. One of the mostimportant parameters is the standard deviation.Standard Deviation quantifies the dispersion of the datavalues from a dataset and shows how the precision ofthe weight scale is influenced by the oversampling ratiowith a fixed gain of 64x.
Equation 6 shows how the standard deviation iscomputed:
EQUATION 6: STANDARD DEVIATION
FIGURE 5: PGA Gain = x64, OSR = 32.
FIGURE 6: PGA Gain = x64,OSR = 8192.
FIGURE 7: PGA Gain = x64,OSR = 98304.
i=1
Nxi x–
2
N 1–----------------------------------=
Where:
N = number of values in the dataset
xi = the ith value from the dataset[{x1, x2,..., xN} - dataset values]
x = the mean of the values from the dataset
2019 Microchip Technology Inc. DS00003183A-page 7
AN3183
Ratiometric Measurement
A ratiometric measurement is more suitable for abridge-based sensor as it can improve the stability ofthe measurement and eliminates the problemsintroduced by a noisy voltage source.
The reference voltage of the ADC should be the sameas the excitation voltage applied to the load cell. Withthis configuration the ADC output code will be a digitalratiometric representation of the input voltage relativeto the ADC reference voltage (excitation voltage).
The advantage of a ratiometric measurement is thatwhen the supply voltage varies, the output sensitivitymV/V ratio will remain constant. If the output sensitivityis 1 mV/V for a supply voltage of 3V, the output will bea 3 mV signal at full load (2 kg for the chosen load cell).Therefore, the fact that the output is ratiometric (themV/V ratio is kept constant) implies a certainmeasurement stability. Any noise from the voltagesupply, be it due to temperature variations or any othernoise source, will not affect the measurementsignificantly.
FIGURE 8: Ratiometric Measurement Schematic.
The ADC itself also has a Power Supply RejectionRatio (PSRR) specification which characterizes theinfluence of the power supply noise on the ADC outputcodes.
EQUATION 7: POWER SUPPLY REJECTION RATIO
AVDD
AGND
OUT +
OUT -
MCP3564VIN+
VIN-
VREF+
VREF-
Load Cell
PSRR(dB) 20logVOUT
AVDD------------------ =
Where:
VOUT = the equivalent voltage of the ADC output code obtained with the ADC transfer function
DS00003183A-page 8 2019 Microchip Technology Inc.
AN3183
The PSRR is measured for multiple AC and DC valuesof the power supply. For AC measurements, a sinewave is used with its amplitude representing possiblechanges in the power supply. See Table 5 for moreinformation regarding how the AC and DC PSRRvalues are determined.
For example, using the formula shown in Table 5 an ACPSRR of 99.08 dB can be calculated when assuming again of 16x is used:
AC PSRR = -75 dB – 20 × log(16) = -99.08 dB
Assuming a variation in the power supply of 100 µV,Equation 7 shows that:
VOUT = 10(PSRR (dB)/20) × AVDD (µV)
VOUT = 10(-99.08 dB/20) × 100 µV = 1.1 nV
This voltage is significantly lower than the amplifiedload cell's output voltage. Therefore, the measurementis not notably affected by the power supply noise.
TABLE 5: POWER SUPPLY REJECTION
Parameters Sym. Min. Typ. Max. Units Conditions
AVDD Power Supply Rejection Ratio
DC PSRR — -76 dB + 20 x LOG(GAIN) — dB
DVDD Power Supply Rejection Ratio
DC PSRR -110 DVDD varies from 2.7V to 3.6VVIN = 0V
AC Power Supply Rejection Ratio
AC PSRR -75 dB - 20 x LOG(GAIN) DVDD = 3.3VAVDD = 3.3V + 0.3VP, 50 HzVIN = 0V
2019 Microchip Technology Inc. DS00003183A-page 9
AN3183
FEATURES OF THE MCP3564 WEIGHT SCALE DEMO
External Low-Noise Differential Amplifier
To improve the accuracy and the precision of themeasurement, the weight scale board demo includesan external low- noise differential amplifier (Figure 2).The external differential amplifier offers the ability toamplify the input signal (load cell output voltage)beyond the capability of the programmable gain stageof the ADC. The ADC's amplifier has a configurablegain range from 1/3x to 64x, whereas the externalamplifier has a fixed gain of 100x. The differentialamplifier uses the MCP6492 Zero Drift Op Amp for itshigh PSRR and CMRR capabilities. The MCP6V92also provides input offset voltage correction, whichimproves the noise rejection.
Using the GUI, the external amplifier can be enabled ordisabled to demonstrate its impact on the applicationmeasurements. The accuracy and the precision of themeasurements can be compared while using the exter-nal or the internal amplifier. The results at different OSRvalues (when using the external amplifier) can also becompared.
Figure 9, Figure 10 and Figure 11 show how thestandard deviation varies when using the externalamplifier with an OSR of 32, 8192 and 98304respectively. The offset and gain of the system werecalibrated using a 100g load.
When comparing standard deviation values ofFigures 5, 6 and 7 where the internal PGA setting ofthe ADC is used versus the external amplifier(Figures 9, 10 and 11) it can be seen the results areimproved considerably when using the externalamplifier.
2019 Microchip Technology Inc. DS00003183A-page 11
AN3183
FIGURE 9: External Amplifier, OSR = 32.
FIGURE 10: External Amplifier,OSR = 8192.
FIGURE 11: External Amplifier, OSR = 98304.
DS00003183A-page 12 2019 Microchip Technology Inc.
AN3183
Ultra-Low Power Monitoring Amplifier
The ADC and the external low-noise op amp havesignificant current consumption during normaloperation which will affect the lifetime of the battery. Tominimize power consumption, the weight scale willenter a Low Power mode when not performing activeweight measurements. In this mode, the weight scalewill monitor if a mass is present by performinglow-accuracy measurements periodically.
The weight scale has two operating modes: Run modeand Sleep mode. When the weight scale enters intoSleep mode, the microcontroller is awakened by thewatchdog timer (WDT) at a predetermined time periodto check if there was any load change using the“low-power” monitoring amplifier. If there is a significantchange, the weight scale enters the Run mode. Other-wise, it goes back into Sleep mode.
When the weight scale enters Sleep mode, the ADC isdisconnected. Instead of waking up the ADC, whenchecking for load variation, an ultra-low powermonitoring amplifier is used.
FIGURE 12: Block Schematic with Ultra-Low Power Monitoring Amplifier.
The Monitoring Amplifier uses the Microchip MCP6444operational amplifier in an Instrumentation Amplifierconfiguration. The MCP6444 is a quad op amp with aquiescent current of 450 nA/op amp, suitable for usagein low power applications. The monitoring amplifier hasa single ended output and can be connected directly toan analog input pin of the microcontroller. Its outputvoltage is converted using the PIC24's internal 12-bitADC and compared to the value acquired at theprevious wake-up event of the microcontroller. If thereis a significant difference between the two values, theweight scale enters Run mode. Otherwise, themicrocontroller goes back to Deep Sleep mode. Forstoring the measured value at each microcontrollerwake-up, the Deep Sleep Semaphore registers(DSGPR0 and DSGPR1) are used since they are theonly registers preserved in Deep Sleep. One is used forsaving the value and the other is used as a flag toindicate if there was a previous measurement or not.These registers are reset every time the weight scalegoes from Run mode to Sleep mode.
Another design option is to connect the amplifier to acomparator input. PIC24F devices include threedual-input comparators with selectable inputs from theanalog inputs multiplexed with the I/O pins, as well asthe on-chip voltage reference.
Even though the SAR ADC of the PIC24F devices isless accurate and less precise than using theMCP3564 ADC, it is good enough to detect a loadchange and to decide whether the entire device shouldwake up and get into the Run mode or if it should goback into Sleep mode.
The biggest advantage of using this monitoringamplifier is that it draws less current than the MCP3564ADC (when in the Conversion operating mode), whichleads to extended battery life.
Figure 13 shows the final block schematic of theMCP3564 Weight Scale Demo.
AVDD
AGND
OUT+
OUT- MCP3564
MCU(PIC24FJ256GB410)
CH0CH1 SPI
CH2CH3
Low Noise
Differential Amplifier
Ultra Low Power MonitoringAmplifier
VREF+
VREF-
2019 Microchip Technology Inc. DS00003183A-page 13
AN3183
FIGURE 13: Final Block Schematic.
AGND
OUT +
OUT -
PIC24
CH0
CH1 SPI
CH2CH3
Low Noise
Differential Amplifier
Ultra LowPower
MonitoringAmplifier
Temperature sensorI2C
LCD
PowerControlBlock
PA3V3PA3V3_PGA
PA3V3_LC
P5V0_USB
PVBAT
PA3V3
P3V3
PA3V3_LC
PA3V3_PGA
AGND
P3V3
GND
P3V3
GND
DVDD AVDD
AGNDDGND
VREF+
VREF-
P3V3 PA3V3
GND AGND
P3V3
GND
DS00003183A-page 14 2019 Microchip Technology Inc.
AN3183
Temperature Sensor
Microchip’s MCP9800 is a digital temperature sensorwhich allows the configuration of the temperaturemeasurement resolution, the operating modes or thespecification of both temperature alert output andhysteresis limits.
The MCP9800 has two power-saving operating modes:Shutdown and One-shot (single conversion on com-mand then returns into Shutdown mode), both usefulfor keeping the weight scale’s power usage low. TheMCP9800 communicates with the microcontrollerthrough the I2C interface.
The measured temperature can be seen on the LCD byparsing through the menu or by checking it in the GUI.This sensor can be used to observe if and how theweight measurement noise is affected by the increaseor decrease in temperature.
For a high precision weight scale design, the data fromthe MCP9800 can be used to compensate thetemperature drift of the load cell's output. As previouslydiscussed, a more accurate temperature driftcorrection is obtained when using a thermocoupletogether with this digital temperature sensor (used forcold junction measurement).
Microcontroller - PIC24FJ256GB410
The microcontroller used in this application isMicrochip’s PIC24FJ256GB410, a 16-bit microcontrol-ler which offers some key features for this application.
The Extreme Low Power (XLP) Features, morespecifically the extreme low power currentconsumption for Deep Sleep, is very useful as thepower consumption can be minimized while the weightscale is not actively performing measurements. TheXLP features are therefore excellent for extendingbattery life in battery powered applications.
The on-chip Watchdog Timer (WDT) is needed to wakeup the microcontroller from Deep Sleep to check ifthere is any change in the load cell output. Another keyfeature of this microcontroller is the Liquid CrystalDisplay (LCD) module which allows choosing a lowpower LCD without a dedicated driver.
The MCP3564 is initialized, reconfigured, and read viathe SPI interface using the PIC24F microcontroller.
2019 Microchip Technology Inc. DS00003183A-page 15
AN3183
LCD Glass
Using the LCD module of the microcontroller is veryconvenient for a low power application. By using asimple LCD glass, instead of a display with its owndriver, power consumption can be significantlylowered. The LCD driver module can be used togenerate the timing control to drive static or multiplexedLCD panels with up to 8 Commons and up to 64Segments. The LCD glass used in this application uses4 Commons and 25 Segments to display 6 main, and 4secondary, digits along with the units of measurement,i.e. g or kg.
The LCD is used to display a menu. By navigatingthrough this menu, the user can see:
• the measured weight in grams (Figure 14) and in kilograms (Figure 15),
• the calibration menu option (Figure 16),
• the temperature (Figure 17),
• the power supply voltage (Figure 18).
The power supply voltage is measured using a resistivedivider and the microcontroller's internal SAR ADC. It isuseful for checking if the batteries should be replaced.
The bottom right (SW201) and left (SW202)push-buttons can be used to navigate through themenu. The top left button (SW203) is used for choosingbetween the external or the ADC's internal amplifier.The top-right push-button (SW200) is used forauto-calibration when in the Calibration Menu state or,otherwise, only for offset calibration.
FIGURE 14: LCD Menu - Grams.
FIGURE 15: LCD Menu - Kilograms.
FIGURE 16: LCD Menu - Calibration.
FIGURE 17: LCD Menu - Temperature.
FIGURE 18: LCD Menu - Power Supply Voltage.
DS00003183A-page 16 2019 Microchip Technology Inc.
AN3183
Power
The weight scale can be powered using the on-boardtriple-A battery socket or by way of the USB connectorat J400.
An alternative to triple-A batteries could be arechargeable lithium-polymer (LiPo) battery with abetter weight-to-power ratio. A drawback to thisalternative, however, is an increased cost which maybe undesirable depending on the design constraints.For recharging the LiPo battery when the USB isconnected, a battery charge management controllercan be integrated in the design. For example,Microchip’s MCP73830 provides specific algorithmsdeveloped to achieve optimal capacity and safety andto shorten the charging time as much as possible.
To reduce the overall system noise, separate analogand digital power supplies should be used. Microchip’sMCP1754 is used for the analog circuitry and theMCP1603 is dedicated to the digital section. TheMCP1754 is a low-dropout (LDO) voltage regulatorwith a typical quiescent current of 56 uA and a typical300 mV dropout voltage. The MCP1603 is asynchronous buck regulator with a 2.7V to 5.5V inputrange and a typical quiescent current of 45 µA. Bothregulators have shutdown control pins, another featurethat makes them suitable for battery poweredapplications.
Due to the inherent sensitivity of analog circuitry, anLDO with high PSRR is highly desirable. For thisreason the MCP1754 was selected for this application.The MCP1754 LDO has a typical PSSR of 72 dB at1 kHz and a low output noise of 3 µV/√Hz.
A Power Control Block has been implemented toenable or disable the power supply to the load cell andexternal amplifier as needed. It can be controlled by themicrocontroller in order to lower the powerconsumption when these components are not in use.
2019 Microchip Technology Inc. DS00003183A-page 17
AN3183
OFFSET AND GAIN ERROR CALIBRATION
In addition to the inherent offset of the sensorpreviously discussed, the design of the weight scalealso implies an offset introduced by the weight tray.Furthermore, both the ADC itself and the externaldifferential amplifier introduce additional offset and gainerrors. Regarding the ADC, these errors vary with theGAIN and OSR settings and they have different valuesfrom device to device.
The gain error indicates the difference between theslope of the actual transfer function compared to theideal one, defined by Equation 8.
EQUATION 8: ADC OUTPUT
A significant advantage of the MCP3564 ADC is that itprovides digital calibration for offset and gain errors.This considerably reduces the amount of computationsdone in the microcontroller.
Equation 9 shows how the ADC output code (stored inthe ADCDATA register) is modified with the offset andgain calibration values. These values are computed inthe microcontroller and then written in the ADC'sOFFSETCAL and GAINCAL 24-bit registers.
EQUATION 9: CALIBRATED ADC DATA
The MCP3564 also has two calibration control bits:EN_OFFCAL and EN_GAINCAL (see CONFIG3 regis-ter in the MCP3564 data sheet). When these bits areenabled, the values stored in the OFFSETCAL andGAINCAL registers are used to adjust the ADC outputcode. Otherwise, the calibration is not performed. Onecan choose to use only offset or only gain calibrationand this can be done by enabling the correspondingcontrol bit.
There are two ways to calibrate the weight scale:Manual or Auto-Calibration. Auto-Calibration can bedone either by using the LCD menu and the physicalbuttons on the board or by using the GUI. ForAuto-Calibration the user has to place the standard100g weight on the weight scale tray.
If another weight value for gain calibration is preferable,manual calibration can be used and this is availableonly via the GUI. For manual calibration, there are twobuttons, one for setting the offset and one for settingthe gain. In this case, the gain calibration weight valuecan be chosen from a drop-down list (50g, 100g, 200g,500g, 1000g) (see Figure 19).
FIGURE 19: Calibration Options.
When the weight scale is powered up for the very firsttime, it requires gain and offset calibration. Themessage printed on the LCD is shown in Figure 20.
FIGURE 20: Auto-Calibration - Start.
The auto-calibration process can be started bypressing the top right button (SW200) on the board orthe "Auto Calibrate" button from the GUI. The algorithmstarts with the offset calibration. Two messages aredisplayed on the LCD to let the user know that theoffset calibration has begun and the tray should beempty (see Figure 21).
FIGURE 21: Auto-Calibration - Offset.
ADC_OUTPUT LSB VIN+ VIN-–
VREF+ VREF-–-----------------------------------------
8388608 GAIN=
ADCDATA post-calibration =
ADCDATA pre-calibration OFFSETCAL+ GAINCAL=
2019 Microchip Technology Inc. DS00003183A-page 19
AN3183
The algorithm detects when the load cell signal isstable enough in order to compute the offset andcorrespondingly set the ADC's offset calibrationregister. During this time, the display shows a loadingbar to indicate that the offset calibration is still inprogress (see Figure 22).
FIGURE 22: Auto-Calibration -In Progress.
After the stability detection is done and after theOFFSETCAL register is set, the process continues withthe gain calibration. Two messages are displayed onthe LCD to inform the user that the gain calibrationprocess has begun and that the standard 100g weightneeds to be placed on the tray (see Figure 23).
FIGURE 23: Auto-Calibration - Gain.
The next steps are signal stability detection andcomputation of the gain calibration value. Finally, aftersetting the gain calibration register (GAINCAL), theauto-calibration algorithm is done and the display willshow the weight in grams.
After the initial calibration, the offset and gaincalibration values are kept in the flash memory of themicrocontroller, so the device does not need to becalibrated at each power up. Nevertheless, weightscale offset and gain calibration can be done at anytime, either by using the LCD menu and the physicalbuttons or by using the user interface.
DS00003183A-page 20 2019 Microchip Technology Inc.
AN3183
DIGITAL LOW-PASS FILTER
In order to reduce the noise level in the measurementseven further, a software digital filter is implemented.The Low-Pass Filter (LPF) does a weighted average ofthe current input values and the previous ones. Theimplementation of its discrete form is based onEquation 10.
Depending on the Low-Pass Filter coefficient value, theprevious values have a higher or a lower impact on thecurrent output. Figures 24 to 29 show a comparisonbetween filter outputs for different LPF coefficientswhen the load changes by 1 gram. For a low LPFcoefficient (Figure 23 and Figure 24) the inputvariations are slightly attenuated, while for a highervalue, it can be noticed that the filter smooths out thenoisy input. As the coefficient increases, the currentinput value has a smaller impact on the output.
This is why the slope at the rising edge is less and lesssteep. This increases the precision, but thedisadvantage of a high LPF coefficient is that it takes alonger time to notice load changes and for the output ofthe filter to increase or decrease to a certain value(Figure 27 and Figure 28). It also increases the time ofthe calibration process, as the algorithm waits for thesignal to become stable.
Figure 25 and Figure 26 show an example of inputfiltering based on a good trade-off between thesteepness of the slope (how fast the device reacts toload changes) and the precision of the measurement.
EQUATION 10: LOW-PASS FILTER EQUATION
y n y n 1– 1
2LPF_coefficient
-----------------------------------------
x n x n 1– 2 y n 1– –+ +=
Where:
y(n) = filter output value
y(n - 1) = previous filter output value
x(n) = current weight value
x(n - 1) = previous weight value
2019 Microchip Technology Inc. DS00003183A-page 21
AN3183
FIGURE 24: Unfiltered Data,LPF Coefficient = 2.
FIGURE 25: Unfiltered Data,LPF Coefficient = 4.
FIGURE 26: Unfiltered Data,LPF Coefficient = 6.
FIGURE 27: Filtered Data,LPF Coefficient = 2.
FIGURE 28: Filtered Data,LPF Coefficient = 4.
FIGURE 29: Filtered Data,LPF Coefficient = 6.
Number of Samples
We
ight
(g)
× 1
00
Number of Samples
We
ight
(g)
× 1
00
Number of Samples
We
ight
(g
) ×
100
Number of Samples
Wei
ght
(g)
× 1
00
Number of Samples
We
ight
(g
) ×
100
Number of Samples
Wei
ght
(g)
× 1
00
DS00003183A-page 22 2019 Microchip Technology Inc.
AN3183
OPERATING MODES
The weight scale has two power modes: USB and LowPower Battery mode. When the USB is connected, itsupplies the entire board and the device is up andrunning at all times. When the USB is disconnected,the batteries supply the device. In this case, goodpower management is required in the interest ofprolonging the batteries' lifespan.
The operating states of the weight scale are:
• Run mode
• Sleep mode
Run Mode
Figure 30 represents the flowchart of the Run mode.The first step is to check whether the USB is connectedor not in order to establish which power mode thedevice is using.
In both power modes, the weight scale acquires data(weight, temperature, power supply voltage) anddisplays it on the LCD, depending on the state in whichthe LCD menu is in. If any button event occurs, thecorresponding command is executed.
In USB Power mode, the acquired data is not onlydisplayed on the LCD, but also sent to the GUI. Asshown before, by using this graphical user interface theuser can monitor the instantaneous, mean andstandard deviation weight values. Additionally, thetemperature and battery voltage are shown. TheOversampling-Ratio (OSR) of the ADC can also be setvia the user interface (GUI). The user can choosebetween the external or the internal amplifier. Whenusing the internal amplifier the gain can be selectedfrom the list of available values.
In Low Power Battery mode a timer is used to knowhow much time has passed since the last event hasoccurred, be it a button press or a significant loadchange. If the device has had no activity for 60 sec-onds, it enters into Sleep mode.
2019 Microchip Technology Inc. DS00003183A-page 23
AN3183
FIGURE 30: Run Operating Mode Flowchart.
START
Switch to USB Power mode (if the device is in LowPower Battery mode)
Switch toLow Power
(if the device is in USB Power mode)
Measure Weight
Measure Temperature
Yes
Any GUI commands?
No
Yes
Any buttonspushed?
No
Yes
Gain/Offset Calibration,
ADC registers update, etc.
Switch to Internal/External Amplifier, Auto-Calibration, Menu Navigation,
etc.
Counter = 60s?Yes
No
Go to Sleep
Measure Weight
Measure Temperature
Any buttons pushed?
No
YesGain/Offset Calibration,
Menu Navigation,etc.
Measure Power Supply Voltage
Measure Power Supply Voltage
Send data to GUI and LCD
Send data to the LCD
USB Plugged In?
Battery mode
DS00003183A-page 24 2019 Microchip Technology Inc.
AN3183
Sleep Mode
Figure 31 shows the flowchart for the Sleep mode.When the device is in Sleep mode, the MCP9800temperature sensor and the MCP3564 ADC stay inshutdown, along with the MCP1754 LDO and theMCP1603 buck regulator. After this step, themicrocontroller enters into Deep Sleep mode.
The Deep Sleep watchdog timer uses the MCU’sinternal low power RC oscillator and is configured towake up the MCU after approximately 500 ms of DeepSleep. Even if MCP1603 is shut down and there is nopower to the MCU, its output capacitor does not allowthe MCU supply voltage to decrease below the lowestaccepted VDD value. The MCU is awakened by thewatchdog timer, which in turn wakes up the buckregulator before the voltage on the output capacitorbecomes too depleted.
When the PIC24 is in the Run mode, it also enables theLDO and the power control block in order to supplypower to the load cell. The monitoring amplifier is usedto check if there is any significant change in the loadcell output voltage, in which case the device enters theRun Mode. Otherwise, the load cell's power supply isswitched off, the buck regulator is shut down and theMCU goes back into Deep Sleep again, with the entiresystem remaining in Sleep mode.
FIGURE 31: Sleep Operating Mode Flowchart.
Check the load using the Monitoring
Amplifier
Yes
YesEnter Run Mode
Watchdog timer triggered?
Significant load change?
MCU in Deep Sleep
START
No
No
2019 Microchip Technology Inc. DS00003183A-page 25
AN3183
CONCLUSION
This application note emphasizes the factors whichimpact the precision and the accuracy of a weight scaleand provides solutions and methods for obtaining lownoise measurements and a low power consumption ofthe entire system.
The load cell’s specifications need to be wellunderstood in order to appropriately decide what typeof ADC should be used and whether the designrequires an external amplifier or temperaturecompensation.
The weight scale application is based on the MCP3564ADC, which has several advantages for weight scaletype system design:
• configurable OSR and gain
• high PSRR and CMRR
• differential analog inputs (this allows directconnection of the Wheatstone Bridge)
• differential reference voltage inputs
• on-chip offset and gain calibration.
High OSR and gain values, as well as using theexternal low-noise differential amplifier, increase theprecision and the accuracy of the measurements.Furthermore, by implementing and using the digitallow-pass filter, a standard deviation of 0.02g can easilybe achieved.
Using the PIC24FJ256GB410 microcontroller, with itsXLP features proved advantageous for obtaining lowpower consumption. To save battery power, thisapplication also includes an algorithm which switchesthe weight scale operating mode from Run mode toSleep mode and an ultra-low power monitoringamplifier. At the expense of increasing the overall cost,using a LiPo battery and a charger are recommendedfor a different design if a better weight/power ratio isdesired.
REFERENCES
[1] MCP3561/2/4 Data Sheet, “Two/ Four/ Eight-Channel, 153.6 kSPS, Low-Noise 24-bitDelta-Sigma ADCs”, 2019 Microchip Technol-ogy, Inc.
[2] PIC24FJ256GA412/GB412 FAMILY DataSheet, “16-Bit Flash Microcontrollers with DualPartition Flash Memory, XLP, LCD, Cryp-tographic Engine and USB On-The-Go”,2015-2016 Microchip Technology Inc.
[3] MCP6V91/1U/2/4 Data Sheet,“10 MHz, Zero-Drift Op Amps”, 2015-2016Microchip Technology Inc.
[4] MCP6441/2/4 Data Sheet, “450 nA, 9 kHz OpAmp”, 2010-2012 Microchip Technology Inc.
[5] MCP9800/1/2/3 Data Sheet, “2-WireHigh-Accuracy Temperature Sensor”, 2010Microchip Technology Inc.
[6] MCP1603/B/L Data Sheet, “2.0 MHz, 500 mASynchronous Buck Regulator”, 2007-2012Microchip Technology Inc.
[7] MCP1754/MCP1754S Data Sheet, “150 mA,16V, High-Performance LDO”, 2011-2013Microchip Technology Inc.
2019 Microchip Technology Inc. DS00003183A-page 27
AN3183
APPENDIX A: SCHEMATICS ANDLAYOUT
This appendix contains the schematic and the layout ofthe MCP3564 Weight Scale Board.
A.1 Weight Scale Board - Schematic 1
P5V0_USB
USB_PRESENT
USB_D_PUSB_D_N
USB Connector
GND
Digital Power Supply
Analog Power Supply
ANALOG_POWER_ON
DIGITAL_POWER_ON
PVBAT
GND
AGND
PA3V3
P3V3
GND
VBAT_MEASURE
GND
1M06031%
R402
390k06031%
R401
1M06031%
R408
1M06031%
R406
PVBAT
PVBAT
Vout 1
PWRGD2
NC 3
GND4
SHDN5
NC 6
NC 7
Vin8
EP9
MCP1754/3.3V
U400
AGND AGND
Lx 1
NC 2
SHDN3
VFB/VOUT 4
NC 5NC 6
VIN7
GND8
EP9
MCP1603/3.3V
U401
4.7uF10V0603
C402
GND GND
4.7uH
L400
ANALOG_PGOOD
100k06031%
R400
AGND GND
Ground Connection
0.1uF16V0603
C400
0.1uF16V0603
C401
Net Tie0.5mm
NT102
100uF16V1210
C403
10M06031%
R404
ID 4
VBUS 1
GND 5
D- 2
D+ 3
0
USB2.0 MICRO-AB FEMALE
J400
1
2
AAA X 3BT400
MBR0530T1GD401
MBR0530T1G
D400
P5V0_USB
GND
100uF16V1210
C404100uF16V1210
C405
2019 Microchip Technology Inc. DS00003183A-page 29
AN
3183
DS
00
00
31
83
A-p
ag
e 3
0
20
19
Micro
chip
Te
chn
olo
gy In
c.
ADC_nCS
ADC_MISOADC_SCK
ADC_MOSI
ADC_CLKIN
1%10R0603
R1021%10R0603
R100
ADC_nDR
D
3 P3V3
GND
AGND GND
GND 2
SDA5 ALERT 3
VDD1
SCLK4
MCP9800
U102
GND
I2C_SCKI2C_SDA
or
4.7k5%0603
R1094.7k5%0603
R110
P3V3 P3V3
0.1uF 16V0603C100
0.1uF 16V0603C103
0.1uF 16V0603C101
0.1uF 16V0603C104
0.1uF16V0603
C109
10R 0603 1%R11810R 0603 1%R119
10R 0603 1%R12210R 0603 1%R123
10R 06031%
R12110R 0603
1%R120
REFIN-1 REFIN+/OUT2
CH03
CH14
CH25
CH36
CH47
CH58
CH69
CH710
CS 11SCK 12
SDI 13
SDO 14
DR/POR/CRC/MDAT 15MCLKIN/AMCLKOUT 16
DGND 17
DVDD 18AVDD19
AGND20
EP 21
MCP3564
U101
A.2 Weight Scale Board - Schematic 2
AGN
PA3V
AGND
ADC
P3V3
Temperature Sens
GND
AGND
AGND
AGND
AGND
AGND
1k06031%
R101
1k06031%
R107
1k06031%
R108
1k06031%
R111
CH0
CH1
CH2
CH3
CH0
CH1
CH2
CH3
Load Cell
PA3V3
LOAD_CELL_PLUS
LOAD_CELL_MINUS
LOAD_CELL_PLUS
LOAD_CELL_PLUS
LOAD_CELL_MINUS
LOAD_CELL_PLUS
LOAD_CELL_MINUS
LOAD_CELL_MINUS
External PGA for improved accuracy
2k06030.1%
R104100k06031%
R103
100k06031%
R106
Anti-aliasing filters
+A3
-A2
OUTA 1
+A
-A
OUTA
A
AVSS
4
VDD
8
MCP6V92
U100A
+B5
-B6
OUTB 7
+B
-B
OUTB
MCP6V92
U100B
AGND
0.1uF16V0603
C107
0.1uF16V0603
C108
0.1uF16V0603
C105
0.1uF16V0603
C102
0.1uF16V0603
C106
3
12
DMP3099
Q100PA3V3
100k06031%
R112
PA3V3_PGA
AGND
0.1uF16V0603
C110
PA3V3_PGA
PA3V3_PGA
3
12
DMP3099
Q101PA3V3
100k06031%
R114
100R06035%
R115
PA3V3_LC
PA3V3_LC
PA3V3_LC
0.1uF16V0603
C111
AGND
EXT_PGA_ON
LOAD_CELL_ON
Power Control
3
12
2N7002,215Q103
100R06035%
R117
AGND
100R06035%
R113
3
12
2N7002,215Q102
100R06035%
R116
AGND
12
34
HDR-3.5 Male 1x4DNP
J1
AN3183
A.3 Weight Scale Board - Schematic 3
1k1%0603
R509
1M06031%
R507
1M06031%
R508
LOAD_CELL_PLUS
LOAD_CELL_MINUS
LOW_POWER_ON
ULTRA LOW POWER MONITORING AMPLIFIER
-A2
+A3
OUTA 1VSS
11
VDD
4
MCP6444
U500A
+B5
-B6
OUTB 7
+B
-B
OUTB
MCP6444
U500B
+C10
-C9
OUTC 8
+C
-C
OUTC
C
C
MCP6444
U500C
+D12
-D13
OUTD 14
+D
-D
OUTD
D
MCP6444
U500D
0.1uF16V0603
C500
100k06031%
R500
100k06031%
R501
100k06031%
R502
100k06031%
R504
100k06031%
R505
100k06031%
R506
1000pF50V0603
C501
P3V3
P3V3GND
GNDGND
P3V3
GND
10R06031%
R503
2019 Microchip Technology Inc. DS00003183A-page 31
AN
3183
DS
00
00
31
83
A-p
ag
e 3
2
20
19
Micro
chip
Te
chn
olo
gy In
c.
P3V3
PTS645SM43SMTR92 LFS
14
23
SW203
4.7k5%0603
R203
GND
BTN4
Button 4
GND
0.1uF16V0603
C203
A.4 Weight Scale Board - Schematic 4
P3V3
PTS645SM43SMTR92 LFS
14
23
SW200
4.7k5%0603
R200
GND
1D/1E/1G/1F1
DP1/1C/1B/1A2
2D/2E/2G/2F3
DP2/2C/2B/2A4
COM213
3D/3E/3G/3F5
DP3/3C/3B/3A6
4D/4E/4G/4F7
COL1/4C/4B/4A8
COL2/COL3/T1/W19
W5/W4/W3/W210
L1/L2/L3/L411
COM112
COM314
COM415 5F/5G/5E/5D 165A/5B/5C/DP5 176F/6G/6E/6D 186A/6B/6C/DP6 197F/7G/7E/7D 207A/7B/7C/DP7 21S4/S3/S2/S1 22S5/S6/S7/S8 238F/8G/8E/8D 248A/8B/8C/DP8 259F/9G/9E/9D 269A/9B/9C/DP9 2710F/10G/10E/10D 2810A/10B/10C/S9 291D/1E/1G/1FDP1/1C/1B/1A2D/2E/2G/2FDP2/2C/2B/2A
COM2
3D/3E/3G/3FDP3/3C/3B/3A4D/4E/4G/4FCOL1/4C/4B/4ACOL2/COL3/T1/W1W5/W4/W3/W2L1/L2/L3/L4COM1
COM3COM4 5F/5G/5E/5D
5A/5B/5C/DP56F/6G/6E/6D
6A/6B/6C/DP67F/7G/7E/7D
7A/7B/7C/DP7S4/S3/S2/S1S5/S6/S7/S8
8F/8G/8E/8D8A/8B/8C/DP8
9F/9G/9E/9D9A/9B/9C/DP9
10F/10G/10E/10D10A/10B/10C/S9
GDC0689
LCD200
BTN1
LCD_COM1LCD_COM2LCD_COM3LCD_COM4
LCD_SEG1LCD_SEG2LCD_SEG3LCD_SEG4LCD_SEG5LCD_SEG6LCD_SEG7LCD_SEG8LCD_SEG9
LCD_SEG10LCD_SEG11
LCD_SEG12LCD_SEG13LCD_SEG14LCD_SEG15LCD_SEG16LCD_SEG17LCD_SEG18LCD_SEG19LCD_SEG20LCD_SEG21LCD_SEG22LCD_SEG23LCD_SEG24LCD_SEG25
Driverless LCD
Button 1 P3V3
PTS645SM43SMTR92 LFS
14
23
SW202
4.7k5%0603
R202
GND
BTN3
Button 3P3V3
PTS645SM43SMTR92 LFS1
4
23
SW201
4.7k5%0603
R201
GND
Button 2
GNDGNDGND
BTN2
0.1uF16V0603
C2000.1uF16V0603
C2010.1uF16V0603
C202
2
01
9 M
icroch
ip T
ech
no
log
y Inc.
DS
00
00
31
83
A-p
ag
e 3
3
AN
3183
A.
GND
P3V3
GND
P3V3
GND
P3V3
GND
P3V3
10uF10V1206
C310
VCAP
GND
GND
LCDBIAS1
GND
LCDBIAS2
GND
LCDBIAS3
ND
BIAS0
PGDPGC
MCLR
P3V3
GND
P3V3
pacitors
asing capacitors
No-Leg
10k06035%
R300
F4
0.1uF16V0603
C3050.1uF16V0603
C3060.1uF16V0603
C3070.1uF16V0603
C3080.1uF16V0603
C309
LCDVLCAP1
LCDVLCAP2
GND
P3V3
0.1uF16V0603
C314
P5
P3V3
GND
HDR-2.54 Male 1x6
12
34
56
J301
PGDPGC
P3V3
GND
0.47uF10V0603
C3000.47uF10V0603
C3010.47uF10V0603
C3020.47uF10V0603
C3030.47uF10V0603
C311
5 Weight Scale Board - Schematic 5
SEG50/OCM1C/CTED3/RG151
Vdd2
LCDBIAS2/IC4/CTED4/PMD5/RE53
LCDBIAS1/SCL3/IC5/PMD6/RE64
LCDBIAS0/SDA3/IC6/PMD7/RE75
SEG32/RPI38/OCM1D/RC1 6
SEG51/RPI39/RC2 7
SEG33/RPI40/RC3 8
SEG52/AN16/RPI41/PMCS2/RC4 9
SEG0/AN17/C1IND/RP21/ICM1/OCM1A/PMA5/RG610
VLCAP1/AN18/C1INC/RP26/OCM1B/PMA4/RG711
VLCAP2/AN19/C2IND/RP19/ICM2/OCM2A/PMA3/RG812
MCLR13
SEG1/AN21/C1INC/C2INC/C3INC/RP27/DAC1/PMA2/PMALU/RG914
Vss15
Vdd16
TMS/SEG48/CTED14/RA0 17
SEG34/RPI33/PMCS1/RE818
SEG35/RPI34/PMA19/RE919
PGEC3/SEG2/AN5/C1INA/RP18/ICM3/OCM3A/RB5 20PGED3/SEG3/AN4/C1INB/RP28/USBOE/RB4 21SEG4/AN1-/AN3/C2INA/RB3 22SEG5/AN2/CTCMP/C2INB/RP13/CTED13/RB2 23PGEC1/SEG6/VREF-/CVREF-/AN1/AN1-/RP1/CTED12/RB1 24PGED1/SEG7/VREF+/CVREF+/DVREF+/AN0/RP0/RB0 25
PGEC2/LCDBIAS3/AN6/RP6/RB6 26
PGED2/SEG63/AN7/RP7/U6TX/RB7 27
SEG36/VREF-/CVREF-/PMA7/RA9 28
SEG37/VREF+/CVREF+/DVREF+/PMA6/RA10 29
AVREF+/DVREF+30
AVREF-/DVREF-31
COM7/SEG31/AN8/RP8/RB8 32
COM6/SEG30/AN9/TMPR/RP9/PMA7/RB9 33
COM5/SEG29/CVREF/AN10/SDO4/PMA13/RB10 34
AN11/REFI1/SS4/FSYNC4/PMA12/RB11 35
Vss36
Vdd37
TCK/RA1 38
SEG53/RP31/RF1339 SEG54/RPI32/CTED7/PMA18/RF1240
SEG18/AN12/U6RX/CTED2/PMA11/RB12 41
SEG19/AN13/SDI4/CTED1/PMA10/RB13 42
SEG8/AN14/RP14/CTED5/CTPLS/PMA1/PMALH/RB14 43
SEG9/AN15/RP29/CTED6/PMA0/PMALL/RB15 44
Vss45
Vdd46
SEG38/RPI43/RD14 47
SEG39/RP5/RD15 48
SEG10/RP10/PMA9/RF449
SEG11/RP17/PMA8/RF550
SEG12/RP16/USBID/RF351 SEG40/RP30/IOCF2/RF252
SEG41/RP15/IOCF8/RF853 VBUS/RF754
Vusb3v355
D-/RG356 D+/RG257
SEG55/SCL2/RA2 58
SEG56/SDA2/PMA20/RA3 59
TDI/PMA21/RA4 60
TDO/SEG28/RA5 61
Vdd62
OSCI/CLKI/RC12 63
OSCO/EOSCEN/CLKO/RC15 64
Vss65
SEG42/RPI36/SCL1/PMA22/RA14 66
SEG43/RPI35/SDA1/PMBE1/RA15 67
SEG13/CLC4OUT/RP2/RTCC/U6RTS/U6BCLK/ICM5/RD8 68
SEG14/AN22/RP4/PMACK2/RD9 69
SEG15/C3IND/RP3/PMA15/PMCS2/RD10 70
SEG16/C3INC/RP12/PMA14/PMCS/PMCS1/RD11 71
SEG17/CLC3OUT/RP11/U6CTS/ICM6/INT0/RD0 72
SOSCI/RC13 73
SOSCO/SCLKI/RPI37/PWRLCLK/RC14 74
Vss75
SEG20/RP24/U5TX/ICM4/RD1 76
SEG21/AN23/RP23/PMACK1/RD2 77
SEG22/RP22/ICM7/PMBE0/RD3 78
SEG44/RPI42/PMD12/RD12 79
SEG45/PMD13/RD13 80
SEG23/RP25/PMWR/PMENB/RD4 81
SEG24/RP20/PMRD/PMWR/RD5 82
SEG25/C3INB/U5RX/OC4/PMD14/RD6 83
SEG26/AN20/C3INA/U5RTS/U5BCLK/OC5/PMD15/RD7 84
VCAP85
VBAT86
SEG27/U5CTS/OC6/PMD11/RF087
COM4/SEG47/SCK4/PMD10/RF188
SEG46/PMD9/RG189 SEG49/PMD8/RG090
SEG57/AN23/OCM1E/RA6 91
SEG58/AN22/OCM1F/PMA17/RA7 92
COM3/PMD0/RE093
COM2/PMD1/RE194
SEG59/CTED11/PMA16/RG1495
SEG60/RG1296
SEG61/CTED10/RG1397
COM1/PMD2/RE298
COM0/CTED9/PMD3/RE399
SEG62/LVDIN/CTED8/PMD4/RE4100
PIC24FJ256GB410
U300
USB_PRESENT
ANALOG_POWER_ON
DIGITAL_POWER_ON
GND
P3V3
P3V3
VCAP
GND
LCD_COM1LCD_COM2LCD_COM3LCD_COM4
LCD_SEG1
LCD_SEG2LCD_SEG14
LCD_SEG15
G
LCD
LCDBIAS0LCDBIAS1LCDBIAS2
LCDBIAS3
ADC_nCS
ADC_MISO
ADC_SCKADC_MOSI
I2C_SCKI2C_SDA
VBAT_MEASURE
MCLR
PGDPGC
ICSP
Microcontroller
Decoupling Ca
LCD Module bi
123456
TAG 6P
J300
BTN3
USB_D_PUSB_D_N
LOW_POWER_ON
ANALOG_PGOOD
0.1u16V0603
C30
LCD_SEG21
LCD_SEG3
LCD_SEG7
LCD_SEG8
LCD_SEG9
LCD_SEG19
LCD_SEG20
LCD_SEG16
LCD_SEG18
LCD_SEG12
LCD_SEG6
LCD_SEG4
LCD_SEG17
LCD_SEG13
LCDVLCAP2LCDVLCAP1
P3V3
V0_USB
100R06035%
R302
0R0603
R301
P3V3
OSCI
OSCO
OSCI
OSCO22pF50V0603
C313
22pF50V0603
C312
GND
OSCILLATOR
BTN4
LCD_SEG10
LCD_SEG5
LCD_SEG11
LCD_SEG22
LCD_SEG23
LCD_SEG24
LCD_SEG25
8MHz
Y300
LOAD_CELL_ON
BTN1BTN2
EXT_PGA_ON
ADC_nDRADC_CLKIN
P3V3
GND
AN3183
A.7 Weight Scale Board - Top Copper and Silk
2019 Microchip Technology Inc. DS00003183A-page 35
AN3183
A.10 Weight Scale Board - Bottom Copper and Silk
2019 Microchip Technology Inc. DS00003183A-page 38
Note the following details of the code protection feature on Microchip devices:
• Microchip products meet the specification contained in their particular Microchip Data Sheet.
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of ourproducts. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such actsallow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding deviceapplications and the like is provided only for your convenienceand may be superseded by updates. It is your responsibility toensure that your application meets with your specifications.MICROCHIP MAKES NO REPRESENTATIONS ORWARRANTIES OF ANY KIND WHETHER EXPRESS ORIMPLIED, WRITTEN OR ORAL, STATUTORY OROTHERWISE, RELATED TO THE INFORMATION,INCLUDING BUT NOT LIMITED TO ITS CONDITION,QUALITY, PERFORMANCE, MERCHANTABILITY ORFITNESS FOR PURPOSE. Microchip disclaims all liabilityarising from this information and its use. Use of Microchipdevices in life support and/or safety applications is entirely atthe buyer’s risk, and the buyer agrees to defend, indemnify andhold harmless Microchip from any and all damages, claims,suits, or expenses resulting from such use. No licenses areconveyed, implicitly or otherwise, under any Microchipintellectual property rights unless otherwise stated.
2019 Microchip Technology Inc.
For information regarding Microchip’s Quality Management Systems, please visit www.microchip.com/quality.
TrademarksThe Microchip name and logo, the Microchip logo, Adaptec, AnyRate, AVR, AVR logo, AVR Freaks, BesTime, BitCloud, chipKIT, chipKIT logo, CryptoMemory, CryptoRF, dsPIC, FlashFlex, flexPWR, HELDO, IGLOO, JukeBlox, KeeLoq, Kleer, LANCheck, LinkMD, maXStylus, maXTouch, MediaLB, megaAVR, Microsemi, Microsemi logo, MOST, MOST logo, MPLAB, OptoLyzer, PackeTime, PIC, picoPower, PICSTART, PIC32 logo, PolarFire, Prochip Designer, QTouch, SAM-BA, SenGenuity, SpyNIC, SST, SST Logo, SuperFlash, Symmetricom, SyncServer, Tachyon, TempTrackr, TimeSource, tinyAVR, UNI/O, Vectron, and XMEGA are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
APT, ClockWorks, The Embedded Control Solutions Company, EtherSynch, FlashTec, Hyper Speed Control, HyperLight Load, IntelliMOS, Libero, motorBench, mTouch, Powermite 3, Precision Edge, ProASIC, ProASIC Plus, ProASIC Plus logo, Quiet-Wire, SmartFusion, SyncWorld, Temux, TimeCesium, TimeHub, TimePictra, TimeProvider, Vite, WinPath, and ZL are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut, BlueSky, BodyCom, CodeGuard, CryptoAuthentication, CryptoAutomotive, CryptoCompanion, CryptoController, dsPICDEM, dsPICDEM.net, Dynamic Average Matching, DAM, ECAN, EtherGREEN, In-Circuit Serial Programming, ICSP, INICnet, Inter-Chip Connectivity, JitterBlocker, KleerNet, KleerNet logo, memBrain, Mindi, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, PowerSmart, PureSilicon, QMatrix, REAL ICE, Ripple Blocker, SAM-ICE, Serial Quad I/O, SMART-I.S., SQI, SuperSwitcher, SuperSwitcher II, Total Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.The Adaptec logo, Frequency on Demand, Silicon Storage Technology, and Symmcom are registered trademarks of Microchip Technology Inc. in other countries.GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries. All other trademarks mentioned herein are property of their respective companies.
© 2019, Microchip Technology Incorporated, All Rights Reserved.
ISBN: 978-1-5224-5214-0
DS00003183A-page 41
DS00003183A-page 42 2019 Microchip Technology Inc.
AMERICASCorporate Office2355 West Chandler Blvd.Chandler, AZ 85224-6199Tel: 480-792-7200 Fax: 480-792-7277Technical Support: http://www.microchip.com/supportWeb Address: www.microchip.com
AtlantaDuluth, GA Tel: 678-957-9614 Fax: 678-957-1455
Austin, TXTel: 512-257-3370
BostonWestborough, MA Tel: 774-760-0087 Fax: 774-760-0088
ChicagoItasca, IL Tel: 630-285-0071 Fax: 630-285-0075
DallasAddison, TX Tel: 972-818-7423 Fax: 972-818-2924
DetroitNovi, MI Tel: 248-848-4000
Houston, TX Tel: 281-894-5983
IndianapolisNoblesville, IN Tel: 317-773-8323Fax: 317-773-5453Tel: 317-536-2380
Los AngelesMission Viejo, CA Tel: 949-462-9523Fax: 949-462-9608Tel: 951-273-7800
Raleigh, NC Tel: 919-844-7510
New York, NY Tel: 631-435-6000
San Jose, CA Tel: 408-735-9110Tel: 408-436-4270
Canada - TorontoTel: 905-695-1980 Fax: 905-695-2078
ASIA/PACIFICAustralia - SydneyTel: 61-2-9868-6733
China - BeijingTel: 86-10-8569-7000
China - ChengduTel: 86-28-8665-5511
China - ChongqingTel: 86-23-8980-9588
China - DongguanTel: 86-769-8702-9880
China - GuangzhouTel: 86-20-8755-8029
China - HangzhouTel: 86-571-8792-8115
China - Hong Kong SARTel: 852-2943-5100
China - NanjingTel: 86-25-8473-2460
China - QingdaoTel: 86-532-8502-7355
China - ShanghaiTel: 86-21-3326-8000
China - ShenyangTel: 86-24-2334-2829
China - ShenzhenTel: 86-755-8864-2200
China - SuzhouTel: 86-186-6233-1526
China - WuhanTel: 86-27-5980-5300
China - XianTel: 86-29-8833-7252
China - XiamenTel: 86-592-2388138
China - ZhuhaiTel: 86-756-3210040
ASIA/PACIFICIndia - BangaloreTel: 91-80-3090-4444
India - New DelhiTel: 91-11-4160-8631
India - PuneTel: 91-20-4121-0141
Japan - OsakaTel: 81-6-6152-7160
Japan - TokyoTel: 81-3-6880- 3770
Korea - DaeguTel: 82-53-744-4301
Korea - SeoulTel: 82-2-554-7200
Malaysia - Kuala LumpurTel: 60-3-7651-7906
Malaysia - PenangTel: 60-4-227-8870
Philippines - ManilaTel: 63-2-634-9065
SingaporeTel: 65-6334-8870
Taiwan - Hsin ChuTel: 886-3-577-8366
Taiwan - KaohsiungTel: 886-7-213-7830
Taiwan - TaipeiTel: 886-2-2508-8600
Thailand - BangkokTel: 66-2-694-1351
Vietnam - Ho Chi MinhTel: 84-28-5448-2100
EUROPEAustria - WelsTel: 43-7242-2244-39Fax: 43-7242-2244-393
Denmark - CopenhagenTel: 45-4450-2828 Fax: 45-4485-2829
Finland - EspooTel: 358-9-4520-820
France - ParisTel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79
Germany - GarchingTel: 49-8931-9700
Germany - HaanTel: 49-2129-3766400
Germany - HeilbronnTel: 49-7131-72400
Germany - KarlsruheTel: 49-721-625370
Germany - MunichTel: 49-89-627-144-0 Fax: 49-89-627-144-44
Germany - RosenheimTel: 49-8031-354-560
Israel - Ra’anana Tel: 972-9-744-7705
Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781
Italy - PadovaTel: 39-049-7625286
Netherlands - DrunenTel: 31-416-690399 Fax: 31-416-690340
Norway - TrondheimTel: 47-7288-4388
Poland - WarsawTel: 48-22-3325737
Romania - BucharestTel: 40-21-407-87-50
Spain - MadridTel: 34-91-708-08-90Fax: 34-91-708-08-91
Sweden - GothenbergTel: 46-31-704-60-40
Sweden - StockholmTel: 46-8-5090-4654
UK - WokinghamTel: 44-118-921-5800Fax: 44-118-921-5820
Worldwide Sales and Service
05/14/19