Rancang Bangun Inkubator Skala laboratorium dengan Sistem Pemanas Induksi (Induction Heating) Berbasis Mikrokontroler ATMega8535

LAMPIRAN 1
A. Gambar Inkubator

(Bahan Inkubator)

(Lapisan isolator Inkubator)

(Ukuran dan Massa Inkubator)

(Inkubator dilapisi bahan isolator kayu)

(Pemasangan Lilitan Tembaga Pada Inkubator)

Universitas Sumatera Utara

B. Gambar Rangkaian Power Supply

(Trafo pada Rangkaian Power Supply

(Rangkaian Power Supply)


(Rangkaian Power Supply Keseluruhan)

Universitas Sumatera Utara

C. Gambar Inkubator dan Rangkaian Pemanas Induksi

(Inkubator tampak dari depan)

(Inkubator tampak dari belakang)

Universitas Sumatera Utara

1. Program Alat Pada Mikrokontroler dengan Code Vision AVR

/*****************************************************
This program was produced by the
CodeWizardAVR V1.25.9 Standard
Automatic Program Generator
© Copyright 1998-2008 Pavel Haiduc, HP InfoTech s.r.l.
pranala:http://www.hpinfotech.com


Project

:

Version

:

Date

: 10/20/2016

Chip type

: Atmega8535

Program type : Application
AVR Core Clock frequency : 16.000000 MHz
Memory model


: Small

External RAM size

:0

Data stack size

: 128

*****************************************************

#include
#include
#include

// Declare your global variables here

void main(void)

{
//PORTA initialization
//Func7 = InFunc6 = InFunc5 =
//State7 = TState6 = T

InFunc0 = In

State0 = T

Universitas Sumatera Utara

PORTD=0x00;
DDRD=0xFF;
//Time/counter 1Initialization
//Clock Source : System Clock
//Clock Value : 10800 Khz
//Mode : Fast PWM Top = 00FFh
//OC1A output : Non-Inv
//OC1B output : Non-Inv
//Noise canceler : Off

//Input Capture on Falling edge
//Timer1 overflow interruption : Off
TCCR1A = 0xA1
TCCR1A = 0xA1

#define heater1 PORTC.6
#define heater2 PORTC.7
// Alphanumeric LCD Module functions
#asm
.equ __lcd_port=0x15 ;PORTC
#endasm
#include

// Standard Input/Output functions
#include

#include

#define ADC_VREF_TYPE 0x40


// Read the AD conversion result
unsigned int read_adc(unsigned char adc_input)
{

Universitas Sumatera Utara

ADMUX=adc_input | (ADC_VREF_TYPE & 0xff);
// Delay needed for the stabilization of the ADC input voltage
delay_us(10);
// Start the AD conversion
ADCSRA|=0x40;
// Wait for the AD conversion to complete
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCW;
}

// Declare your global variables here

void main(void)

{
PORTA=0x00;
DDRA=0x00;
PORTB=0x00;
DDRB=0x00;
PORTC=0x00;
DDRC=0x00;
PORTD=0x00;
DDRD=0x00;

// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;

Universitas Sumatera Utara


// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer 1 Stopped
// Mode: Normal top=FFFFh
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer 1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;

OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;

// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer 2 Stopped
// Mode: Normal top=FFh
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;

Universitas Sumatera Utara

OCR2=0x00;
// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off

MCUCR=0x00;
MCUCSR=0x00;
// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;
// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud Rate: 9600
UCSRA=0x00;
UCSRB=0x18;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x4D;
// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;

// ADC initialization
// ADC Clock frequency: 750.000 kHz
// ADC Voltage Reference: AVCC pin
// ADC High Speed Mode: Off
// ADC Auto Trigger Source: None
ADMUX=ADC_VREF_TYPE & 0xff;
ADCSRA=0x84;

Universitas Sumatera Utara

SFIOR&=0xEF;
lcd_init(16);
lcd_clear( );
lcd_gotoxy(0,0);
lcd_puts(sementara);
ftoa(suhu_c,1,sementara);
lcd_gotoxy(0,1) ;
lcd_puts(“Wulan Lbs_Inkubator Induksi”);
delay_ms(100);
while (1)
{

// Place your code here
SUHU= read_adc(0)+22;
suhu_c=(float)SUHU*500/1023;
sprintf(sementara,"%i",SUHU);
if (suhu > 100)
{
PORTC.6 = 0;
PORTC.7 = 0;
}
if (suhu < 100)
{
PORTC.6 = 1;
PORTC.7 = 1;
delay_ms(100);
}
}
{

Universitas Sumatera Utara

2. Program Antarmuka Komputer menggunakan Software Visual Basic 6.0.

/*****************************************************
Private Sub Form_Load()
Timer1.Enabled = False
MSComm1.PortOpen = True
Text1(0).Text = 99 - VScroll2.Value
Text1(1).Text = 59 - VScroll1.Value
Text2(0).Text = ""
Text2(1).Text = ""
VScroll1.Max = 58
VScroll1.Min = 0
VScroll2.Max = 99
VScroll2.Min = 0
VScroll1.Value = 58
VScroll2.Value = 99
Label1(5).Caption = Chr(176) & "C"
End Sub

Private Sub Command1_Click() 'Run/Stop
Timer1.Interval = (Val(Text1(0).Text) * 60 + Val(Text1(1).Text)) * 1000
If Timer1.Enabled = False Then
Timer1.Enabled = True
Command1.Caption = "Stop"
Command2.Enabled = False
Command3.Enabled = False
Else
Timer1.Enabled = False
Command1.Caption = "Run"
Command2.Enabled = True
Command3.Enabled = True
End If

Universitas Sumatera Utara

End Sub

Private Sub MSComm1_OnComm()
xx = MSComm1.Input
On Error GoTo errhand
Text2(0).Text = Asc(Left(xx, 1))
Text2(1).Text = Asc(Right(xx, 1))
With Adodc1.Recordset .
AddNew !
jam = Time !
suhu = Val(Text2(0).Text) !.
Update
End With

Adodc1.Recordset.Requery
Adodc1.Recordset.MoveLast
errhand:
Exit Sub
End Sub

Universitas Sumatera Utara