Solar power: Arduinos taking over our farm

So I flipped through my journal of ideas this afternoon and realized that my Arduino and electronics skills are getting to the point where I could probably complete several of them. These projects would actually be useful, which might get my SO to forgive my constant tinkering and understand why there are miscellaneous electronics scattered across the dining room table every so often.

In any case, one of the projects involves a solar powered water pump. Unless you enjoy thinking about livestock watering systems, it's pretty boring, so I will distil the background details down to this:

  • A 40W solar panel powers everything (voltage varies between 0V and 25V)
  • The pump is a 12V Shurflo 2088, drawing at most 9A, and includes a pressure switch
  • The pump should only run about one minute out of ten.
  • Water is pumped up a hill until a float valve closes and the pressure on the output of the pump switches the pressure switch off.

My current system has no intelligence, and is dead simple. It uses a linear current booster marketed for exactly this type of system, which allows the pump to work at lower voltages, but is expensive and short-lived. The system boils down to the pump, solar panel and linear current booster, and works well until the pressure switch sticks closed.

I'd like to enforce the one minute out of ten limit, record statistics on how much the pump has run over the last couple of days, and possibly record the flow so that I can figure out just how much water is being consumed. I can see how an Arduino, some sensors, and a relay could handle this. I can imagine a much more comprehensive system, with a LCD display, some buttons, and a full-blown user-interface, or adding a couple of nRF24L01 transceivers a Raspberry Pi, and a web interface, but I want to keep this dead-simple for the time-being.

Background finished.

What I don't really understand is how the Arduino will behave as power from the solar panel wanes to nothing at night. Do Arduinos shut off in a graceful fashion? I could integrate a battery and charger, configured to charge the battery when the sun is shining but the pump isn't running, but I can see some gotchas down this path and would rather embrace the simplicity of letting it die at night.

I'm thinking that the sketch will only trigger the pump when there is plenty of power available, but I'm not really sure if just keying off a voltage threshold will be enough. I'm also concerned that the pump may consume so much power that the Arduino dies, but I have no idea how one would guarantee power for the Arduino at the expense of the pump.

Those are my main concerns. Perhaps there is something else that I'm missing. (There usually is.) Comments and suggestions are welcome.

You will need to power the Arduino from its own source other wise it will turn on and off as load is turned on and voltage drops.

Use a battery charged by the solar and use the Arduino to control the charge. Use solar only for the pump.


Thanks for the reply Weedpharma.

I was imagining using a voltage divider to monitor the raw voltage coming from the solar panel via one of the analogue pins. My thought was that I could trigger the pump when the voltage was higher than some threshold T1, and stop the pump when the voltage dropped below some threshold T2, where T1>>T2. My hope was that this bit of smarts would allow me to take the linear current regulator (expensive and short-lived) out of the loop.

But I take it that the voltage will fall too quickly...unless I used a much larger solar panel or a smaller pump.

Come to think of it... I could mock this up with my current inventory. I'd have to trigger the pump manually since I don't have a large relay, but it might be a fun experiment... Unless it is patently obvious that it wouldn't work and that seems to be what you are saying.

The solar panel will provide only about 2 amperes maximum, so you will need some sort of step down regulator, or as in the more usual case, have the solar panel charge a 12V battery that powers the pump. The battery is the way to go, but you would need a smart controller for the pump and to prevent the battery from being over-discharged.

That the "linear current regulator" (whatever that is) is short lived -- sounds like a very bad design.

There are pump drivers that use the fact that the panel will give a usable voltage but low current to charge a capacitor. Once a suitable voltage is reached in the capacitor, it is switched across the pump. It is virtually PWM.

This will still need to be done unless a battery is used.


Hmmm... The battery seems like the only way to go. I really like the idea of using capacitors as they shouldn't require replacement for a very long time. Basically the same idea.

I used to use a charge controller and a battery, but the linear current regulator meant a battery wasn't necessary, making the whole system much easier to drag from place to place.

