Category Archives: Charger control project

Latest software update

Part of the ladder logic program in the PLC

This afternoon I’ve spent a little time working on the charger. The charger stopped working on Monday after the power was interrupted for an hour or so while other electrical work was completed. A quick check at the time concluded that the radio link between the immerSUN and the charger had stopped working, and that the problem wasn’t a fuse, but other time commitments prevented further investigation until now.

The radio link carries the control signal from the immerSUN in the airing cupboard to the car charger in the detached garage.  The control signal is generated either when the immerSUN has detected that a suitable surplus of PV electricity is available to want the car charger enabled or its output current increased; or when a timed boost is programmed in the immerSUN typically to do overnight charging on cheap rate Economy 7 power; or indeed when a manual boost is demand via the immerSUN front panel, app or web portal.

Fortunately lack of the control signal doesn’t prevent car charging as I can disable the integral PLC (which leaves the charger on continuously) and allow the car’s internal timer to control when the car charges.

This afternoon I’ve successfully re-paired the receiver to the transmitter to restore normal charger operation and uploaded my latest software to the PLC.

The capabilities of the charger are now as follows:

Operating currents: 6, 10 and 16 Amps
Maximum continuous current (continuous grid load current):10 Amps
Peak current (from PV + battery only):16 Amps
Range switch interval:6 minutes
Minimum on time:10 minutes
Control signal watchdog (not during Economy 7 hours):15 minutes
Control source:ImmerSUN

Best use of generated power (cont.)

In order to illustrate how the combination of battery and immerSUN distributes generated electric power at different levels of generation I created this chart.

For different levels of power generation across the bottom, the chart shows how the power is divided between battery charging (and occasionally discharging), electric car charging, and water heating; which are generally prioritised in that order. My prior post explained the rationale for the 500 Watt switching threshold for the vehicle charger – based on 1.4 kW of mid-value car charging being better value than a mix of 800 Watts of high value battery charging and 600 Watts of low value water heating.

Alternatively you might like to consider that the horizontal axis represents passing time after daylight comes and that the chart shows how diversion changes as the sun reaches its zenith.  You might then view the end of the day as a mirror image of this as the output of the panels ramps down in late afternoon, although at the end of the day there’s the greatest possibility that one or more of the storage devices is/are full and thus the greatest chance of electricity being exported.

Of course all of this assumes that the storage devices aren’t already full, and indeed that the electric car is present at all. As storage devices fill, or indeed if the car is absent, the system automatically switches to the next best value alternative:

  • Battery full – more car charging and/or water heating.
  • Car full or absent – more battery charging and/or water heating depending on power output.
  • Hot water at maximum temperature – this is the lowest priority electricity use so when this is full we don’t currently have another use to divert power to. However there is an unused output on the immerSUN so it would be possible to drive another load. The underfloor heating in the kitchen would be a possibility, although there’s unlikely to be much overlap between days when there’s enough surplus to reach this point and days when kitchen heating is required so it may never repay the cost of fitting the cables.

Best use of generated power

Over the last few days I’ve been rethinking the best use of generated power.
The prioritisation of battery charging over water heating is clear due to the significant cost difference between day time electricity and any time gas, but the situation on car charging is more complex. It occurred to me that there could be times when prioritising battery charging and water might not always be the lowest cost solution since car charging avoiding mid-price nighttime electricity might be a bigger saving than a lesser amount of high value battery charging combined with low value gas-replacement.

For example, if we look at the lowest level of EV charging that amounts to about 1.4 kW. With our night-time rate of 7.87 p/kWh, 1.4kWh of solar power used for car charging saves 11.0 p of night time electricity.  If the battery is maxed out at 800 VAh that saves 7.34 p of later day time electricity. The water heating using the balance of 0.6 kW saves a further 1.76 pence of any time gas. Thus the total save from 1.4 kWh used for a combination of battery charging plus water heating is 9.1 p, compared to 11.0 p from car charging – so it would appear to be better value to do 100% car charging when a 1.4 kW surplus exists.

