1
\$\begingroup\$

So, the condition is there is a Photo Voltic (PV) module connected to a microcontroller (directly to pin 5 and assume that PV module is generating 3V, hypothetically!).

I am wondering if I can some how write a microcontroller firmware or algorithm (may be in c/c++) to know what value of voltage and current I am getting from the small PV module.

Is this possible or I should have to have something in between PV module and controller? I haven't done any physical connection as described but just curious to know.

\$\endgroup\$
  • \$\begingroup\$ If the MCU has a hardware capability of measuring it (which is rarely the case). \$\endgroup\$ – Eugene Sh. Aug 22 '17 at 20:39
  • 1
    \$\begingroup\$ Is there any MCUs like that which provides these kinds of capabilities? \$\endgroup\$ – Rajan Aug 22 '17 at 20:41
  • \$\begingroup\$ You better tell us what you are trying to do. Product recommendations are off-topic here. \$\endgroup\$ – Eugene Sh. Aug 22 '17 at 20:42
  • 1
    \$\begingroup\$ Sounds like you just need an MCU with an ADC? \$\endgroup\$ – Dejvid_no1 Aug 22 '17 at 20:44
  • 4
    \$\begingroup\$ Most MCUs now can measure voltage, so that's easy - but not current. Usually you would need a current shunt and a suitable amplifier to get an appropriate voltage, which you can measure with another ADC channel on the MCU. \$\endgroup\$ – Brian Drummond Aug 22 '17 at 20:52
1
\$\begingroup\$

With an MCU, the easiest way it to delegate the measurement task to a dedicated circuit called "charge monitor", with I2C interface. These ICs can be found in section "PMIC-current regulation/management" at say, Digi-Key. An example is the Texas Instruments INA219. There are many similar circuits, from Maxim, etc.

The IC will take care of all analog business, all self-contained, and simple I2C reads will give you Voltage, Current, and even calculated instant Power. All you need is the IC, and a sense resistor (20 - 100 mOhms), depending on desired current range and IC gain grade.

Of course you can do this with a MCU with a built-in ADC, but you will still need a differential current-to-voltage converter, and another ADC channel to measure the voltage itself. Some MSU have differential configuration for ADC channels, which could help to measure the shunt resistor directly.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ @ Ali: Thanks for the answer. I want to replace any possible physical parts in my design and want to replace its (that IC you mentioned) functionality by some code and only want to use in-built MCU functionalities (like ADC) \$\endgroup\$ – Rajan Aug 23 '17 at 19:53
0
\$\begingroup\$

If you just want to know whether the PV voltage is high enough to run your MCU, then what you're looking for is an IC called a voltage supervisor. These measure the supply voltage and output a digital signal that toggles when the voltage crosses a threshold. Typically they're used to hold the MCU in reset while the voltage is low. You could probably rig up a controlled shutdown with a few more components.

If you actually want a real voltage and current measurement, you're going to need an ADC. You can divide down the supply voltage with resistors and measure the result. If you have a differential ADC, you can measure the supply current by measuring the voltage across a shunt resistor. If your MCU doesn't have those, you'll need external components. You'll probably need a separate reference voltage to make these reliable. There are ICs for that too.

|improve this answer|||||
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.