Tut 15 : Serial data communication

Serial data communication is a communication between microcontroller and other systems like RFID reader, GPS module, GSM module or computer. The communication is done via a RS232 interface. RS232 is a standard for a serial communication interface which allows to send and receive data. With the RS232 interface it is possible to setup a connection between a microcontroller and those units. Sometime the RS232 interface is used for communication between two microcontrollers.
 
 PIC and Computer communication
 
Old computers have their own serial ports (COM), thus the communication will go through these ports. Note that modern PCs don't have a serial port so you need to get a USB to serial converter. They are available at low cost. For serial communication the line used to transmit data is called TX and the line used to receive data is called RX. When sending or recieve commands from a PC to a microcontroller, or vice versa, the informations can be viewed on PC using any hyper termial program. Another way is to send the informations through visual basic.
 Communication blog diagram 
 
 USB to UART converter

PBP Program
'program to send and receive serial data 
 
DEFINE OSC 20
   @ device hs_osc  'jika guna crytal 20Mhz
 
INCLUDE "modedefs.bas"          ' Include serial modes
x VAR Byte(3)
 
loop:                                  
SerIn2 PORTC.7, 84,keyout,[WAIT("A"),STR x\3]    'receive data
SerOut2 PORTC.6,84,[x(0)]     ' Send 1st data
pause 100
SerOut2 PORTC.6,84,[x(1)]     ' Send 2nd data
pause 100
SerOut2 PORTC.6,84,[x(2)]     ' Send 3rd data
pause 100
GoTo loop
End   

Tut 14 : RFID

RFID (Radio-Frequency IDentification) is a small electronic devices that consist of a small chip and an antenna. The chip typically is capable of carrying 2K/4K/8K bytes of data or less. The RFID device serves the same purpose as a bar code or a magnetic strip on the back of a credit card or ATM card since it provides a unique identifier for that object. 

The RFID device must be scanned to retrieve the identifying information from the cards or tags. A significant advantage of RFID devices over the others mentioned above is that the RFID device does not need to be positioned precisely relative to the scanner. 

In contrast, RFID devices will work within a few feet (up to 20 feet for high-frequency devices) of the scanner. Some short distance RFID works below than 10 cm. Some common problems with RFID are reader collision and tag collision. Reader collision occurs when the signals from two or more readers overlap. The tag is unable to respond to simultaneous queries.Systems must be carefully set up to avoid this problem. Tag collision occurs when many tags are present in a small area. But since the read time is very fast, it is easier for vendors to develop systems that ensure that tags respond one at a time.
 
RFID tags may be used as:
  • Animal tracking tags, inserted beneath the skin.
  • Tags can be screw-shaped to identify items, trees or wooden items.
  • Credit-card shaped for use in access applications.
  • Smart attendance and parking system.

 
 RFID reader and tag(transponder)
 

System block diagram


Application of RFID in parking system
 
PBP Program
'program to use RFID reader and tag 
 
DEFINE OSC 20
   @ device hs_osc                         
INCLUDE "modedefs.bas"          ' Include serial modes
DEFINE HSER_RCSTA 90h           ' Definition serial modes utk Hserin
DEFINE HSER_TXSTA 24h
DEFINE HSER_BAUD 57600             ' 57600 Bauds rate
DEFINE HSER_SPBRG 21
DEFINE HSER_CLROERR 1
 
buf VAR BYTE(7) 

' -----[ EEPROM Data ]-----------------------------------------------------
Tag1 Data "AES8915"         ' ID 1
Tag2 Data "PGL9796"          ' ID 2
Tag3 Data "PJT4769"           ' ID 3
Tag4 Data "NAV8915"          ' ID 4
Tag5 Data "BFE6529"          ' ID 5
Tag6 Data "FE6529 "            ' ID 6
Tag7 Data "*BFE652"          ' ID 7
 
loop:
HSerin [WAIT("*"),STR buf\7]    
Check_List:
'checking commands  
Goto loop 


