Jump to content

DIY Arduino based solar PV dump controller


ProDave

Recommended Posts

5 hours ago, ProDave said:

But I don't know my way around the Linux / Ubuntu file system and a cursory look has failed so far to find where all the Arduino IDE executable files are stored

 

5 hours ago, PeterW said:

That’s one for @TerryE

 

Dave, I am more than happy to go through this on a 1-1 for any Unix s**t.   Why not give me a call?

Link to comment
Share on other sites

13 minutes ago, TerryE said:

 

 

Dave, I am more than happy to go through this on a 1-1 for any Unix s**t.   Why not give me a call?

It's academic now as I have PuTTY working, but because I "like to know" stuff, just where are all the program executables stored on a Linux system?  I can't seem to find them even with "hidden files" turned on in File manager.

 

In other words what is the equivalent place to Windows's "Program Files" directory?

Link to comment
Share on other sites

echo $PATH gives you the program search path.  In general most binaries are under /usr/bin, but they can be under /opt/bin or /usr/local/bin or anywhere on the path.  There are good YouTube intros to the  Unix File System and pretty much anything else you need, for example "Intro to bash" or "Linux top commandline commands".  The magic command here is find.

Link to comment
Share on other sites

53 minutes ago, ProDave said:

I did try Screen, but it would not seem to recognise the "serial" port dev/ttyUSB0 

 

Sucking eggs, but the leading slash in “/dev/ttyUSB0” is very significant.

 

As to where the executables are, it depends on how you installed the software. If it's the version in the Ubuntu repositories then, IIRC, it's in /usr/lib/arduino or some such and there's a symlink from /usr/bin/arduino so it gets picked up by the $PATH that @TerryE mentions. Following the instruction to install it from Arduino site puts it in the a bin directory in your home directory (there's quite a lot of software around these days which does this sort of thing; I disapprove). Using the command which arduino at the command prompt will tell you - it just searches the PATH for you and tells you what it finds.

Link to comment
Share on other sites

So it all seems to be working okay.

 

Yesterday was dull with mot much generation, but I did get my export meter connected.

 

Today was a better day. Nice sunny (but still slightly hazy) morning. As we were both out not much to use the power ourselves so the dump controller sent about 3KWh to the immersion.  This afternoon turned dull again and the WM and stuff has been busy so not much going spare.

 

As of just now generation for the day 7.7KWh 3KW of that has gone to the immersion, and my export meter is reporting 0.6KWh has been exported.  So I guess "house stuff" has used about 4KWh.

 

So the dump controller is letting a little escape, so I might tweak the scaling a little, it looks like it is slightly under measuring the generation output.

 

The next software tweak is to log daily power sent to the immersion as well as total.  Any bright ideas how to do that as there is no RTC to tell me when tomorrow has started?

 

Link to comment
Share on other sites

How are you going to get the logged information out, via the serial port? In operation, is it powered via the USB or a separate 5V supply? I.e., can you plug the computer in without switching it off?

 

You're counting mains pulses anyway so can't you do a real-time clock from those? Set the clock via the serial port after any power cuts.

Link to comment
Share on other sites

Yes plug the computer in to read out the data. The last one I had a set of commands you could sent and it would respond by streaming a load of data.

 

It is powered independant of the USB port so runs fine without that connected.  I just need to do a small mod (via a jumper) to stop the board resetting each time you open the serial port (the jumper is so you can re enable that function for program upload) 

 

Yes I guess a dead reckoning clock will do, after all it does not need to be accurate, just a way to start accumulating the dumped power to the next days register.  So in the same way I count 3600 seconds before writing data to EEPROM, I can count 86,400 seconds then advance to the next day.

 

As long as the mod works and I can connect / disconnect the serial port without issue it should work.

Link to comment
Share on other sites

You must be using some simple serial protocol to handshake data.  What not just add a "request time" command, or alternatively use HHMMSS<cr> as the ack string from the host?  The Arduino can use relative reckoning to sync into near enough calendar time.

Link to comment
Share on other sites

3 hours ago, ProDave said:

So in the same way I count 3600 seconds before writing data to EEPROM, I can count 86,400 seconds then advance to the next day.

 

Better and less resource hungry would be to count to 24 on the data writes as they are every hour. 

 

 

Link to comment
Share on other sites

  • 2 weeks later...

Just a performance update.

 

It has been nearly 2 weeks since the dump controller went live.

 

In that time the PV has generated 74KWh.  18KWh of that has been sent to the immersion heater, with only 1.99KWh being exported. The rest self used on house stuff.

 

I can probably improve on  that 1.99 KWh that has "escaped" in due course with a little calibration tweak.

  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...

Today was a nice sunny day.  Something that has been in very short supply up here for the last couple of weeks. So coupled with my other work on the PV system, I also did a bit more tweaking of the PV diverter software.

 

I have corrected the small calibration error that was allowing some to export even when the diverter was working.

 

I also tweaked the increment / decrement function, adding an element of proportional control to speed up response to step changes in house load or generation output. Now it ramps up or down the immersion heater load factor faster if there is a big excess (or shortage) of generation, but makes smaller adjustments if the difference is only small.

 

Being the first decent day for some time I noticed 2 things.  Firstly now the sun is higher and generation higher as well, it is perfectly possible to be running the immersion heater at 100% and still be exporting some power.  And secondly by 2PM it seemed to be exporting a lot while still showing 100% to the immersion heater.  It turned out the thermostat in the immersion had cut out and the tank was not accepting any more heat.  It seems it's maximum temperature is only 55 degrees, so I am now looking for a replacement thermostat that can go somewhat higher (see separate thread)

