Mains Backup for Solar Charged Battery Bank

Pictured below is a controller designed to automate backup mains charging of a battery bank which is charged by an array of photovoltaic solar panels.

Main charger back up for solar pv charged battery bankThis controller is based around our low voltage disconnect products. It constantly monitors the voltage of the battery bank. When the voltage falls below a user set low voltage (e.g. 12.0V), the on board relay closes which connects a mains powered battery charger to the battery bank.

When the battery voltage then gets up to a user set high voltage (e.g. 13.6V), the on board relay opens which disconnects the battery charger.

This controller is fitted with manual overrides so that the user can ‘override’ the controller and force the mains powered battery charger to come on when off, or turn off when on.

This is very useful for a solar powered system since the battery bank voltage may be getting low and the weather forecast may also be bad for the coming day. In that scenario, it is worth charging up the battery bank fully immediately to prevent the battery bank from hanging around at a low voltage for an extended period of time (which is bad for battery longevity).

Similarly, if the mains charger is on because the battery bank was low on charge, but the weather forecast is for non-stop sunshine, the override enables the charger to be turned off to leave the solar panels to do the rest of the work.

If you need a controller like this, email neil@reuk.co.uk with details of your exact requirements.

 

Automatic Car Windscreen Heater Timer

Pictured below is our timer for an after market car windscreen heater – in this particular example, for a Land Rover.

car windscreen heater prototype connection diagramThe biggest seller of after market heated windscreens in the UK is Ricky Evans Motorsport. (Click here for the relevant heated windscreen wiring diagram.)

The relay output from our programmable timer fits into the wiring in place of the standard on/off switch. The timer can be programmed by the driver to turn on the heated windscreen for from 1-20 minutes after the button (which can be mounted in the dash) is pressed. A panel mountable LED is provided to show when the heater is on.

Automating windscreen heating in this way prevents the heater from being left on unnecessarily long.

The exact button and LED can be substituted with whatever switchgear and indication lighting matches the vehicle in which the system is installed.

If you need one of these car windscreen heater timers, email neil@reuk.co.uk with details of your exact requirements.

PICAXE Arithmetic Problems

Hitting the maximum number limit with PICAXE microcontrollers

In a recent post we showed our 24V Low Voltage Disconnect with Data Display. This device monitors and logs the voltage of a 24V battery bank, disconnects the output loads if that voltage is too low to protect the batteries, and has an LCD display on which the last 100 days of battery voltages can be checked, summarised, and the maximum and minimum recorded voltages displayed for analysis.

This device is built around a PICAXE microcontroller. These are simple to use and quick to programme microcontrollers, but they have a few ‘features’ which can make life difficult (sometimes making an Arduino a far better alternative). PICAXE chips can only process numbers in the range 0-65535, they cannot process negative numbers, and cannot process floating point (decimal) numbers.

In most cases those limitations are not an issue, but with our 24V LVD for example it was. The microcontroller is powered via a 5V regulator. In order to measure incoming voltages over 5V, a voltage divider (Wikipedia) is required – a pair of resistors connected in series with one end connected to the incoming voltage to be measured and the other end to 0V. The values of the resistors are chosen so that the voltage measured where the two resistors meet is in the range 0-5V across the full range of likely input voltages.

For our standard 12V low voltage disconnects we use a 47K resistor for R1 and a 10K for R2. The voltage output from this voltage divider is equal to R2/(R1+R2) multiplied by in the input voltage. So, if the input voltage is 13.00V for example, the voltage divider output voltage will be 13*(10K/(10K+47K))=2.281V which the 10-bit ADC on the PICAXE will see as (2.281V/5V)*1023=467. Only when the input voltage exceeds 28.5V will the voltage from this voltage divider exceed 5V, and 28.5V is never going to be seen from a 12V battery.

With our 24V datalogging LVD we chose 68K for R1 and 10K for R2. This gave an input voltage range of 0-39V corresponding to the ADC range of 0-1023 which is perfect for a 24V battery system. However, we hit upon a problem.

We work out what an input voltage of 1V corresponds to as an ADC value after passing through the voltage divider. With the 68K/10K divider on our 24V LVD, 1V on the input corresponds to an output of 0.12821V which corresponds to (0.12821/5)*1023=26.23. Therefore, if we divide the ADC value on the microcontroller by 26.23, we calculate the input voltage.

BUT, the PICAXE chip can only do integer arithmetic. An ADC value of 415 in this example corresponds to a measured input voltage of 415/26.23=15.8216V, but with integer arithmetic 417/26=15V so off by almost a full Volt.

In order to retain resolution and accuracy while forced to use integer arithmetic, we multiply the ADC reading by 100 and divide it by ten times the per volt ADC value. The result given is ten times the input voltage – for example (415*100)/262=158 which means 15.8V which is close enough to the actual value.

But, this approach can then lead to another problem. In the case of our 24V LVD with the 68K/10K voltage divider, when the input voltage exceeds just below 25V (which will almost always be the case with a maintained 24V battery bank), the ADC value is greater than 656. When we multiply this ADC value by 100 we get a number of over 65600 which the PICAXE (with its maximum number limit of 65535) cannot process. For example it will see 65536 as 0, 65537 as 1, 65538 as 2, and so on and will think that an input voltage of 25V is less than 1V which is not much use.

There are many (very complicated) ways around this maximum number problem using variables and/or the EEPROM to store parts of large numbers while doing calculations, but in the case of the 24V LVD with datalogger, all the internal data EEPROM was dedicated to datalogging, and all the variables were already being used. Therefore, instead of multiplying the ADC value by 100 and dividing it by ten times the per Volt ADC value, we modified our code to multiply the ADC value by 50 and divide it by five times the per Volt ADC value. This results in a small loss of accuracy of less than 0.1V at the upper range of predicted voltages, but works well enough for this particular device.

