Author Topic: Solar to electric Water heating.  (Read 1115 times)

0 Members and 1 Guest are viewing this topic.

Offline eidolon

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Solar to electric Water heating.
« Reply #15 on: February 09, 2017, 04:37:06 PM »
You ought to give those NANO a try.  I used to build stuff and now it is just easier to do it with a NANO.  Seen some youtube videos where they use an inverter to power a heating element.  They don't talk about the control much.  So are these PWM controllers the ones for 24V DC motors?  I would think that frequency is too high for consistent triggering at 50Hz.

Offline eidolon

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Solar to electric Water heating.
« Reply #16 on: February 10, 2017, 08:37:41 AM »
I thought about this last night.  There are more than a dozen ways you could do this ending in about the same result.  An inverter is the practical way to do this since you would need a considerable array voltage to do this directly considering the loads you have.  The nano should be given a try to automate this.  The programming would be rather simple and I could supply tested code to copy and paste. The code could be this simple.

Read battery voltage

If (Battery > 28.00) SSR = 1

If (Battery < 26.80) SSR = 0

digital Write (SSR)

Serial print data to adjust calibration

Delay 5 seconds

So, every 5 seconds it is decided to either turn on or off the SSR.  Actual voltage transitions could be determined later.  Not an authority on battery chemistry, but you need to get up around 14V to get a full charge and long battery life.  I don't know if your controller is three stage and it may not matter.  An actively used battery seldom gets out of bulk charge mode like a car.

You have the nano. SSR can be wired directly to it.  A voltage divider with a pot for calibration is needed to monitor battery.   Easiest power source is a phone wall wart, just make sure it is actually 5V as some are not regulated.  The inverter will always be on when this is used so plug into that.

NANO - Like saying you have a car, it has four wheels.  China will put any label they think will sell.  It may not have a bootloader or USB or even be UNO based.  Find a usb cable and plug it into your computer.  Universally they all seem to be loaded with BLINK program.  If it flashes you are good to go.  Don't solder in the supplied connectors.  They will be the bain of your existence.  Just take resistor leads, fold them over, crimp and solder.

Download  Arduino software then try downloading the CH340 driver.  There are instructions on the net.  I have no memory of how I did it.  Find BLINK program and edit it to make delays 4 times longer.  This will prove you can communicate with the NANO.  In TOOLS select board you are using first. 

Offline eraser3000

  • Full Member
  • ***
  • Posts: 60
  • Karma: +2/-0
Re: Solar to electric Water heating.
« Reply #17 on: February 10, 2017, 09:51:22 AM »
Actually in reality it gets a little more complicated.  Really you want to hold the voltage at float. so if that number is 27.9 then you want something like a PID adjust PWM to maintain 27.9.
So you would want to evaluate a minimum of 2-4x your adjust rate.
I don't use Arduino's much, but this page has some general PID information and implementation on an Arduino of some kind.
https://create.arduino.cc/projecthub/mjrobot/line-follower-robot-pid-control-android-setup-e5113a

void PID()
{
  P = error;
  I = I + error;
  D = error-previousError;
  PIDvalue = (Kp*P) + (Ki*I) + (Kd*D);
  previousError = error;
}

Using something like below can get you into some problems.
The 5 second delay helps.

If (Battery > 28.00) SSR = 1

If (Battery < 26.80) SSR = 0

What you would probably use is analogWrite()

https://www.arduino.cc/en/Reference/AnalogWrite

And use the PID output value as your write value.


Cheers

Offline eraser3000

  • Full Member
  • ***
  • Posts: 60
  • Karma: +2/-0
Re: Solar to electric Water heating.
« Reply #18 on: February 10, 2017, 10:07:35 AM »
That being said, a simply on at X and off at X will work just fine on smaller loads.

Offline eidolon

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Solar to electric Water heating.
« Reply #19 on: February 10, 2017, 03:01:38 PM »
"What you would probably use is analogWrite()"

Not at all. You would be mixing two frequencies. I used to make light shows this way. It isn't too bad if you PWM at 20 Hz. but that gets less than 3 bits of resolution averaged. It just might drive an inverter nuts.  The battery acts like a buffer.  Just trying to do something a beginner would understand. Like to keep it under 5 components or people get intimidated. I'd do PWM right off the DC buss of the inverter or modulate the boost. I bought a stack of 2,000W inverters and half of them I just ripped out the damaged H bridge section. Most entertainment electronics today work fine off HV DC.  I PWM my water heaters directly off the PV array.

Offline DJ

  • Jr. Member
  • **
  • Posts: 27
  • Karma: +0/-0
Re: Solar to electric Water heating.
« Reply #20 on: February 11, 2017, 06:49:53 PM »
I PWM my water heaters directly off the PV array.

Could you explain how you do that?

I saw a program for an arduino to do that but unfortunately the Wizzard that put it up expect people to be able to figure out the circuit and components for themselves which I am not anywhere near up to doing. I have a bunch of arduinos I bought but a little disillusioned.  I can't find the sort of circuits and programs I want.  I know I need to spend more time learning them which I intend to do but right now trying to pack up house and find new digs takes priority. I do have time to cobble the bits and pieces together as I have but to concentrate on learning something new is going to take a better and more relaxed state of Mind.  :0)

I will try and get the circuit below working.  At the present time I have a token battery system and would like to kick the power into the UPS at night or when the batterys get low instead of having to plug the ups in and out all the time.
This simple circuit looks like it would do the trick nicely.

I take it I would reverse the Commands?  IF > 28   SSR =0
                                                               <26    SSR=1

If you had the program and Pin out for the board I'd be very much interested to see it.