A bit of further analysis aimed to establish the point at which it became better value to charge the car, rather than combine battery charging and water heating, even if that involved a small level of mains import. The answer is that, with my energy costs, it makes sense to enable 1.4 kW of charger when 1.3 kW of export would have existed thereby potentially importing 0.1 kW. In practice this 0.1 kW may be supplied by the battery.

Given that the battery has priority by the way it’s wired, and takes up to 800 VA, then I intend to try a 500 W export threshold to start the car charger since 800 VA + 500W ~ 1.3 kW.

Charger software upgrade

img_0609One occasional issue with my solar powered charger has been an occasional glitch on the immerSUN which once in a while fails to turn off its relay output. The effect of this is that, as the output is held on, the charger output rises to 16 Amps and holds that level for an extended period. The illustration shows this happening late on August bank holiday Monday.

Manual intervention has shown that turning the charger off causes the the immerSUN to reset after a few minutes and normal charging can continue.

I’ve recently revised the charger software to identify this issue and to reproduce the manual intervention automatically i.e. turning off the charger until the immerSUN output resets. The issue is identified if, during daytime operation, the immerSUN output is held on for 15 minutes. If working correctly after 15 minutes the output will have ramped up to so close to the maximum 4kWp output of the panels that the immerSUN should have turned the output off. Today is the first day that I’ve seen this at work.

img_0610Although today’s generation at mid November is very different to late August, there was still sufficient power to run the charger occasionally but at 13:22 the intermittent issue recurred and the output latched on until 13:51 – just shy of 30 minutes – as captured by the ‘Threshold On’ and ‘Threshold Off’ messages in the daily log file.


After 15 minutes the charger shutdown. During the shutdown period the PLC holds on its ‘off’ output forcing the protocol controller to disable charging, while flashing its 16 Amp output at 1Hz to indicate its error state to any observer. It remained shutdown until the immerSUN relay output turned off after which normal operation resumed.

Solar PV Installation – 1 year on


We’ve now had our solar panels for 1 year, so it would seem time for an update on how things are going. Our 4kW SSE-facing system has an expected annual generation of 3,668 kWh. However after a year in service I’m pleased to see that we’ve generated 4,056 kWh – 10% more than expected.

The financial returns on a solar PV system are a combination of 2 things: (i) payments from your chosen electricity company for energy generated and exported to the grid and (ii) savings from not having to buy so much power as you use that which you’ve generated instead.

When it comes to payments from the electricity company, my electricity company (like many) chooses not to go to the expense of installing an export meter and instead assumes that half of the power which I generate is exported to the grid. The total annual revenue for the first 12 months of operation, including both generation and export (assumed to be 50% of generation) is £629.62.

Then there’s the question of how much electricity I save. I’ve only had monitoring of usage since March (approximately 6 months) but in that time I’ve used 41% of the generated electricity to replace bought electricity. 41% of 4,056 kWh is 1,663 kWh. What is less clear, is what the unit saving for this energy is. Some of this is daytime usage like standby loads, the fridge, cooker and other daytime loads at 11.7 p/kWh; but some would otherwise be night time loads like dishwasher, washing machine, or car charging at 7.57 p/kWh. I don’t measure the split so I’m simply going to assume an average unit rate = (11.7 + 7.57)/2 p/kWh = 9.6 p/kWh. 1,663 kWh @ 9.6 p/kWh = £159.65.

Finally, there’s the question of how much gas I save by making hot water from solar PV electricity rather than gas. Since March I’ve used 813 kWh or 27% of the generated power for water heating, so for a whole year 27% of 4,056 kWh is 1,095 kWh. The immerSUN itself records 995 kWh used for water heating since December. I’m also going to assume that not all the heat from the gas boiler would have ended up in the tank as hot water since some is lost via the boiler flue to the outside world, and some is lost via the pipes to the inside of the house – so let’s say 80% efficient on gas. 1,095 kWh @ 3.01 p/kWh @ 80% efficient = £41.20.

The combined total of my revenue and savings for a whole year would have been £830.46 – a 13.6% return on the investment or payback in 7.3 years.

The tariff scheme will have provided me with about 20 years of income by the time it closes, so the investment in the panels, as well as helping me reduce my carbon footprint, will have generated 12+ years of profit having paid for itself during the 8th year.