What's a linear current regulator? I'm not really sure, but it allows the pump to start with less light, although it runs quite slowly. My guess is that it's a boost converter. It certainly makes a big difference at the end of the day, not that I need a lot of volume under regular circumstances. I've found the charge controllers and linear current regulators to fail in their second season, which is one of the reasons I'm looking at other options, although protecting the pump and getting stats is a big draw too.

Ha! In looking for an Arduino-based charge controller, I ran across an Instructables article that looks like it can form the basis of my system. The theory is well-explained too.

A good quality deep-cycle lead acid battery, if treated properly, should last for several years.

Starting a 9A DC motor with a 9A solar string should work, but the motor will run up to speed slowly (I think). Starting the motor from a battery will pull many times the motor rated current until it is up to speed, but the motor will start very fast.

I like the idea of using a small solar panel and intermittently running from a battery, but that may not be a durable solution. A 9 Amp panel should start the motor as a near short circuit, e.g. voltage very low (may reset Arduino?) and then ramp up as the motor speed increases, which is what you are doing (right?). You could charge a small (ish) battery from that big panel while it was not in use or not pulled down by the motor voltage (12V?), but start and run the motor off solar power alone. This ideal diode may give some ideas:

You may also want to look at my side project: Warning it is not yet tested, but could be used to charge a 6V SLA type battery to power the Arduino while the Arduino controls the Shurflo pump. In theory, the small charge control turns off when the string voltage drops bellow 14.3V, which it will when the motor is on.

If you want to use a single LiPo cell then look at:

With a bit of effort and one of the smaller Arduinos (nano, mini etc) you can run the Arduino for months or years off a button cell battery. The amount of power it requires can be extremely small. However, as you have calculated, it does require voltage and won't play well with a low-impedance load on a high-impedance power supply.

I would set up a small rechargeable battery with a diode so that it can't be dragged down when the motor kicks in. Maybe pull apart a cheap solar light set and use that charging circuit and battery. (Maybe keep the small solar cell too!) Then make sure that you have enough protection on the Arduino's inputs that are connected to the 'raw' solar supply. You effectively create two power supplies. Any connection between the two power supplies should be isolated from faults on the other side. Consider what might happen if lightning strikes nearby - you will get a lot of volts appear on any long wires nearby. A direct hit will destroy any protection you could add so at that point you are more concerned about not letting the fire spread too far.

Then add an SD card for data logging or a wireless link so you can drive by with your laptop and download a week's data.

works well until the pressure switch sticks closed.

How often does this happen?

I thought those pumps were very reliable. Is it possible your solar panel is feeding a too-high voltage into the system some of the time and causing arcing at the switch contacts?

I agree with the advice of others to use the solar panel to charge a substantial 12v lead-acid battery and run the pump (and the Arduino) from the 12v system.


The reason for using the linear current booster is that it starts pumping long before the panel is producing full energy. If you wait for a set voltage, it will be achieved long before you can get any real current out of it. In that case you cannot use the panel by simply connecting the motor. This is were LCB comes in.

You could have the panel charging a capacitor until it reaches a usable voltage and dump it into the pump. By repeatedly doing this, you get the pump producing earlier in the day and later into the afternoon. This is how the MPPT works.

This can be done by the Arduino.


Monitor the energy production of a wind turbine with GREEN POWER METER :

Thanks all. Lots to think about here.

My aim is to get something simple up and running first, then play with whatever options seem the most beneficial from there. I have several other projects that are similar to this solar water pumping system, and many projects that could borrow aspects of it (ie. a system to keep the Arduino running from battery), so it is worthwhile to stray from the shortest path a bit.

weedpharma, I really like the idea of using a capacitor to store up a useful amount of energy. My guess is that I would need a lot of capacitance to run the pump enough to be useful, but this is definitely something I want to explore.

Robin2, how often does the pressure switch stick closed? A new pump head (which includes the pressure switch) will generally work reliably for one season. It will begin sticking in its second season. I think the problem is that I'm pumping pond water. The pond water is filtered by two coarse filters before it hits the pump, but algae still makes it through. I've tried disassembling the pump head and cleaning everything thoroughly. This seems to help, but the pressure switch just seems to go downhill no matter what I do. Unfortunately, the pressure switch doesn't seem to be replaceable except as part of the whole pump head. Using a separate pressure switch is another reason I'm delving into this project.