Tut 13 : RF module

RF module is widely used for wireless data transmission. It is a low cost module for short distance especially less than 5 meter . For long distance module, it comes with higher price. It is used in most of remote control applications, remote monitoring and sensing for example in controlling some machines or robots without connecting or use wires. Sometime we can use it for sending a string of codes or data wirelessly, wireless security alarm, digital signal transmission or for household electrical appliances . Normally the transmitter and receiver module operate at 315 MHz or 433 MHz. The common IC found in RF modules are PT2262(encoder/transmitter) and PT2272(decoder/receiver).



 315MHz Transmitter 

 315MHz Receiver

PBP Program
'program to transmite and receive a signal via RF module

DEFINE OSC 20
    @ device hs_osc
INCLUDE "modedefs.bas"          ' Include serial modes

x VAR BYTE
y VAR BYTE
Synk VAR BYTE
Synk=$55   
DEFINE CHAR_PACING 1000

loop:
SerOut PORTC.6,T2400,[Synk,Synk,Synk,Synk,Synk,Synk,9,x]     'transmit
Pause 100
SerIn PORTC.7, T2400,[9],y     'receive
Pause 100
Goto loop 

Tut 12 : PWM (Pulse Width Modulation)

Pulse width modulation (PWM) is a technique for controlling analog circuits with microccontroller digital outputs. PWM is employed in a wide variety of applications, ranging from measurement and communications to power control and conversion. PWM is measured in percent (%) and normally this percentage is also called duty cycle. The PWM strength or duty cycle can be controlled from 0% to 100%.
 
In microcontroller, PWM is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages in between full on (5 Volts or 100%) and off (0 Volts or 0%) by changing the portion of the time the signal spends on versus the time that the signal spends off. The duration of "on time" is called the pulse width. To get varying analog values, you may change or modulate that pulse width.

 
The Interfacing PWM with PIC controller program is very simple and straight forward, which generates a pulse pattern in a particular frequency.

PBP Program
 'program to generate a PWM signal
 
DEFINE OSC 20
@ device hs_osc               'jika guna crytal 20Mhz
 
i VAR BYTE

loop:
FOR i = 1 TO 50
HPwm 1, 64, 1000            '25%, 1kHz PWM signal at PortC.2
PAUSE 100
NEXT i

FOR i = 1 TO 50
HPwm 1, 191, 1000             '75%, 1kHz PWM signal at PortC.2
PAUSE 100
NEXT i

GOTO loop

Tut 11 : Sound in PIC


8 ohm speaker

Circuit setup
 

PBP Program
'program PIC to sound speaker
 
DEFINE OSC 20
   @ device hs_osc                         'jika guna crytal 20Mhz
 
i var byte
j var byte
 
sound1:
 FOR i = 1 TO 100
    SOUND PORTB.3, [120,2,124,2,123,2,121,2]            ' first sound
 NEXT i

 FOR j = 200 to 210 step 1
 SOUND PORTB.3,[100,10,60,15,120,10,73,10]          'second sound alarm
 PAUSE 400
 SOUND PORTB.3,[120,10]
 PAUSE 400
 SOUND PORTB.3,[120,10]
 PAUSE 400
 SOUND PORTB.3,[120,10]
 NEXT j
GOTO sound1

Tut 10 : Servo motor

