low power picaxe project

carl stevenson

New Member
Hello
I have built an automated pump and irrigation system to water my plants from a water butt.
At the moment I am using a cheap timer relay module to control the pump. This timer draws 20 milliamp
Ideally I would like to find a lower power solution so was wondering if a picaxe would do the job.

So could somebody give me a rough estimate of power consumption for the following pickaxe and relay? Ive tried to work it out but am unsure of my calculations

I will have a 12 v battery connected to a voltage regulator. (7805) then a picaxe 08 powering a relay (which switches the pump on and off.)

The pickaxe is not connected directly to the pump, just the relay.

The pump will be off for 24 hours and then on for 1 minute then off for 24 hours etc so for the majority of the time the picaxe will just be paused and the relay not powered.

I am hopeful this will require less than 20ma to run.
 

hippy

Technical Support
Staff member
Welcome to the PICAXE forum.

What you want should be possible. Here's an older 08M project which has been ticking along for almost a decade on three AA batteries -

http://www.picaxeforum.co.uk/showthread.php?8353-Low-Power-Battery-Backup-Reference-Design

The 7805 regulator could potentially draw more power than the PICAXE so you might want to pick one with low quiescent current.

You might have to jump through some hoops to get absolute lowest power operation and keep the 24 hour timing period right but members here can help and advise on that and you could probably add an RTC module which will run off its own button cell for years to make time-keeping easier.

PS: No "K" in PICAXE :)
 

carl stevenson

New Member
hi there
ok great, thanks for the info.
Do you know of any voltage regulators that would be suitable ? I imagined they would be using a lot of current.
Ah yes my spelling auto correct was a bit too enthusiastic with PICAXE.
 

AllyCat

Senior Member
Hi,

The "best" solution may depend on whether you want to use an old 08 PICaxe, or an 08M2, and if the 12 volt battery powers the pump, which would likely be the main power drain even at only a 0.1% duty cycle (1 minute / day). Also, your location (Country) may help us to recommend suitable suppliers.

Basically, a running PICaxe chip consumes about 0.6 mA and a standard 7805 rather more than that. There are plenty of low drain regulators but you will need to find a convenient package and adequate input voltage rating. A quick Google found the LP2950/LP2951 (max 30 volts input, TO92 package and ~75 uA drain) but I've never used one.

The timing accuracy of the 08M2 can be trimmed to around 0.1% (a few minutes a day) and running the clock below 1 MHz can save some more power. However the timing during "Sleep" is less accurate so for that you'd probably want to use a RTC module as suggested by hippy. The "DS3231 for PI" is a nice little module (via ebay), with typical program code from "marks", for example #7 in this thread.

Cheers, Alan.
 

carl stevenson

New Member
hi

