Voltage, current and power monitoring embeded system - Page 1
Forum section: electronics / general

author: RokKol5230
author_rank: Newbie
timestamp: January 12, 2022, 11:56:39 am
content: Hello,Guys I need to make small embedded systems, for measuring current, voltage and power. I need to measure voltage from 0V to 60V with 10mV step. I'am talking only about DC. Forgot to mention. Current limit for the system is 5A, with 1mA step. I' am designing system which will be placed between power supply and load and my system using usb protocol will send data to pc. Also I need to add oled screen for simple user interface. I'am thinking about using TexasInstruments ina239 amp.https://www.ti.com/lit/ds/symlink/ina239.pdf?ts=1641979242774&ref_url=https%253A%252F%252Fwww.google.com%252FWhat do you think about this conception? Maybe you have some ideas, how I should measure my parameters? Thanks.Rokas

author: ejeffrey
author_rank: Super Contributor
timestamp: January 13, 2022, 04:01:17 am
content: There are premade power monitor ICs such as the isl28022 that do voltage and current monitoring with an I2C interface. You would still need a microcontroller with USB and whatever display interface you wantEdit: nevermind. I thought the TI part you referenced was just a differential amplifier. I see that it is similar to the ISL part I referenced

author: mariusT
author_rank: Newbie
timestamp: January 13, 2022, 05:38:59 am
content: Just some very general notes. There are different measuring principle to choose from. There are some advantages and disadvantages to the different forms of measurement. For low cost and simple use the IC you mentioned should be a good choice. Of course you loose some power with the drop across the shunt. You probably want to calculate your shut resistance, maximum voltage drop and total precision to make sure that the circuit will do what you intend it to do and that you operate the IC within its limits.Other than that there should be no big obstacles

author: Nominal Animal
author_rank: Super Contributor
timestamp: January 13, 2022, 07:06:06 am
content: This may not help you, but since it is kind-of related, perhaps it'll be of use. Note that I am only a hobbyist on the electronics side.I have quite a few Single-Board Computers (SBCs) running Linux. A particular one I like is Odroid HC1, a variant of the XU4 with a SATA connector. It needs 5 VDC in, and depending on what kind of a hard drive is connected, up to 4-6 A of current. For this, I've designed a couple of carrier boards that measure the current consumption, have a P-channel MOSFET as a high side power switch (to shut down power to the SBC), and measure the voltage; most recent isthis Teensy 3.2 carrier for Odroid HC1which includes UART level shifters (since Odroid HC1 uses 1.8V UART signal levels).I am not that interested in average power consumption, and more interested in the instantaneous voltage and current, to detect voltage glitches and current spikes.These SBCs don't have much capacitance, and tend to have "spiky" current needs, which on some power supplies may also glitch the voltage.(HC2 switched to 12V input, and Odroid HC4 takes 14.5V to 15.5V input, and has onboard DC-DC converters, to avoid power supply issues.)Teensy 3.2 has two separate ADCs (that can be synchronized), with something like 12 effective bits at ~ 100kHz sample rate using DMA. Using triple buffering, there is ample time to both detect spikes and calculate the power integral at that rate, and report them via USB or UART.My point is that this glitch monitoring has turned to be quite useful to me. It does not tell mewhatcauses them, but when they occur, the system is usually unstable, and the correlation is so high I now practically causate the two: randomly occurring hard to reproduce "software" issues tend to occur due to power glitches.So, if I were to create an appliance for monitoring voltage, current, and power, I would definitely not limit to just averages; I would also generate and display a histogram (on the horizontal axis the voltage, and on the vertical axis, a bar that represents the fraction of time that voltage was measured). The voltage is particularly useful, because if the power supply is not "stiff" enough, or the system needs more bulk capacitance, the histogram will be "wide", smeared somewhat below the nominal voltage of the power supply. If the power supply can keep the voltage well regulated even when the device gulps power in short spikes instead of continuously, then the voltage histogram stays as a narrow spike. (On the HC1, the range I'm interested in is as narrow as 4.5 to 5.5 volts or less; not the full voltage range I can measure.) Again, a wobbly voltage rail often explains otherwise unexplained software glitches, and having that sort of a tool is very, very useful to me.Note that Teensy 3.2 is under $20, so I'm working in El Cheapo style; this is just a hobby for me, for my own use.It may sound odd, but personally, since INA239 itself isn't too expensive, I would consider using one for "low-frequency" (say, ~ 100 Hz) measurement, and another or something else for the high-frequency voltage analysis. If you use a microcontroller, perhaps it has an ADC that can be used for voltage measurement using say a 1:20 voltage divider, for the high frequency measurement. However, only say the 10% region below the nominal voltage is interesting for the voltage histogram; so perhaps a circuit could be devised to map the top 10% of the measured voltage rail to the microcontroller ADC range? I dunno, but it might be useful.

author: RokKol5230
author_rank: Newbie
timestamp: January 14, 2022, 04:13:27 pm
content: Thank you all guys!