MorganS, the wireless link is definitely an option. I actually don't find that to be daunting. It's the electrical stuff that makes me scratch my head. I like the diode idea. I imagine that one could use a diode and capacitor to run the Arduino for a significant amount of time, long enough that running the pump off battery power causes no issue.

The term "linear current booster" was evidently recently invented by the solar power industry and is a misnomer. These are ordinary switching DC-DC converters that increase the current at the expense of voltage.

There is absolutely no excuse for such things to be short-lived or even expensive, as switching power supplies are now in just about every piece of modern electronics. Very few fail after "one season" of use.

A capacitor is unlikely to be useful in this situation, as it would have to be enormous* to power a 9 ampere, 12V motor for even a few milliseconds. Don't forget that DC motors briefly draw the stall current each time they start up.

I would go with a deep cycle battery, a charge controller and a programmable motor controller. All of these components are standard and you can expect many years of service.

*Suppose the capacitor is to power the pump for 0.1 seconds and we allow the voltage across capacitor to drop from 12 to 6 V during that time. The required capacitance can be estimated from the fundamental relationship Q = CV or I = C dV/dt. Plugging in I = 9 amps and dV/dt = 6V/.1s, C= 0.15 Farads!

Rural: how often does the pressure switch stick closed? A new pump head (which includes the pressure switch) will generally work reliably for one season. It will begin sticking in its second season. I think the problem is that I'm pumping pond water.

I wonder if that pump is appropriate for your application with potentially dirty water. The diaphragms and valves are rather delicate. I have a Jabsco Parmax 4 which is similar - but I am using it for potable water and the pressure switch is 4 or 5 years old now. Of course my pump is probably not shifting the same volume as yours.

Do you know if it is the electrical contacts of the switch that fail? Or is it the pressure sensing element? If it is the electrical contacts you could perhags protect them by putting a relay between the switch and the motor. Also, of course, if it is the switch contacts the problem is not due to water quality.


jremington: A capacitor is unlikely to be useful in this situation, as it would have to be enormous* to power a 9 ampere, 12V motor for even a few milliseconds. Don't forget that DC motors briefly draw the stall current each time they start up.

How else then would you store the power?

LCBs do not store enough to,pulse for .1sec, it is much shorter.

I have seen circuits and even played with one. If I can find the circuit, I will post it.


How else then would you store the power?

With inductors. My example assumed using only the capacitor as the primary energy storage device.

The so-called "linear current boosters", which are just DC-DC converters, store energy in a combination of inductors and capacitors. The switching frequency is very high so the capacitors and inductors can be small.

Here is a standard example of a very tiny, reliable, commercial switching buck regulator, which can produce 5 V at 9 amperes from a source of up to 38 V. Only US $28!

Assuming 90% efficiency and input voltage of 24V, as well as safe operation at maximum output current, the source current can be estimated as follows:

PowerOut = Iout*Vout = 0.9*PowerIn = 0.9*Iin*Vin.

Iin = (Iout*Vout)/(0.9*Vin) = 1.6 amperes.

So, a 24 V solar panel can run a 5V, 9 ampere motor while providing 1.6 amperes.

To charge $453 for this piece of junk is absolutely outrageous.

These converters need a low impedance input capable of supplying current. A solar panel in low light is not able to supply the required current unless it is accumulated in a capacitor.


It depends on what you mean by low light, but in general, no, they don't. I've done it. In the example above, if there is enough light for a solar panel to provide 1.6 amperes, the converter and DC motor will work just fine.

In addition to step-down converters, I've also used solar panels to run 120 VAC pond and fountain pumps, by connecting the panels directly to the cheap 12VDC - 120VAC converters sold for automobiles. Those converters have shutdown circuits to prevent running down batteries, which will cleanly shut off the pump circuitry at night or in very dim light.

Of course there are small capacitors in DC-DC converters, there are in just about every circuit. Take a look at the circuit board in this "LCB"example: