Electronics‎ > ‎

Windmill controller with PICAXE08M

In Gilbert Adams memory, my australian friend. He sent me my first PICAXE/PIC microcontroller and a breadboard to start with. This controller was possible because of him. I will never forget you, my friend.


This project is based on Glenn's work (http://www.thebackshed.com/forum/forum_posts.asp?TID=1778&PN=1 - PicLog. Windmill Logger. ) but set up for using car battery. This means that the battery will not be allowed to discharge under 12V. Anyway, the software can be modified for different values range.


Schematic and PCB:


Note: replace the 4.7V zener diode from the schematic with 5.1V one or remove it completely.!!!

Connecting relays
....



PCB


Here are two jumpers, I forgot not to show them . I used toner transfer for the third time and it was a success , just a little intervention with a permanent marker pen.

Final assembly ... almost



I used a cable from a "broken" mouse for serial comm.

Software

Well, this was a problem. I need it to know exact raw digital values for 14.4Volts, 13V and 12V. I am new on PICAXE, and I need it to read more doc. but the most important, more examples. So, the software from the Glenn was very helpful. But, another problem I discovered: no Visual Basic on my computer to try to modify Glenn's work. First tought was to make a program in freepascal with "synaser" library for serial com. Then, I discovered "Terminal window" from the programming software of PICAXE. Man, was right under my nose.

Bellow is Glenn's program modified for carriage return.

File: achizitie.bas

Start:
SYMBOL Volt = W0

Main:
readadc10 4, Volt
sertxd("Value:", #Volt, 13, 10)

goto main


And next, freepascal program for reading on serial port COM1. Again, was easy because of examples provided with synaser (googleize this word) library.

File: read_serial.pas

{$MODE DELPHI}

Program testser;

uses
 synaser, sysutils, crt;

var
  ser:TBlockSerial;
begin
  ser:=TBlockserial.Create;
  try
    ser.RaiseExcept:=True;

    ser.Connect('COM1');
    ser.Config(4800,8,'N',1,false,false);

    repeat
      writeln (ser.Recvstring(200));
    until keypressed;
  finally
    ser.Free;

  end;
end.

Test

I found this values:

- 572 for 14.4V
- 557 for 13V
- 545 for 12V

I think a little raw explanation on what I wanted to do is needed.
On program start, the charging is off and consumer disconnected. If you look at relays connections, you will see that "charging off" means always Dummy load connected.
Then program do the first read on battery and store value on Volt.
If Volt is bigger than 14.4V (572-1 to meet the condition Volt >= with 14.4V), then charging off(blue LED OFF).
If Volt is 13V or lower (Volt < 557+1) then start charging again(blue LED ON)
If Volt is bigger than 13V, then switch consumer on (again)(red LED OFF).
If Volt is equal or lower than 12V, switch consumer off (red LED ON)
Now, back on reading the battery again.

So, here is the program:

File: windmill2.bas

Start:
SYMBOL volt = W0
low 1
high 2

Main:
readadc10 4,Volt

sertxd("Value:", #Volt, 13, 10)
if volt > 571 then
low 1 endif if volt < 558 then
high 1 endif if volt > 557 then

low 2 endif if volt < 545 then
high 2 endif goto main

Urah! Program is working . Below are pictures with all situations.





Windmill controller in use (solar/windmill):


Thanks to:


 - First of all, big thanks to Gill from Australia because he made this controller possible.
 - Thank you Glenn for sharing with us your projects.
 - Many thanks to guys from The Back Shed forums who helped me to understand that discharging too much a battery car render it unuseful. I know using car battery is a bad ideea but for now is the only solution I have.
Now, back on TheBackShed forums  .

Links