Charging ahead

Today I read a number of comments elsewhere from those who didn’t think it was possible to run an electric vehicle in the UK with a ‘significant’ degree of solar charging. I’m not sure how they come to that conclusion when some of us are doing it.

Now clearly the vehicle needs to be home, sometimes, and there’s a limit to how much can be generated; but it certainly works for me. I average around 20 miles per day, which is about 6 kWh of electricity; but my average daily generation is 11 kWh. That’s clearly seasonal, so I doubt that I can solar charge through the depths of winter – November to January I don’t generate 6 kWh on average let alone have 6 kWh available for EV charging.

It needs a certain mindset. I think most EV users try to get a full charge when they charge but many go for several days between charges. With solar charging I try to ensure that I have enough charge on board for the day ahead (potentially charging a little overnight to achieve this when necessary), but on a sunny day with the car at home I can get a full charge during the day. I only try to get a full charge by the start of a day on imported electricity when I know I’m going on a relatively lengthy trip, otherwise I deliberately don’t aim for a full charge to leave space for solar input if available. Whenever the car is at home it’s plugged in ready for when the sun shines. Typically I’ll leave the weekend with the vehicle almost fully charged (1 full day of sunshine can get a full charge), that will drift a bit during the week, possibly benefitting from a day at home during the week if I have meetings in London, then by the weekend it’s almost empty.

Top-ups during the week (at least during the summer) are often before I leave for work in the overlap where I have some solar (but not enough to run the charger) but am also in the Economy 7 window.

Overall I think that I have a good claim that most of the electricity for charging comes from my own solar during the course of a year.

Results with variable charging

Today is my first day with the car plugged in all day since I completed the variable charging which directs the car to charge at 0, 6, 10, or 16 Amps depending on availability from my solar panels.

imageThe green area shows the electricity generated by the solar panels. The purple line shows the demand for electricity – the larger changes are the car charger switching on and up/down. I myself witnessed it switching between 6 and 10 Amps while working in the garage. The blue line shows the second priority – electricity being used for water heating. The water heating control is more dynamic and adjustable in finer increments so it mops up what the car charger cannot.

In total:

Electricity Sources Electricity Uses
4.1 kWh of electricity was bought/imported. 13.8 kWh of electricity was used by the house (including car charging)
15.9 kWh of electricity was generated. 5.1 kWh of electricity was diverted for water heating.
1.1 kWh of electricity was exported to the grid.
20.0 kWh of electricity total input. 20.0 kWh of electricity total output.
93% of electricity generated used productively. 79% of electricity used self-generated.

For some time now my car charger has been linked to my solar panels so that it automatically turned on when enough surplus solar power was available enabling me to charge my electric car for free. This has helped me get up to an average of 70% of my generated electricity being used my me rather than export to the grid.

The latest refinement is intended to help me increase that beyond 70% while charging the car more quickly and reducing my use of bought electricity.

Variable rate charger

The new refinement allows the charger to switch between 0, 6, 10 and 16 Amps rather than simply off/on between 0 and 6 Amps. I needed a new case to get all the bits in, but the main technical difference is the use of a Programmable Logic Controller (PLC) to determine the desired charge rate.

The PLC is programmed from a laptop via a USB lead to create a programme in ladder logic which combines inputs (currently export threshold and contactor closed) with timers to switch on one of four different outputs corresponding to the four different charge currents (0, 6, 10 and 16 Amps).

Solar car charging results

Well, with a bit of tinkering, my solar car charger is working with the charger turning on automatically when the output from the solar panels is sufficient, but I already have in mind a few improvements.

My issues include:

  • As it stands the system turns off as expected when household demand rises, such as when boiling a kettle, but it takes some time for charging to restart after the signal is sent, presumably down to some logic in the charging equipment. I’d prefer something a bit less dynamic in responding to short term demand changes, but that restarted sooner.
  • The signal from the ImmerSUN tends to turn off too quickly to my mind as, having turn on a relatively big load, it decides there isn’t enough capacity to run a big load. The logic effectively determines that there isn’t enough spare capacity to turn on the load a second time, turns off the load, and then decides that there is enough capacity. To my mind this just cycles the power unnecessarily and, with the delays in restarting already reported, also reduces total energy transfer.