So, when choosing a voltage divider for an accurate voltage measuring device with a PICAXE chip, choose the resistors to ensure that the full possible input voltage range is more than covered, and also that any multiplication of ADC values in order to maintain resolution with integer arithmetic does not generate numbers over 65535. (Alternatively just use an Arduino with floating point arithmetic!)

Solar Water Heating Pump Controller for Hot Tub with Maximum Temperature

Pictured below is another of our solar water heating pump controller variations. Again based on our 2013 solar water heating pump controller with relay, this controller is modified to use digital waterproof temperature sensors (ds18b20), and also to have a user programmable temperature limit.

waterproof-ds18b20-2013-solar-controllerThis controller is designed to be used with solar heated hot tubs and jacuzzis. As the volume of water in a hot tub is relatively small (compared to swimming pools for example) it is possible for the water in the tub to become unpleasantly or even dangerously hot after an extended period of sunshine.

This controller has been modified to have a user programmable maximum temperature. When the temperature of the water in the hot tub reaches this maximum, the pump will turn off and stay off until the hot tub temperature has dropped by at least 2 degrees Celcius.

Programming the maximum temperature is simply the matter of holding the button to enter programming mode at start up, then pressing it X times where 20 + 2*X is the desired maximum. For example, 8 presses for a 36 degree Celcius maximum.

If you need a solar water heating pump controller for a domestic system, swimming pool, or hot tub, with or without an LCD display, email neil@reuk.co.uk with details of your exact requirements.

Playhouse Lighting Controller with LVD

Pictured below is the connection diagram for a controller we have built to be used in a child’s playhouse. The playhouse will have a solar charged battery which will be used to supply power to three LED spotlights with a light switch, a small fan to circulate air and prevent the playhouse getting damp or too hot, and a dual cigar lighter socket with USB sockets which will be used to charge battery powered gadgets.

Connections for low voltage disconnect with twin outputs - regulated for LED lighting and to power a fan for ventilationAs the playhouse will be used by children, safeguards have been fitted to prevent the battery from becoming excessively depleted and permanently damaged.

In order to prevent the lights being left on and forgotten, when the light switch is turned on, a timer starts and if after one hour the light switch has not been turned off, the lights turn off automatically and will not turn back on until the light switch is toggled.

The output from the controller to the LED lighting is regulated to 12.0V so that excessive voltage (particularly when the batteries are being charged) does not damage the voltage sensitive bulbs.

To reduce power consumption, the fan which is used to ventilate the playhouse is turned on for just one hour every six hours automatically by the controller. The output to the fan is not regulated as the fan is rated for use with up to 18V, and if the battery voltage is high it is because there is or has been a lot of sunshine. Therefore the faster fan speed will prevent the playhouse getting too hot and stuffy.

In order to prevent the battery from running too low on charge, an automatic low voltage disconnect is incorporated. When the battery voltage falls below 11.9V, the outputs to the fan and lighting turn off, and only turn back on again when the measured battery voltage exceeds 12.4V.

The cigar lighter / USB socket is connected directly to the battery as the gadgets being charged by it will not draw much current for long if left connected since their batteries will get full and charging will stop automatically.

If you need a controller such as this, or with any of the features it has, email neil@reuk.co.uk with details of your exact requirements.

Simple Low Voltage Disconnect with Two Outputs

Pictured below is a low voltage disconnect circuit with two outputs.

low voltage disconnect (LVD) with two outputs to share the loadWe make a basic low voltage disconnect (LVD) designed specifically for use with low voltage LED lighting which incorporates a low-dropout 12V regulator. This device ensures that:

  • the battery does not get damaged by running too low on charge. If the measured voltage falls below 11.9V the output loads are switched off and not switched on again until the voltage is measured to be 12.5V or above.
  • the LED lighting is not damaged by excessive voltage (>13V) – particularly important with solar powered lighting systems where battery voltage can get up to 15V.

The pictured LVD/regulator is different in that it has dual outputs. The LM2940CT-12 voltage regulator is limited to around 1 Amp of output load, so our standard unit is not suitable in cases where the total LED lighting load exceeds around 8-10 Watts. Where the total load is more than around 2 Amps, we use an LT1084CP-12 regulator on the output side, but these are very expensive. Therefore where the LED lighting load is around 10-18 Watts, and can be split into a pair of separate lighting circuits, we simply make a double output regulator and split the load.

If you need something along these lines, email neil@reuk.co.uk with details of your requirements.

Solar Water Heating Pump Controller with LCD

Pictured below is the connection diagram for a new solar water heating pump controller we designed and built recently for use with a swimming pool heating system.

solar water heating pump controller with solid state relay and LCD and programmable timer override for swimming poolThis controller is the next step up from the solar water heating pump controller with solid state relay discussed previously. It has the same ds18b20 waterproof digital temperature sensors we use in all controllers for swimming pools and similar, but with the addition of an LCD to display measured temperatures and other system status information. (There is also a 12v digital programmable timer override function added as a specific customer request.)

LCD for solar water heating pump controller

The LCD constantly displays the temperature of the outlet from the solar thermal panel (S) and of the pool (P). It also displays the current measured temperature difference between the solar panel and pool, as well as the temperature difference required for the pump to turn on or off (as programmed by the user).

Having the LCD makes it possible to add a lot more features to this controller on request – for example keeping track of the average temperatures and peak temperatures of the pool and solar panel, tracking for how long each day the pump is running, and many other potential datalogging features.

Email neil@reuk.co.uk if you need a solar water heating pump controller with or without an LCD and datalogging with details of your exact requirements.