The servo motor is widely used in airplane remote controller for moving the rudder and control the acceleration in the car remote controller as well as for steering. The servo motor basically is a high quality geared DC motor equipped with electronic circuit for controlling the DC motor rotation direction and position. Normally, a servo motor can rotate to maximum (clockwise or counterclockwise) of 180 degrees in both direction.

 
The servo motor use PWM signal for controlling the DC motor; unlike normal PWM usually used in ordinary DC motor; this PWM signal is not use for controlling the rotation speed, instead it is use for controlling the motor direction or position. Most servo motor will work well on 50 Hz of PWM frequency; this mean the PWM signal should have a period of 20ms.

 
The electronic circuit inside the servo motor will response to the PWM signal width; the 1ms to 1.5ms PWM width will make the servo motor to turn clockwise (CW), the 1.5ms to 2ms PWM width will make the servo motor to turn counterclockwise (CCW and the 1.5ms PWM width will turn the servo motor to its center.

PBP Program
'Program to run a servo motor clockwise, counterclockwise and center

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

i VAR BYTE
data VAR PORTD.0

loop:
data=0
For i=1 TO 100            'CW
PULSOUT data,500
PAUSE 19
Next i
 
For i=1 TO 100                'CCW
PULSOUT data,1000
PAUSE 18
Next i
 
For i=1 TO 100                            'Center
PULSOUT data,750
PAUSE 18
Next i
 
Goto loop
End

 

Tut 9 : Stepper motor

A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has several direct relationships to these applied input pulses. The sequence of the applied pulses is directly related to the direction of motor shafts rotation. The speed of the motor shafts rotation is directly related to the frequency of the input pulses and the length of rotation is directly related to the number of input pulses applied. 

A stepper motor rotates with a fixed step angle, with a basic step angle of 0.9° and 1.8° for each clock cycle. A system configuration for high accuracy positioning is shown below. The rotation angle and speed of the stepper motor can be controlled with precise accuracy by using pulse signals from the controller. 
A stepper motor is used to achieve precise positioning via digital control. The motor operates by accurately synchronizing with the pulse signal output from the controller to the driver. Stepper motors, with their ability to produce high torque at a low speed while minimizing vibration, are ideal for applications requiring quick positioning over a short distance.

PBP Program
'Program to run a stepper motor forward and reverse

DEFINE OSC 20                             ' using 20MHz clock oscillator
@ device hs_osc
 
TRISB=0 
i VAR BYTE 
loop:
For i=0 TO 50                                          'forward direction
PORTB=101000
PAUSE 100
PORTB=011000
PAUSE 100
PORTB=010100
PAUSE 100
PORTB=100100
PAUSE 100
Next i
 
For i=0 TO 50                                          'reverse direction
PORTB=100100
PAUSE 100
PORTB=010100
PAUSE 100
PORTB=011000
PAUSE 100
PORTB=101000
PAUSE 100
Next i

Goto loop
End



Tut 8 : Switch and button

For using swith and button, we would like to understand the concept of pull-up and pull-down resistor. A pull up or pull down resistor are used on Input pins to define a state in the case an input does not have anything connected or the connected part is in the define (high impedance) state. Inputs without a defined state have the problem that the input value can be anything (0 or 1), called floating.

It is useful to steer an input pin to a known state if no input is present. This can be done by adding a pullup resistor (resistor to +5V), or a pulldown resistor (resistor to ground) on the input, with 10K being a common value.

Pull-up resistor
 
Pull-down resistor 

 
PBP Program
'Program to use pull-up resistor(press switch 1) to ON LED1 and pull-down resistor(press switch 2) to ON LED2
 
DEFINE OSC 20 ' using 20MHz clock oscillator
@ device hs_osc
sw1 var PORTD.2
sw2 var PORTD.3 
LED1 var PORTB.6  
LED2 var PORTB.7        

loop:
If (sw1=0) Then                   'sw1 is pressed, pull-up resistor
High LED1
Pause 100                       
End If
 
If (sw2=1) Then                  'sw2 is pressed, pull-down resistor             
High LED2 
Pause 100
End If
 
Goto loop
End
 

Tut 1 : Basic Laws and Assignment 1


Tutorial 1


Assignement 1



Tutorial Schedule and Room

Schedule
Group 5 : Every Friday  10am to 11am
Group 6 : Every Friday   11am to 12pm


Location
Power Electronic Lab (Formerly CEDEC Lab, next to Power Lab)
Ground Floor, PPKEE


Please be in tutorial room at the right time and the right place.

Tut 7 : Array

An array is a finite and arranged list of variables of the same type called elements. This type is called the base type. Each element is assigned a unique index so that different elements may have the same value. An array is declared by specifying the type of its elements (called array type), its name and the number of its elements enclosed within brackets:
array VAR BYTE[3]
Elements of an array are identified by their position. Indices go from 0 (the first element of an array) to N-1 (N is the number of elements contained in an array). The compiler must know how many memory locations to allocate when an array is declared and because of that the array size can’t be variable.

Elements of array      Contents of element
      array[0]                           5
      array[1]                  20
      array[2]                   25

In constant arrays, elements can be assigned their contents during array declaration. In the following example, an constant array named VOLTAGE is declared and each element is assigned specific number of volts:

 VOLTAGE VAR BYTE[5] = (5,20,25,16,12)

The number of assigned values must not exceed the specified array length, but can be less. In this case, the trailing ‘excess’ elements will be assigned zeroes.
PBP Program
' Example program to detect the maximum value in array

DEFINE OSC 20
@ device hs_osc 'jika guna crytal 20Mhz

Vin VAR BYTE[5]
i VAR BYTE
Vin_max VAR BYTE

Vin[0]=2
Vin[1]=150
Vin[2]=50
Vin[3]=245
Vin[4]=25

Vin_max=0

loop:
For i = 0 to 4
If Vin[i] > Vin_max THEN
Vin_max = Vin[i]
Pause 1000
End If
Next i

Goto loop
End
      


Tut 6 : Analog to Digital Conversion ADC

Analog to digital conversion (ADC) is necessary when dealing with analog values, they need to be converted to digital values so that the PIC may understand the signals. The signals typically involve many analog signals such as, temperature, speed, pressure, the output of a microphone, etc. Below, we will see how to read an external analog signal using a PIC microcontroller and display the conversion output (a digital number) on a bargraph LED. The input analog signal will be a varying voltage between 0-5V derived using a potentiometer. The output will be the equivalent signal shown in 8-bit binary sequence. The minimum output is 0 (binary 00000000) and the maximum output is 255 (11111111) as shown below.
Circuit Setup
PBP Program
' Example program to display analog value on bargraph LED

DEFINE OSC 20
   @ device hs_osc  'jika guna crytal 20Mhz

' -----[ Define ADC ports]-----------
define adc_bits 8       'define number of bits in result
define adc_clock 3      'clock source3=RC
DEFINE ADC_SAMPLEUS 50  'set delay 50us for every adc inputs

TRISB=0

'Allocate variables
x VAR Byte
ADCON0 = %10000010
ANSEL = 000001
  
loop:
 
ADCIN 0, x           ' Read voltage of the voltage sensor circuit port A.0 ,voltage divider pot 5k
PORTB=x
Pause 10

GoTo loop             ' Do it forever
End

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

Tut 3 : 7-segment LED and Keypad

A program to press keypad and display the numbers on 7-segment LED (common-anode).

7-segment LED display
 
It is composed of 8 LEDs- 7 segments are arranged as a rectangle for symbol displaying and there is an additional segment for decimal point displaying. In order to simplify connection, anodes or cathodes of all diodes are connected to the common pin so that there are common anode displays and common cathode displays, respectively. Segments are marked with the letters from a to g, plus decimal point (dp), as shown in figure below. On connecting, each diode is treated separately, which means that each must have its own current limiting resistor.



In addition to digits from 0 to 9, there are some letters- A, C, E, J, F, U, H, L, b, c, d, o, r, t  that can be also displayed by means of the appropriate masking.

Keypad configuration
 
PBP Program

' Example program to read keypad numbers and display with 7-segment

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

        row1 VAR PORTD.6    'declare ports
        row2 VAR PORTD.5
        row3 VAR PORTD.4
        row4 VAR PORTD.3
        col1 VAR PORTD.2
        col2 VAR PORTD.1
        col3 VAR PORTD.0
                    
        TRISD=%11111000 'assign ports
        TRISB=0
             
     loop:
    
     Low col1:High col2:High col3          'column 1

     IF (row1==0) Then                 'if key 1 is pressed
     PORTB=%1111001
     Pause 1000
     Else
     PORTB=%1111111
     EndIF
    
     IF (row3==0) Then                     'key 7
     PORTB=%1111000
     Pause 1000
     Else
     PORTB=%1111111
     EndIF
    
     IF (row4==0) Then                     'key *
     PORTB=%0111111
     Pause 1000
     Else
     PORTB=%1111111
     EndIF
    
     High col1:Low col2:High col3            'column 2

     IF (row1==0) Then                    'key 2
     PORTB=%0100100
     Pause 1000
     Else
     PORTB=%1111111
     EndIF
          
     IF (row4==0) Then                       'key 0
     PORTB=%1000000
     Pause 1000
     Else
     PORTB=%1111111
     EndIF

     High col1:High col2:Low col3           'column 3

     IF (row1==0) Then                    'key 3
     PORTB=%0110000
     Pause 1000
     Else
     PORTB=%1111111
     EndIF
    
     GoTo loop
     End
    
You should try to write your own program for numbers "4", "5", "6" "8", "9" and symbol "#"......


 

Tut 2 : Blinking LED

A program to blink LED red and green on SK40C board. The delay time is set to 1 second. The blinking will repeat continously.

 
LED and current limiting resistor

LED has two ends an anode and a cathode. Connect it properly to a power supply voltage. The diode will emit light. Depending on any power supply voltage, you need to discard the current through a current limiting resistor to protect LED from burning.

PBP Program

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

loop:  
        High PORTB.6:Low PORTB.7        
        Pause 1000                                          ' Delay for 1 second
        High PORTB.7:Low PORTB.6          
        Pause 1000                                          ' Delay for 1 second
        GoTo loop                                           ' Go back to loop and blink LED forever
        End


Hex Code
2823 01a3 00a2 30ff 07a2 1c03 07a3 1c03
281e 3003 00a1 30e6 200f 2803 01a1 3efc
00a0 09a1 1c03 281a 30ff 0000 07a0 1803
2815 07a0 0064 0fa1 2814 0008 1383 1303
1283 0064 0008 1706 1683 1306 1283 1386
1683 1386 1283 3003 00a3 30e8 018a 2002
1786 1683 1386 1283 1306 1683 1306 1283
3003 00a3 30e8 018a 2002 018a 2823 0063
018a 283f


Schematic diagram from Proteus




Tut 1 : Introduction to PIC16F877/877A

 PIC16F877 IC
 
PIC16F877 pin layout

 SK40C Development Board


SK40C and PIC16F877
 
 INTRODUCTION
 
This tutorial is to introduce the using of Microcontroller Microchip PIC16F877, its  technolgy the capabilities and the specifications of a commonly used in market and describe the experiments conducted using the SK40C development board from Cytron Technology which accomodates this microcontroller .
 
A microcontroller is a compact standalone mini-computer, optimized for control applications. Entire processor, memory and the I/O interfaces are located on a single piece of silicon so, it takes less time to read and write to extrernal devices.

The reasons why microcontrollers are incorporated in control systems are:

1) Cost: Microcontrollers with the supplemantary circuit components are much cheaper than a computer with an analog and digital I/O
2) Size and Weight: Microcontrollers are compact and light compared to computers
3) Simple applications: If the application requires very few number of I/O and the code is relatively small, which do not require extended amount of memory and a simple LCD display is sufficient as a user interface, a microcontroller would be suitable for this application.
4) Reliability: Since the architecture is much simpler than a computer it is less likely to fail.
5) Speed: All the components on the microcontroller are located on a singe piece of silicon. Hence, the applications run much faster than it does on a computer.   
 