I am in the UK
ideally I would use the 12v to power everything as its a solar powered system.
The pump is 1amp so will only need 0.7ma (1 minute of power)?
Then the charge controller for solar power is 6ma
The timer is 20ma (to be replaced with a picaxe
I have a 7amp hour battery

so far I think the system requires 640ma of power a day? The solar panel will be charging the battery but if there is more than a couple of weeks of cloud then it will only just be charging the battery enough. (I can get a bigger battery and panel but I am recycling components to save money)

So it sounds like a picaxe plus a regulator with a low power drain will work for me,
Ill order a LP2950/LP2951 and try it out.
 
Last edited:

lbenson

Senior Member
3 AA batteries and a suitable latching relay should make the current draw from the picaxe circuit negligible.
 

fernando_g

Senior Member
I'll join the chorus that a separate battery for the Picaxe is the way to go.
That way, if your main power source fails or is disabled, you can actually log the failure.

I've a 18X temperature and humidity data logger, which easily runs a year and a half on AA batteries.
It includes analog humidity and an analog temperature sensors, RTC, EEPROM and a LCD display.

The LCD display is only enabled if someone is actually watching it and activates a switch, completely off otherwise.
For the remaining ICs, the 18X drives a P-channel Mosfet, which in turns powers up the remaining ICs.

The 18X in itself utilizes DISABLEBOD to reduce its own current consumption, and then put to SLEEP for about 40 seconds. When it wakes up it queries the RTC; if the time is not a multiple of 15 minutes it will go back immediately to sleep.
If it is a multiple of 15 minutes, it will read the analog temperature and humidity sensors, store the value in EEPROM and go to sleep again.

The average current consumption is so low that I cannot measure it, but estimate that it is about 50 microampere-hour for the circuit, plus around 60 microampere-hour for the LP2951 regulator.
 

AllyCat

Senior Member
Hi,

ideally I would use the 12v to power everything as its a solar powered system.
The pump is 1amp so will only need 0.7ma (1 minute of power)?
Then the charge controller for solar power is 6ma ....
I have a 7amp hour battery.
It sounds as if you are on the right lines, but I would like to be more precise about the physical units:

Yes, if the pump runs at 1 Amp for 1 minute a day then the average current over 24 hours is 1000/1440 = 0.7 mA, or 16.8 mAhrs per day. So theoretically it could run off your 7AHr battery for 7000/16.8 = 416 days, or more than a year. Strictly, we should be considering the "Power" in the system (Volts x Amps = Watts) but the power levels are so low that there's no need to complicate the analysis by considering switched-mode power converters, or additional batteries, etc..

Since the pump is the "primary purpose" of the system, normally one would design the rest of the system to consume much less power or current (say 10%), but in this case the average pump drain is so low that it's reasonable to assume a similar consumption for the rest of the "Control System". That happens to be the case with a PICaxe running continuously at 4MHz, with a low-power regulator. You haven't said what timing error per day that you can tolerate, but using "Sleep" will compromise that, or adding a RTC module will greatly improve it (even if the PICaxe is allowed to sleep).

But the "6 mA" for the Solar "Charge Controller" is looking rather high and possibly could be done by the PICaxe anyway. Is the 6 mA continuous, or only in daylight? What is the "rating" of the Solar Panel, or (perhaps more informative) what is its collecting area? Particularly in the UK, the selection of the "slope" of the panel can be an important consideration.

Normally, I'm a great proponent of the Keep It SimpleS approach, but here the PICaxe could do so much more for you. Is "one minute" of pumping each day really what's needed? Even in mid winter when it's raining, or the 12 volt battery is nearly flat, or the water-butt level is getting very low..? There is so much that the PICaxe could do, but I would be measuring at least the "sunshine" (PV output current) and the battery voltage, to decide how long the pump should run. The "daylight" could even be used to "synchronise" the internal timekeeping, and sensors for temperature/humidity, etc. can be easily and cheaply interfaced using the I2C bus. Admittedly, "water level" and "soil dampness" measurements are more difficult, but I think there are threads on the forum concerning those as well. ;)

Cheers, Alan.
 

carl stevenson

New Member
hi
The solar panel is a 10 w panel (around 20cm x 30 cm in size)

I haven't checked if the 6ma for the charge controller is continuous yet, but will tonight.

I have bought a level switch to stop the pump running when the water level is low. (not installed yet) I thought about using an ultrasonic sensor as well to accurately measure water level.

Yes I think it would be good to eventually measure the soil moisture or sunshine hours (either an additional light sensor or directly by measuring the solar panel) to determine the amount of water needed by the plants.

Then I would like to measure the battery voltage and solar panel output once I have the picaxe installed.
Eventually I will use a wifi module or zwave module to allow me to monitor it all remotely.

Using the picaxe as a solar charge controller is a bit beyond me at the moment although I have looked at a few picaxe solar projects so its something I would like to try.

I am confident with picaxe programming as I have built a few complicated robotics and sensor projects, but those involved some relatively simple electronics. Anything involving the potential of accidentally overcharging 12v batteries or reversing current back into a solar panel put me off making a solar power controller at the moment until I really understand the schematics,
 

premelec

Senior Member
With 10 watts not too hard to use a buck converter feeding a series diode to your battery to prevent overcharge - assuming you know what float voltage you want on the battery. I'm a fan of pressure transducers rather than sonic to measure water head if that's possible in your case. Sometimes float switches get gummed up... Watching your pump current may be a good way to go - measure how it changes when 'suckout' occurs and then put in a delay before a retry... whatever works ;-0
 

AllyCat

Senior Member
Hi,

The solar panel is probably rather "too large" (or the battery too small). With peak summer sun the (almost) 1000 watts/sq metre will indeed deliver around 10 watts (15% efficiency and 1/15 sq m.). At 15 - 18 volts that's around 0.6 amp for an average of 8 hours, which could fully charge a 7 A.hr battery in less than 2 days.

If the solar electricity is "earning money" (i.e. a Feed In Tariff) then it makes sense to aim for the highest output and efficiency. However, for "off grid", if the surplus electricity cannot be put "to good use" then the primary aim probably will be to avoid running out of power in mid winter, with the secondary aim to avoid over-charging the battery in summer. For example, consider mounting the panel sloping steeply (to the south).

The question arises, what to do with the surplus energy when the battery is fully charged. If the PV panel is "disconnected", then the energy that would have been converted into electricity remains to "heat up" the panel, which is no different to "short-circuiting" the panel. It might be better to send the electricity to a "dummy load", something like a 12 volt car/auto bulb which is cheap, designed to "get hot" and reasonably weatherproof. Such a "shunt" circuit is very easy to drive from a PICaxe (one FET) and could also occasionally measure the current from the panel (i.e. the light level) within a fraction of a second. Measuring the battery voltage with (only) a PICaxe also can be "easy".

The mid-winter conditions are probably the primary design requirement because you should assume NO useful solar energy for up to a couple of months. Even "full" sun is only around 400 watts/m2 (sloping panel) for an average of 4 hours/day and there can be many "grey" days (or even weeks) in winter. So your 7 A.hr battery perhaps limits the power availability to around 7000 (mAhr) / 60 (days) / 24 (hours) or around 5 mA average. That's more than enough for pump, PICaxe, regulator and other sensors, etc., but do you really need / want that charge controller?

Of course there are still a lot of "unknowns", so I can only offer a little food for thought.

Cheers, Alan.
 
Top