External Energy Meter
"Now isn't THAT convenient!"
By Noah Schwartz and Nathan Mattock
February 2023 - May 2023
"Now isn't THAT convenient!"
By Noah Schwartz and Nathan Mattock
February 2023 - May 2023
This is the External Energy Meter, an instrument droid project that utilizes a SAMD21 microcontroller to accurately measure the power consumption of a system while ensuring minimal impact on its performance.
Specifically designed to measure systems within a voltage range of 0-25V and a current range of 0-5A, this project incorporates the ADS1115 and INA219 ADCs for precise power measurements. Part of the project aims at testing the accuracy of the measurements, which is talked about more in a section below. The software controls the taking of measurements by taking the average voltage (V), current (A), and power (W) over 100ms. The results are read out to the user on the serial monitor.
Throughout the project, I have honed my skills in electrical engineering, circuit design, and microcontroller programming, which served as a remarkable opportunity for me to expand my expertise and grow as a professional.
This circuit is designed as a voltage divider, with the ADC(s) measuring the voltage across the R_Sense resistor. To ensure minimal impact on the performance of the circuit being measured, R_Sense is chosen to have a very small resistance (recommended range of 1.5 Ohms - 10 Ohms).
In addition to R_Sense, there are the100K Ohm resistors (top left and top right of the diagram) that serve to limit current draw. Furthermore, the presence of 100k-1M Ohm resistors is essential because we are working with voltages higher than what the SAMD21 microcontroller can directly read. This requires both a voltage divider and scaling the resistances in accordance with the SAMD21's voltage limit of 3.3V.
The below tables present the results obtained by measuring power consumption with varying circuit resistances and input voltages. The "IC error" represents the percentage error in power measurement using the INA219, while the "differential error" reflects the percentage error using the ADS1115. Additionally, tests were conducted using both the INA219 and ADS1115 simultaneously, which is indicated in the last column of the table. Before running these tests, it was predicted that as the current decreases, the accuracy of the ADCs decreases as well. Consequently, an increase in resistance is expected to correspond to a higher percentage error in the measurement. Whether or not this prediction is true will be discussed below
Based on the results presented in the above tables, the accuracy testing section confirmed my initial prediction. As the resistance increased, the percentage error in the measurements also increased. A comparison between the two ADCs used revealed that the INA219 is more accurate than the ADS1115 for voltages exceeding 5V. During testing, it was observed that the ADS1115 exhibited significant inaccuracies in measurements for input voltages of 20V or higher, with percentage errors reaching as high as 2300% for high resistances. In contrast, the INA219 demonstrated a more modest 26% percentage error for the same measurement. Consequently, it can be confidently concluded that the INA219 offers superior accuracy.
When both the ADS1115 and INA219 were used together, the results yielded the most accurate readings up to 20V, beyond which the ADS1115's accuracy deteriorated. Based on these findings, it is recommended to utilize both the ADS1115 and INA219 for power measurement readings below 20V to achieve the highest accuracy. However, for measurements exceeding 20V, it is advisable to solely rely on the INA219.
This lab experiment has emphasized the significance of thoroughly testing ADCs utilized for measurements. While ADCs may not always provide absolute accuracy, being aware of their limitations and inaccuracies is crucial for engineers in order to make informed decisions.
Overall, these results have provided valuable insights and deepened my understanding of the importance of accurate ADC selection and their implications in measurement applications
Given additional time with the project, further efforts would be directed towards exploring additional methods to reduce the percentage error in measurements. One potential avenue for improvement would involve incorporating a current hall effect sensor into the setup. This approach could enhance the accuracy and precision of the measurements by providing a more direct and reliable means of current detection.Â