One of the most important feature of the microcontroller is a number of input/output pins used for connection with peripherals. In this case, there are in total of thirty-five general purpose I/O pins available, which is quite enough for the most applications. In order pins’ operation can match internal 8-bit organization, all of them are, similar to registers, grouped into five so called ports denoted by A, B, C, D and E. They all have several features in common:
 
 
To become familiar how to start your first program click here
All programs written in C langguage.
 
To see a lot of projects done click here
 
In my next tutorial you will learn about basic language i.e Pic Basic Pro (PBP). It is more easier than using C language, but the programming architechture is almost the same. However, for those who are expert, some programming features in PBP are so limited, thus C langguage is most suitable. For beginners, PBP is the best choice and more prefereable. If you are good enough to master PBP, a lot of things can be done.
 

Project 18 : Aircond Temperature Controller

System test

Video on demand

Description

Aircond temperature controller comprises of PIC microcontroller, LM35D temperature sensor and relay board. The controller will maintain and control the temperature of a room set by the user. The relay board is used to turn on and off 240V AC supply to compressor. The user has flexibility to control the range of temperature, minimum and maximum degree to make sure that room is well conditioned.

This project is hoped to be an early attempt to any project related to energy saving or energy management. If we can control the compressor automatically and wisely, then a lot of energy can be utilised for other purposes. Apparently, aircond is one of loads that we may put into consideration as it runs at high power and contributes a lot in our bill. 1 h/p is equivalent to 746W. If we manage to save 10% energy, thus we manage to save 10% or more our money.