Offline eidolon

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Solar to electric Water heating.
« Reply #21 on: February 11, 2017, 07:23:24 PM »
You are in the land of 240V. In the US they have small office type water heaters that provide water for just a sink.  These use 120V heater elements and 2,000W elements are available and cheap. Your heating elements will require a much higher array voltage than is common.   In doing PWM, a capacitor stores energy and releases at a later time. Say an array can supply 5A and the PWM duty cycle is 50%.  When the FET turns on there is 5A from the array and an extra 5A from the capacitor.  Just connecting a fixed resistor to the array would greatly drag down the voltage.  By pulsing it it can be supplied with full voltage and current.  Controlling the duty cycle keeps the panel at the optimum voltage.

How much voltage can your PV array supply?  With 240V heaters, dropping the supply voltage to half that (120V) reduced the power to 1/4. dropping it to 60V would be 1/16.  That makes standard heaters pretty useless.

Using an inverter like you do solves some of that issue. It takes a battery to stabilize it.  As said before, batteries long term will not like it if they can not be charged to well over 14V periodically.  If the charge controller can supply enough current, you can keep it at close to 29V just like a bulk charge in a car. Not ideal, but you can get 5 years out of it. The program I suggested waits till voltage is high enough and then looks every 5 seconds to see if it has dropped too much, a slow PWM.

I'm traveling right now but in a few days I will write the program and list it here.  Then we can work on building it.

Offline DJ

  • Jr. Member
  • **
  • Posts: 27
  • Karma: +0/-0
Re: Solar to electric Water heating.
« Reply #22 on: February 12, 2017, 05:00:38 PM »

Excellent, Thank you!

Offline eidolon

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Solar to electric Water heating.
« Reply #23 on: February 14, 2017, 02:35:41 PM »
Here is the working program.  Load it into a sketch and rename it before saving.  If it does not compile too much or too little was copied.  The  program checks the battery every 5.5 seconds. Shorting pin 12 to ground speeds up the read to calibrate voltage divider every .5 seconds.  Try to use a resistor to the the battery 47K or higher to prevent possible possible to the micro from over voltage. Use a 2K to 5K pot to adjust voltage. This is a convenient site to calculate voltage dividers.

http://www.raltron.com/cust/tools/voltage_divider.asp

  For  Vin 28V input, R1 = 47k add 2.5K for a 5K pot, so 49.5K for the calculator value.  V out is 3.3V, chosen because it is also available on board for testing.  Using the calculator R2 is 4.71K.  Subtracting 2.5K for the pot gives 2.2K for the lower resistor.
V out is 3.3V, chosen because it is also available on board for testing.  Using the calculator R2 is 4.71K.  Subtracting 2.5K for the pot gives 2.2K for the lower resistor.  Just measure a known voltage and adjust the pot till the screen in tools measures that voltage.

The programming is very basic, but using this as a boiler plate other functions can be added.  Clicking on TOOLS, select the correct board.  Selecting serial monitor will allow you to see the data coming out of the board.



// SIMP_DIVERT_24 for Heater
// relay out PIN #10
// This is a simple SSR driver that turns on at
// at a fixed voltage and off at a lower
// Samples four times and adds those values together.
// This number is in tens of mv.
// Data is sent out serially to allow calibration
// every half second due to delay.
// Typical operating voltage gives an A/D count of about 750
// Divider values to create 3.3V
// Normal delay is 5 seconds. grounding pin 12 makes that faster.
// LED lights once per loop and when relay on.
// created 02/14/17

int battery   = 0;      // calculated  voltage in mv
int SSR       = 0;      // relay output


void setup() 
{
 Serial.begin(9600);    // setup serial port speed for data in TOOLS
 pinMode(13, OUTPUT);   // sets the digital LED pin 13 as output, onboard LED
 pinMode(10, OUTPUT);   // SSR relay out
 pinMode(12, INPUT);    // ground for 1 second loop
 digitalWrite(12,1);    // enable internal pullup (early version compatable)
}

void loop() 
{                                   // this is the start of the program
 
// turn LED pin 13 ON for once per loop blink
digitalWrite(13,1);                 // blink while reading data

// A resistive voltage divider produces about 3V3 from battery
// READ ANALOG VALUE FOUR TIMES AND ADD TOGETHER
// A/D values go from 0 to 1023

battery = analogRead(2);            // get first sample
delay(20);                          // delay for 20ms
battery = battery + analogRead(2);  // get second sample
delay(20);                          // delay for 20ms
battery = battery + analogRead(2);  // get third sample
delay(20);                          // delay for 20ms
battery = battery + analogRead(2);  // get fourth sample

// turn LED pin 13 OFF 
digitalWrite(13,0);                 // turn off blink after 60ms
 
// determine battery state
if (battery > 2900)                 // is voltage high enough?
  {
    SSR = 1;                        // turn relay ON
    digitalWrite(13,1);             // turn LED ON
  }
 
if (battery < 2800)                 // has it dropped too low?
  {
    SSR = 0;                        // turn relay OFF
    digitalWrite(13,0);             // turn LED OFF
  }
 
// output state to pin 10 
digitalWrite(10,SSR); 

//print out battery data in TOOLS
Serial.print((float)battery / 100);    // battery voltage 2 decimal places           
Serial.print("V battery   ");               
Serial.print(SSR);                     // relay state           
Serial.println(" relay  ");            // go to next line

delay (500);                           //  delay for printing every half second

// ROUTINE FOR DETERMINING LOOP TIME
// look at pin 12, is is shorted to gnd?   
if (digitalRead(12) == 1) delay (5000); // if not delay another 5 seconds
 
 }                                      // end of program