Project 20 : Wind and Solar Hybrid System

 Solar Panels Station

Pure SineWave Inverter

Batteries Storage System

 Hybrid Controller

5kW Generator

First Test Video

Final Video

Project 19 : Solar Voltage and Current Sensor


Setup circuit for current sensing. Using conventional current sensing method, sense resistor, Rs (0.3 ohm, 20W) is placed in series with the current path that has been measured. The circuit is designed to have maximum 5A current to flow through load. For 0.8A current, the voltage across sense resistor is 0.233V(almost 0.24V) . The ohms law  0.8A*0.3 ohm = 0.24 V. The voltage is multiplied using an amplifier circuit (gain = 3.33) so that 0.78V is achieved.  This 0.78V is fed into ADC of PIC microcontroller for calculation.


For 1V ADC voltage, the PIC converts to be 1A in real current.


Using PIC microcontroller, solar voltage at 12.9V and solar output current at 0.1A is displayed via blue LCD. 140 and 7 are the variables set inside the programming code.


Close view for circuit setup. 

Tut 5 : LCD 16X2 Display

LCD DISPLAY

 
Liquid crystal display (LCD) is specifically manufactured to be used with microcontrollers for displaying different messages. It is based on the HD44780 microcontroller (Hitachi) and can display messages in two lines with 16 characters each. It displays all the letters of alphabet, Greek letters, punctuation marks, mathematical symbols etc. In addition, it is possible to display symbols made up by the user (custom character generator). Other useful features include automatic message shift (left and right), cursor appearance, LED backlight etc. 


The LCD screen consists of two lines with 16 characters each. Every character consists of 5x8 dot matrix. Some LCD displays have built in backlight (blue or green diodes).


PBP Program
' Example program to display text on LCD screen for 1 second

DEFINE OSC 20            ' using 20MHz clock oscillator
@ device hs_osc

DEFINE LCD_DREG PORTD            'port D data masuk start D.4 hgga D.7
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB                 'port B.4 utk sambungan RS
DEFINE LCD_RSBIT 4
DEFINE LCD_EREG PORTB                   'Enable bleh jalan bila guna port B.5
DEFINE LCD_EBIT 5
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2

Pause 500                  ' Wait for LCD to start
loop:

LCDOut $fe, 1, "LCD Test"                ' Display first line
LCDOut $FE,$C0, "Hello World"                  ' Display second line
Pause 1000

GoTo loop 

Tut 4 : Relay

­­A relay is a simple electromechanical switch made up of an electromagnet and a set of contacts. Relays are quite common in home appliances where there is an electronic control turning on something like a motor or a light. Relays are amazingly simple devices. There are four parts in every relay:
  • Electromagnet
  • Armature that can be attracted by the electromagnet
  • Spring
  • Set of electrical contacts

 
It is therefore connected to output pins of the microcontroller and used to turn on/off high-power devices such as motors, transformers, heaters, bulbs, etc. When a current flows through the coil, the relay is operated by an electromagnet to open or close one or many sets of contacts.


Circuit Setup
PBP Program
 
' Example program to activate relay for 1 second and deactivate for 1 second

DEFINE OSC 20 ' using 20MHz clock oscillator
@ device hs_osc

relay VAR PORTD.3    'declare ports
sw1 VAR PORTA.4
          
TRISA=1   
TRISD=0
 
loop:
 
If (sw1=1) Then
High relay
Pause 1000
Else
Low relay
Pause 1000
End If
 
GoTo loop
End