# Measuring Current through Various resistors, but selecting them digitally

Discussion in 'The Projects Forum' started by Marquis, Jul 25, 2015.

1. ### Marquis Thread Starter New Member

Jan 18, 2015
16
0
Hi,

So, I'm trying to measure the current that a small 6V solar panel can produce. I am using an arduino to do this. But I need to plot a few points using various resistor loads. How do I go about digitally changing the resistance?

Do I need to use a few transistors to enable resistors, then use a various voltage dividers to scale things for the measurement?

2. ### GopherT AAC Fanatic!

Nov 23, 2012
6,314
4,034
It depends on the size of the load. Are you talking milliamperes, amps, tens of amps, ...

Also, why at is the goal of making this measurement? To select solar panels in an array, a simple experiment, to adjust the angle/orientation of the panels, ...

3. ### Marquis Thread Starter New Member

Jan 18, 2015
16
0
The range is milliamps. Around 1 - 300 mA. The purpose it to test the solar panel under different conditions. Weather, orientation, etc.

4. ### nsaspook AAC Fanatic!

Aug 27, 2009
3,013
2,367
Last edited: Jul 26, 2015
5. ### AnalogKid Distinguished Member

Aug 1, 2013
4,696
1,297
For an array of different resistors switched to the same panel, measuring the voltage across the resistor gets you the current and power being delivered. For whatever the switching device is, the lower its resistance compared to the resistor being switched, the less if degrades the accuracy of the measurement. To draw 300 mA at 6 V you need a 20 ohm resistor, so that is the smallest element in the switched array. If the switching device has less than 0.2 ohm resistance, if affects the measurement by less than 1%. You can achieve this with a group of small relays or medium-power MOSFETs. The "right" way is to use P-channel FETs so the resistor grounds, solar panel ground, and A/D ground all are the same.

IF the Arduino has multiple A/D input channels:
Arduino digital output - NPN small signal open collector driver transistor - P-channel MOSFET, source to the panel, drain to its load resistor and A/D channel input, other end of load resistor to GND.

If you use larger power MOSFETs with lower Rdson, you might get away with measuring the load resistor + FET resistance. In this case:
Solar panel + output to one end of all load resistors and one A/D channel input. Each resistor's other end to one N-channel power MOSFET drain. All MOSFET Sources to GND. One Arduino digital output to each Gate.

ak

6. ### cmartinez AAC Fanatic!

Jan 17, 2007
3,698
2,789
If your goal is to make continuous measurements of the current your panels are producing, I'd seriously consider using a commercial multimeter to do so. It would save you the hassle of designig and programing your circuitry, plus most of them have software readily available for log keeping.

Lestraveled likes this.
7. ### Lestraveled Well-Known Member

May 19, 2014
1,957
1,218
I second what C. said. The USB or RS-232 meters are cheap, versatile, and accurate.

8. ### Lestraveled Well-Known Member

May 19, 2014
1,957
1,218
Also, reread post #4. It appears what you are doing is taking data for a MPPT, Maximum Power Point Tracker. You don't need multiple loads to characterize a solar panel.

cmartinez likes this.
9. ### Alec_t AAC Fanatic!

Sep 17, 2013
5,975
1,135
I'm with nsaspook on this. If you just 'short' the cell with a single 10Ω resistor then 0-300mA should result in 0-3V across the resistor for logging.

10. ### Marquis Thread Starter New Member

Jan 18, 2015
16
0
Okay.. Thanks, I get that simply using a meter would be easier.

So when I check the open voltage I get around 6.5 volts. Connecting a 15 R resistor gives me a current off about 5-50 mA but at between .5-2 volts. Does this sound right? I guess it could be since it's not super super bright out.

The question again though is how to design the circuit. I want to be able to test the open voltage, but also the voltage under load.

I had thought I could use a transistor that when "off", would allow me measure just the open voltage, but then when I used the processor to open the transistor for the load, I could measure that power, but the problem is that at this low power levels, what I'm measuring is really the power going through the base of the transistor plus the power coming from the panel. How do I switch to be able measure the open voltage, then the voltage and current under different resistor loads (without just measuring the voltage that I'm sending to the base of the transistor).

I think I'm close to what AnalogKid described... But I'm unclear how his solution avoids the problem I've described. Ideas?

11. ### Lestraveled Well-Known Member

May 19, 2014
1,957
1,218
There is something wrong with your numbers. 2 volts / 15 ohms = .133 amps. That is not what you are getting. How are you making your measurements? Do you have a multimeter?

12. ### Marquis Thread Starter New Member

Jan 18, 2015
16
0
That is what I am trying to test. The numbers are the accurate measurements. Those measurements are under different conditions though. The panel gives 2 volts when open, but drops to nearly no volts when under the 15 ohm load. That is why I need to be able to measure the panels both open and under load.

I have confirmed the numbers with a multimeter.

13. ### Alec_t AAC Fanatic!

Sep 17, 2013
5,975
1,135
Another option would be to use a MOSFET as a constant-current load on the cell, the current being set by the micro that does the logging of cell voltage.