Microcontrollers > Microcontrollers/General

Control for heating with solar off grid no batteries

<< < (2/35) > >>

OperaHouse:
This general post I had ready.  Will PM you some working software to get you started.  Sent, let me know if you got it.

One thing you will likely want to do is some data logging.  There is no need for added displays.In the Arduino software there is a TOOLS page.  Just select Serial Monitor and you can read out any data stored in active memory through the USB port onto your laptop.  In your software just use the print functions for data and to format the screen with labels.  This is not permanent memory as it will be lost when power is removed.  It is also erased every time the USB port is plugged in as that automatically sends a RESET to the micro. That problem can be worked around by putting an electrolytic capacitor from the RESET (+ of capacitor) to the GND pin of the micro.  I use a 100uF, but it probably works with a 4.7uF.  This works with all the variations of this board.  The photo shows this capacitor along with the Dupont pins and resistor leads making connections to the board. 

A power meter can be easily included in the software. In many cases the voltage will be fixed.  Since the resistance doesn't change, the power is proportional to the PWM number sent to the FET driver.   Feeding that through a 4.7K resistor to a 10uF capacitor will give a proportional voltage of 0-5V of the PWM. There are many small LED meters that can be purchased on ebay for under $2. Make sure the meter has at least two decimal places. A pot can be used to cal in the meter.  Choose at least 100K pot  to put as little loading on the capacitor as possible. Multiple data values can be displayed using a LED to identify what units they are such as peak wattage.
 
This averaging method can also be done across the heater element and it will read out the actual average heater voltage. Adjusting the voltage sense pot for the maximum voltage is the best way to determine the power point voltage.

Mounting the UNO can be a problem. Some have three mounting holes, some have none. Clearance is very tight and you are likely to short out or damage the board with metal hardware .  I have always used a slice of dense packing foam and just hot melt it to a surface. There are snap in mounts for the UNO that cost more than the board.  Go cheap and easy. 

The software isn't hard to calculate daily power.  Just add the PWM value every six minutes to the DAILY variable.  Over a day that number will likely stay under 16K The UNO has a convenient MAP function that will do the conversion for you into a 0-255 value that the PWM port can take.

               meter = map(DAILY, 0, 9180, 0, 255);

Maximum PWM = 255,  255 X 6 readings a hour = 1530 counts, 1530 counts/hr X 6 hours = 9180 counts

This falls well under the 16K limit. If you expect power to be lower, you could double the number of readings each hour.  Just choose some number of hours that will give you a realistic value for the day.  Use the power point voltage the capacitor bank runs at to obtain the maximum wattage
that could be obtained from the heater at 100% duty cycle.

Wattage at maximum set voltage = 820W X 6 hours = 4.92KWH

The maximum voltage out for the PWM is almost 5V averaged. This matches up closely with the values in the example.  0-2V, 0-3V, 0-10V and 0-20V meters are common. A resistor voltage divider can be used then to obtain voltages under 5V.  Values over 5V (5KWH) can't be obtained unless an op amp is used to multiply the voltage.





OperaHouse:
Couldn't find a way to load the sketch file directly into the PM. You will have to copy it
into a new sketch.  The email word processor sorta clobbers it a bit with some comments ending
up on a new line. The compiling will stop at those lines as an error. Initial software can be
tested by connecting the pot to the 3.3V pin of the micro.  The transition from counting up to
counting down will probably happen with A0 at 3.0-3.1 volts at the input.  The Serial screen
in TOOLS will display the raw count and the number sent to the PWM.  The counting is slowed
down on purpose.  You will see at the two extremes the count will vary from PWM output.  This is
to prevent narrow pulses that would only result in FET heating.

The analog voltage signal is pin A0 and the PWM signal to drive the opto isolator is pin 3. The
opto isolator provides a simple way to do voltage level shifting  and isolation.  A blown FET
can never destroy the micro and the FET and capacitor bank can be as close to the heating as
possible with the controller being 100 feet away. A LED is in series with the drive and
provides an indication of drive being present. If you have 13.5 or 15V there will still be
enough voltage after subtracting the LED voltage to drive the FET.  Opto isolators are slow but
fast enough at 490Hz. The waveforms I have observed are quite clean.  The slow transition pretty
much eliminates inductive problems. I have no heating problems at 52V and doubt your supply at
over 100V will either. What FET did you choose?  A 10-20 ohm gate resistor is optional when
using multiple FET. Most often when a FET fails the Gate will short out.  This makes it easier
to figure out which FET is shorted as the bad one will have the lowest resistance to common.
I don't use them as the system already has enough resistance in it. I use a RC snubber across
the FET to eliminate any possible noise.  Your PC power supply will have at least two of these
on the AC coming in.  These X rated capacitors are suitable for the continuous surges.  Use a
15-47 1W power resistor in series.  Capacitor value is not that critical.

The first testing of the drive should be done with only one bank of capacitors and one or two
100W light bulbs. This will keep you out of extreme current conditions that might destroy things.
Available current from solar panels quickly drops off as you approach maximum panel voltage.
There will likely be enough range in the adjustment pot to hit maximum voltage and operate the
PWM mid level with just a single lamp.  If not reduce the number of panel strings connected for
the test.   The on board LED (Pin 13) will flash according to power level.  There is always a
single flash to indicate the program is working.  Then it will flash up to eight times (I think)
to indicate power level before a pause.  The TX and RX LED will flash as data is sent to the
laptop when connected.  If that all works, the other capacitor banks can be connected.  These
will be lethal voltages so wait for the voltage to drop with a voltmeter before connecting.
Breakers or light switches can be used as disconnects.  While not rated for DC, when turned off
the voltage potential across the contacts from the capacitor bank will not be that great.




ontfarmer:
Just got in been a busy day. Hope to work on this tomorrow. The 3 FET I got is IRFP250NPBF
 200V  30A    Phototransitors  60Ma  30V    The ones out of old TV RF 2001 200V  20A

Thanks for the details. I will send PM to you.

ontfarmer:
Done the sketch for arduino followed the information you send me, having a lot of problems.

Stray 302 in program? error expected ')' before '==' token?  'serial' does not name type?

Could use some guidance, seem to be doing every thing wrong.

Thanks

OperaHouse:
That code compiles without error, I just tried it again.  When I copy it into PM or here, the word processor clobbers it.  Long lines are terminated and placed in a new line.  This is likely your problem.  Normally I suggest writing a little code, like adding onto blink, to get a feel for hoe things are ordered.

Check every line:
// are comments and ignored everything else is code.  If it reads like English, it belongs on the end of the previous line. Back it up or put a // in front of it.

Each line should begin with an if, print, void, or int.  A bracket is also ok.

Variable names followed by an = are ok.

Lines starting with a tinted word are likely ok.

Display will stop at the first error.  The error is usually the line before.

click on HELP then REFERENCE.  Every line that doesn't start with a // should follow the listed format.
time to learn a little code.  It is trial by fire.  If you don't understand it, you can't modify it later to suit your needs.  If all else fails, copy a few lines where it stops and post them here.  The problem is simply how it was copied.

When I sent you that code in a PM I went into sent messages to see what the editor had done with it.  There were no listings for any of the messages I have sent.  If they were there I could probably tell you the problem.  If you don't figure it out, send it back to me.


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version