Prinsip operasi

Sebuah projek menggunakan temperature sensor LM35D utk memaparkan suhu semasa didalam bilik berhawa dingin. Ia akan mengawal litar bekalan kuasa kepada aircond (240Vac) menggunakan relay SPDT. Program PIC diatur untuk membaca suhu dan menghidupkan relay (compressor ON) jika suhu melebihi 28 darjah celcius atau mematikan relay (compressor OFF) jika suhu bilik kurang drpd 23 darjah celcius. Suhu bilik boleh dikawal oleh pengguna supaya keadaan bilik tidak terlalu sejuk atau panas (litar PIC boleh ditambah baik dengan meletakkan keypad bagi pengguna memasukkan suhu minimum/maksimum).

Disamping itu diharapkan dapat menjimatkan bil tenaga yg perlu dibayar (belum diuji dengan aircond sebenar). Sekiranya aircond dihidupkan terlalu lama pada satu keadaan suhu yg tetap maka bil yg perlu dibayar adalah agak tinggi. Utk aircond 1H/P (746W), jika dihidupkan pada suhu tetap 22 darjah celcius, compressor aircond perlu senantiasa memastikan suhu bilik tersebut adalah 22 darjah celcius. Dengan mengawal suhu antara 23 hingga 28 darjah celcius diharapkan compressor tidak perlu sentiasa hidup, maka tenaga elektrik dapat dijimatkan.

Pengiraan bil elektrik adalah berdasarkan kWh/month dimana kadar utk 200kWH pertama di Malaysia adalah RM 0.216, kadar ini akan meningkat sekiranya pengguna menggunakan lebih drpd 200kWh sebulan.

Contoh pengiraan utk 1 aircond 1H/P jika menggunakan aircond selama 6 jam sehari selama sebulan: Bilangan tenaga digunakan = 0.746kW * 6 hour * 30 hari = 134.28 kWh/month
Jumlah bil = 134.28 * RM 0.216 = RM 29.00

Mengambil kira penjimatan purata jika menggunakan sistem kawalan relay (sekitar 4 jam sehari) selama sebulan :
Bilangan tenaga digunakan = 0.746kW * 4 hour * 30 hari = 89.52 kWh/month
Jumlah bil = 89.52 * RM 0.216 = RM 19.34

Dijangkakan pengguna dapat menjimatkan hampir RM 10 utk sebulan jika menggunaka 1 aircond 1H/P. Bayangkan jika menggunakan 2 atau lebih aircond.

Selain aircond, projek ini juga boleh diaplikasikan utk mengawal kipas penyedut udara (air ventilation fan) bagi dapur.