Penyesuai Kadar Oksigen Dalam Ruangan Berbasis Mikrokontroler
44
Pengujian Alat
Catu daya
3A
12V
220V
220uF/25V
AN
7805
10uF/25V
5V
100uF/50V
Di beri masukan dari PLN sebesar 200 V ke Trafo 3A kemudian di turunkan menjadi
11.43 V. Tegangan 11.43 V dari trafo di searahkan dengan menggunakan dioda 3A
sehingga di peroleh 11.43 V, untuk menjaga kesetabilan tegangan maka tegangan akan
di filter menggunakan capasitor. Ic regulator AN 7805 di gunakan untuk out put
tegangan 5 V.
Dari rancangan di atas output nya adalah 5 V, dari hasil pengujian peroleh Outputnya
adalah 5,03 V.
Display
Universitas Sumatera Utara
45
+5V
3A
R1
12V
R2
220uF/25V
220V
AN
7805
10uF/25V
5V
100uF/50V
15
10
VCC
9
reset
3
PENYESUAI
KADAR OKSIGEN
7 8 9 10 11 12 13 14
10K
1
4 5 6
2
16
26
PC.4
27
PC.5
28
PC.6
29
PC.7
22
PC.0
23
PC.2
24
PC.3
12V
FAN
ATM8535
PB.0
14
VCC+11, 43 v
4
IRF z44
12V
40
Rf
PA.0
12
13
1
100KO
Figaro
KE-50
Buzer
11
2
PB.1
12
Kristal
11. 0592MHz
13
GND
8
Universitas Sumatera Utara
Bd 139
46
ATM 8535 di masukkan program
/*=============== Code Bahasa Program ===============*/
/*****************************************************
This program was produced by the
CodeWizardAVR V1.24.7d Evaluation
Automatic Program Generator
© Copyright 1998-2005 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com
e-mail:office@hpinfotech.com
Project :
Version :
Date : 12/31/2001
Author : Freeware, for evaluation and non-commercial use only
Company :
Comments:
/*=============== Iput perogram ke ATmega 8535 ===============*/
Chip type
: ATmega8535
Program type
: Application
Clock frequency : 4.000000 MHz
Memory model
: Small
External SRAM size : 0
Data Stack size : 128
*****************************************************/
#include
#include
#include
#include
#asm
.equ __lcd_port=0x15 ;PORTC
#endasm
#define ADC_VREF_TYPE 0x00
unsigned int read_adc(unsigned char adc_input)
{
ADMUX=adc_input|ADC_VREF_TYPE;
ADCSRA|=0x40;
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCW;
}
unsigned char i,Status,t;
unsigned long Oksigen;
unsigned int FRata2,F,O2[20];
void main(void)
{
PORTA=0x00;
DDRA=0x00;
PORTB=0x00;
DDRB=0xFF;
Universitas Sumatera Utara
47
PORTC=0x00;
DDRC=0x00;
PORTD=0xFF;
DDRD=0x00;
ADMUX=ADC_VREF_TYPE;
ADCSRA=0x85;
SFIOR&=0xEF;
lcd_init(16);
lcd_gotoxy(0,0);
/*=============== Input Tampilan LCD ON ===============*/
lcd_init(16);
lcd_gotoxy(0,0);
lcd_putsf(" PENYESUAI");
lcd_gotoxy(0,1);
lcd_putsf(" KADAR OKSIGEN ");
delay_ms(1000);
lcd_clear();
while (1)
{
lcd_clear();
for (i=0;i
Pengujian Alat
Catu daya
3A
12V
220V
220uF/25V
AN
7805
10uF/25V
5V
100uF/50V
Di beri masukan dari PLN sebesar 200 V ke Trafo 3A kemudian di turunkan menjadi
11.43 V. Tegangan 11.43 V dari trafo di searahkan dengan menggunakan dioda 3A
sehingga di peroleh 11.43 V, untuk menjaga kesetabilan tegangan maka tegangan akan
di filter menggunakan capasitor. Ic regulator AN 7805 di gunakan untuk out put
tegangan 5 V.
Dari rancangan di atas output nya adalah 5 V, dari hasil pengujian peroleh Outputnya
adalah 5,03 V.
Display
Universitas Sumatera Utara
45
+5V
3A
R1
12V
R2
220uF/25V
220V
AN
7805
10uF/25V
5V
100uF/50V
15
10
VCC
9
reset
3
PENYESUAI
KADAR OKSIGEN
7 8 9 10 11 12 13 14
10K
1
4 5 6
2
16
26
PC.4
27
PC.5
28
PC.6
29
PC.7
22
PC.0
23
PC.2
24
PC.3
12V
FAN
ATM8535
PB.0
14
VCC+11, 43 v
4
IRF z44
12V
40
Rf
PA.0
12
13
1
100KO
Figaro
KE-50
Buzer
11
2
PB.1
12
Kristal
11. 0592MHz
13
GND
8
Universitas Sumatera Utara
Bd 139
46
ATM 8535 di masukkan program
/*=============== Code Bahasa Program ===============*/
/*****************************************************
This program was produced by the
CodeWizardAVR V1.24.7d Evaluation
Automatic Program Generator
© Copyright 1998-2005 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com
e-mail:office@hpinfotech.com
Project :
Version :
Date : 12/31/2001
Author : Freeware, for evaluation and non-commercial use only
Company :
Comments:
/*=============== Iput perogram ke ATmega 8535 ===============*/
Chip type
: ATmega8535
Program type
: Application
Clock frequency : 4.000000 MHz
Memory model
: Small
External SRAM size : 0
Data Stack size : 128
*****************************************************/
#include
#include
#include
#include
#asm
.equ __lcd_port=0x15 ;PORTC
#endasm
#define ADC_VREF_TYPE 0x00
unsigned int read_adc(unsigned char adc_input)
{
ADMUX=adc_input|ADC_VREF_TYPE;
ADCSRA|=0x40;
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCW;
}
unsigned char i,Status,t;
unsigned long Oksigen;
unsigned int FRata2,F,O2[20];
void main(void)
{
PORTA=0x00;
DDRA=0x00;
PORTB=0x00;
DDRB=0xFF;
Universitas Sumatera Utara
47
PORTC=0x00;
DDRC=0x00;
PORTD=0xFF;
DDRD=0x00;
ADMUX=ADC_VREF_TYPE;
ADCSRA=0x85;
SFIOR&=0xEF;
lcd_init(16);
lcd_gotoxy(0,0);
/*=============== Input Tampilan LCD ON ===============*/
lcd_init(16);
lcd_gotoxy(0,0);
lcd_putsf(" PENYESUAI");
lcd_gotoxy(0,1);
lcd_putsf(" KADAR OKSIGEN ");
delay_ms(1000);
lcd_clear();
while (1)
{
lcd_clear();
for (i=0;i