Link to comment
Share on other sites

43 minutes ago, Triassic said:

All sounding very positive, is this a project someone without any programming skills could undertake? 

Probably not.

 

Have a look at the code given in post #1 of this thread, it's posted as a text file so you should be able to open it in any text editor.  If it all looks like giberish then probably not.  The Ardunio programming language is based largely on the C programming language.

 

You would also need some electronics skills  to put the hardware together.

Link to comment
Share on other sites

The short answer is I don't know.  A lot of the previous units like immersun have gone by the way.  A quick search on enay suggests this is probably the current choice https://www.ebay.co.uk/sch/i.html?_odkw=solar+immersion&amp;_osacat=0&amp;_from=R40&amp;_trksid=p2045573.m570.l1313.TR5.TRC2.A0.H0.Xsolar+immersion+controller.TRS0&amp;_nkw=solar+immersion+controller&amp;_sacat=0

 

By comparison the parts cost for mine was about £50 and I enjoyed building it, plus I like to know exactly how things work.  I have in the back of my mind that later on I will expand the same unit to control battery charging and usage when I eventually add batteries to the system, then I can make the choice when to use surplus to charge the batteries and when to use the surplus to heat hot water.

Link to comment
Share on other sites

On 31/03/2019 at 11:07, ProDave said:

By comparison the parts cost for mine was about £50 and I enjoyed building it, plus I like to know exactly how things work.

 

It is well worth making up a second one complete with software install to act as a cold-swap spare -- just in case something does fail in a couple of years: you can swap out the unit and work out went wrong with the old one in slow time.

Link to comment
Share on other sites

3 minutes ago, TerryE said:

 

It is well worth making up a second one complete with software install to act as a cold-swap spare -- just in case something does fail in a couple of years: you can swap out the unit and work out went wrong with the old one in slow time.

I could do, but an Ardiono Nano is a standard item and can be had for under £5 https://www.ebay.co.uk/itm/262738901345?ViewItem=&amp;item=262738901345

 

 I might just buy a spare of that so I am prepared. The only other thing likely to fail is the solid state relay so a spare for that might be a good idea. I doubt I would bother to package it up as a ready made spare though.

Link to comment
Share on other sites

On 24/02/2019 at 14:02, ProDave said:

So my MK2 version operates by having two current transformers. One measures the power consumed by the house loads, and the other measures the power generated by the solar PV.  I am able to easily make this split as there is a convenient split at my outside meter box where both the current transformers reside.

 

Thanks for the useful post @ProDave. I'm trying to work out how to position the current transformers. Am I correct in thinking that your first current transformer (which delivers "house_current") measures the house load 'gross', i.e. if you are consuming 4kw and producing 3kw this would read 4kw, rather than the 1kw you would be drawing from the grid? If this is the case I think I'm going to struggle as my PV production is fed into the consumer unit. 

 

Have other people found ways of doing this? I've considered using a Elster a100c meter, as this can measure the current direction, but I would prefer to use current transformers as this feels less invasive.

 

On a separate point, my immersion heater has a dedicated supply back to the consumer unit. Is there any reason not to put the SSR near the consumer unit even though this is some distance from the immersion heater? Obviously I would have to remove the current timer/programmer next to the immersion heater.

Link to comment
Share on other sites

@sam  I built my system the way it is because I have a convenient split that allows me to measure generation and usage separately.  I agree it is unusual to be able to do that.

 

I did previously at the last house have a Arduino based system with a single current transformer that sensed direction of current flow, but it's measurement was far from perfect.  If you are going to build your own diverter to work from a single current transformer, you would be better off using a design that is based on an electricity meter chip which will have perfected how to measure and sense direction of current from a single probe.  More than one design has been published and @JSHarris has built one based on this and may be able to advise better than me.

  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...

I know this is quite an old thread but I'm still catching up on what's available in the market place and what things people have done.

I've done a fair bit of microcontroller work, mainly WinAVR targetted at Atmel ATMega chips (same chips as Arduino use, but for a lot of my designs I couldn't afford their library overhead so I never bothered with it) and it's usually been enjoyable, apart from chasing that rogue interrupt that you mistyped that makes the whole thing do something really odd...

 

I wondered if it would be worth "productionising" a solar diverter design a bit based on the @ProDaveand the @JSHarris designs. It wouldn't take me long to draw and manufacture a double sided PCB and populate the tricky SMT components for this project and it shouldn't cost too much if there are more than 3 boards made. (The electricity meter chips are mostly SMT these days making them less DIY friendly) It could have a few standard interfaces  - either industry standard or we agree them here - and a number of useful outputs (DHW and battery charger switching is probably enough) plus data collection to say an SD card. We would then have the advantage of sharing a common architecture so that we could all contribute to developing the design - the idea is that what helps one will help all - and of course we would all know exactly how it all worked.

Link to comment
Share on other sites

Interesting idea.

 

Building it and putting it into production comes with all the overheads of certifying it for the EMC directive etc and CE marking it. Not something I am prepared to do for what is likely very small production runs.

 

There may be some merit in pooling a common design as a "Open Dump controller" (would need to choose a better name, but must start with the word Open) for people to build themselves.  If you are going down that route then the design based on the electricity meter chips is the one to go for, rather than my rather simple arduino only design.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...