Consequently I’m already working on improvements:

  1. Firstly I’m changing the protocol controller than coordinates the handshake with the vehicle. The new one should enable a more rapid restart after interruption without the uncertainties of the delays in the OEM controller. It will also provide an alternative mechanism to stop charging. Instead of suggesting to the vehicle that the cable is about to be disconnected, the new one allows more direct control of the current by resistor selection – or turning on/off via a contact across the resistor.
  2. Secondly I’m upgrading to variable current rather than a simple on/off at low current. The new protocol controller documents maximum current choice by resistor selection, but I think that I’ve worked out how to provide infinitely variable current via an analogue voltage. The car will respond to the infinitely variable signal by drawing the highest compatible current from 0, 6, 10 and 14 Amps.
  3. Thirdly I’m reconfiguring the output of the ImmerSUN to be more dynamic, but then..
  4. Finally I’m building a module to sit between the transmitter receiver and the protocol controller. The new module will set upper and lower current limits and set the ramp rate / time constant for the system response.

My intention is that the result of this is that in response to a jump in available power the controller will slowly ramp up the output to meet the availability and then slightly cycle the analogue output as the ImmerSUN output cycles on and off. The vehicle will respond by cycling between the currents immediately above and immediately below the available current. As an alternative strategy it can be configured to cycle just below the available power, and thus theoretically not import any power from the grid, at the expense of not fully using the available solar power.

Which ever strategy is used the more highly dynamic water heating will continue to mop up any available power between what the vehicle takes and what’s available from PV.

My radio-controlled car charger

This weekend I finished my radio-controlled charger.

You may recall that I wanted to link the charging equipment for my electric car to my solar panels so that the car automatically charged when there was enough power from the panels. I’d previously settled on a simple on/off system charging at 6 Amps (the minimum setting) since analysis had suggested that this would maximise energy transfer as it seems to be more important to charge for the most hours than, for example, charge at more current for fewer hours.

It seemed that I would be easily able to configure my ImmerSUN to turn the charger on and off using its Relay: Export Threshold feature but I wanted to extend control to my car in the garage some way from the ImmerSUN without running a cable so far.

HomeEasyMy solution was to make use of a HomeEasy remote control light switch and remotely-controlled switched socket (available on Amazon for example). The switch is designed to send a radio signal up to 30 meters to operate the socket – a range of transmitters and receivers are available separately which can be paired by the user.

My remote controlWhen I dismantled the switch I found that in normal use the operation of the rocker operated two pushbuttons – one for on and one for off. I removed the pushbuttons from the circuit board and replaced them by cables to the relay outputs of the ImmerSUN. At the same time I reasoned that the button cell in the transmitter might not last very long in service, so instead I repurposed an old mobile phone charger as a power supply. The mobile phone charger was notionally 3.6 Volts, rather than the 3.0 Volts of the button cell, so I also added a simple voltage regulator chip and smoothing capacitor to ensure that I didn’t damage the transmitter from any over-voltage.

If you simply wanted to switch some mains powered device then you’d need to do little more than plug it into the remote-controlled socket to be able to switch it on and off automatically, but for my car charging equipment I wanted to do something a little more sophisticated. I had previously decided to interrupt a low voltage control signal so that the charging system turned on and off gracefully as if the user was engaged in the normal process of stopping and starting charger rather than forcibly turning the power off as if there was a power cut. To this end I fitted a small mains relay inside an empty case intended for a small power supply like those used for a mobile phone, so that when power is turned on or off volts-free relay contacts open and close. These contacts are wired in series with a push button that normally starts or stops charging so that, as far as the car and charger are concerned, the button release that indicates ready-to-charge doesn’t happen until there’s enough solar power available (by default).

I also have the option to manually enable charging or set up a schedule from the ImmerSUN for times when there either hasn’t been enough solar generation or the car isn’t home long enough to benefit from it.

All I need now is a reasonably sunny day when the car is at home to try it.