You are on page 1of 16

JOBSHEET

MIKROKONTROLER
XII TITL

SMK STRADA Tanggal


Nama :
Sistem Microkontroller
Kelas : Menyalakan 1 LED Berkedip Instruktur:
Job : 1 A. SIREGAR

I. TUJUAN: Setelah praktek


diharapkan siswa dapat :
1. Cara Kerja LED
2. program Arduino
3. Merangkai
Rangkaian LED
4. Prinsip kerja Arduino
5. Memahami Software
Arduino

II. ALAT & BAHAN:


1. Arduino
2. Kabel jumper
3. LED
4. Resistor
5. Protoboard

III. RANG1. Progaram


#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11);
//Pin10 RX , Pin 11 TX connected
to--> Bluetooth TX,RX
#define Lamp1 2
#define Lamp2 3
#define Lamp3 4
#define Lamp4 5
#define ON 0
#define OFF 1
char val;
String
statusLamp1,statusLamp2,statusLa
mp3,statusLamp4,statusLamp5,stat
usLamp6,statusLamp7,statusLamp
8;
void setup() { digitalWrite(Lamp3,OFF);
statusLamp3="C"; }
pinMode(Lamp1,OUTPUT);digital else if( val == 'D' ) {
Write (Lamp1,OFF); digitalWrite(Lamp4,OFF);
statusLamp4="D"; }
pinMode(Lamp2,OUTPUT);digital else if( val == 'I' ) {
Write (Lamp2,OFF); digitalWrite(Lamp1,OFF);
statusLamp1="A";
pinMode(Lamp3,OUTPUT);digital digitalWrite(Lamp2,OFF);
Write (Lamp3,OFF); statusLamp2="B";
digitalWrite(Lamp3,OFF);
pinMode(Lamp4,OUTPUT);digital statusLamp3="C";
Write (Lamp4,OFF); digitalWrite(Lamp4,OFF);
mySerial.begin(9600); statusLamp4="D";
Serial.begin(9600); }
} else if( val == 'S' ) {
void loop() { //send data to android apk
if( mySerial.available() >0 ) { delay(500);
val = mySerial.read();
Serial.println(val); mySerial.println(statusLamp1+stat
} usLamp2+statusLamp3+statusLam
if( val == '1' ) { p4+statusLamp5+statusLamp6+stat
digitalWrite(Lamp1,ON); usLamp7+statusLamp8+"J");
statusLamp1="1"; } //delay(500);
else if( val == '2' ) { val=' ';
digitalWrite(Lamp2,ON); }
statusLamp2="2"; } }
else if( val == '3' ) {
digitalWrite(Lamp3,ON);
statusLamp3="3"; }
else if( val == '4' ) {
digitalWrite(Lamp4,ON);
statusLamp4="4"; }
else if( val == '9' ) {
digitalWrite(Lamp1,ON); IV. PRINSIP KERJA:
statusLamp1="1";
digitalWrite(Lamp2,ON);
statusLamp2="2"; V. KESIMPULAN
digitalWrite(Lamp3,ON);
statusLamp3="3";
digitalWrite(Lamp4,ON);
statusLamp4="4";
}
else if( val == 'A' ) {
digitalWrite(Lamp1,OFF);
statusLamp1="A"; }
else if( val == 'B' ) {
digitalWrite(Lamp2,OFF);
statusLamp2="B"; }
else if( val == 'C' ) {
JOBSHEET MIKROKONTROLER
XII TITL

SMK STRADA Tanggal


Nama :
Sistem Microkontroller
Kelas : Menyalakan LED FLIP FLOP Instruktur:
Job : 2 A. SIREGAR

I. TUJUAN: Setelah praktek diharapkan siswa dapat :


1. Cara Kerja LED
2. program Arduino
3. Merangkai Rangkaian LED
4. Prinsip kerja Arduino
5. Memahami Software Arduino

II. ALAT & BAHAN:


1. Arduino
2. Kabel jumper
3. LED
4. Resistor
5. Protoboard

III. RANGKAIAN

IV. PROGRAM KODE


Int PinSaya = 4;
Int PinKamu = 3;
void loop()
{
digitalWrite(PinSaya, HIGH);
digitalWrite(PinKamu,LOW);
delay(1000);

digitalWrite(PinSaya, LOW);
digitalWrite(PInKamu,HIGH);
delay(1000);

V. PRINSIP KERJA:

VI. KESIMPULAN:
JOBSHEET MIKROKONTROLER
XII TITL

SMK STRADA Tanggal


Nama :
Sistem Microkontroller
Kelas : Menyalakan LED Berkedip Instruktur:
Job : 3 A. SIREGAR

I. TUJUAN: Setelah praktek diharapkan siswa dapat :


1. Cara Kerja LED
2. program Arduino
3. Merangkai Rangkaian LED
4. Prinsip kerja Arduino
5. Memahami Software Arduino

II. ALAT & BAHAN:


1. Arduino
2. Kabel jumper
3. LED
4. Resistor
5. Protoboard

III. RANGKAIAN

IV. PROGRAM KODE


Int PinSaya1 = 12; Int PinSaya3 = 10;
Int PinSaya2 = 11; Int PinSaya4 = 9;
Int PinSaya5 = 8; delay(1000);
digitalWrite(PinSaya2, HIGH);
delay(1000);
void setup() digitalWrite(PinSaya2, LOW);
{ delay(1000);
digitalWrite(PinSaya3, HIGH);
pinMode(PinSaya1, OUTPUT); delay(1000);
pinMode(PinSaya2, OUTPUT); digitalWrite(PinSaya3, LOW);
pinMode(PinSaya3, OUTPUT); delay(1000);
pinMode(PinSaya4, OUTPUT); digitalWrite(PinSaya4, HIGH);
pinMode(PinSaya5, OUTPUT);
delay(1000);
digitalWrite(PinSaya4, LOW);
delay(1000);
}
digitalWrite(PinSaya5, HIGH);
void loop() delay(1000);
{ digitalWrite(PinSaya5, LOW);
digitalWrite(PinSaya1, HIGH); delay(1000);
delay(1000);
}
digitalWrite(PinSaya1, LOW);

V. PRINSIP KERJA:

VI. KESIMPULAN:
JOBSHEET MIKROKONTROLER
XII TITL

SMK STRADA Tanggal


Nama :
Sistem Microkontroller
Kelas : Menyalakan LED Berkedip Instruktur:
Job : 4 A. SIREGAR

I. TUJUAN: Setelah praktek diharapkan siswa dapat :


1. Cara Kerja LED
2. program Arduino
3. Merangkai Rangkaian LED
4. Prinsip kerja Arduino
5. Memahami Software Arduino

II. ALAT & BAHAN:


1. Arduino
2. Kabel jumper
3. LED
4. Resistor
5. Protoboard

III. RANGKAIAN

IV. PROGRAM KODE


int AA = 13; int AE = 9;
int AB = 12; void setup (){
int AC = 11; pinMode(AA, OUTPUT);
int AD = 10; pinMode(AB, OUTPUT);
pinMode(AC, OUTPUT); digitalWrite (AB, LOW);
pinMode(AD, OUTPUT); digitalWrite (AC, HIGH);
pinMode(AE, OUTPUT); digitalWrite (AD, LOW);
} digitalWrite (AE, LOW);
void loop (){ delay (500);
digitalWrite (AA, HIGH); digitalWrite (AA, LOW);
digitalWrite (AB, LOW); digitalWrite (AB, LOW);
digitalWrite (AC, LOW); digitalWrite (AC, LOW);
digitalWrite (AD, LOW); digitalWrite (AD, HIGH);
digitalWrite (AE, LOW); digitalWrite (AE, LOW);
delay (500); delay (500);
digitalWrite (AA, LOW); digitalWrite (AA, LOW);
digitalWrite (AB, HIGH); digitalWrite (AB, LOW);
digitalWrite (AC, LOW); digitalWrite (AC, LOW);
digitalWrite (AD, LOW); digitalWrite (AD, LOW);
digitalWrite (AE, LOW); digitalWrite (AE, HIGH);
delay (500); delay (500);
digitalWrite (AA, LOW); }

V. PRINSIP KERJA:

VI. KESIMPULAN:
JOBSHEET MIKROKONTROLER
XII TITL

SMK STRADA Tanggal


Nama :
Sistem Microkontroller
Kelas : Menyalakan 7 SEGMENT Instruktur:
Job : 5 CHATODA A. SIREGAR

I. TUJUAN: Setelah praktek diharapkan siswa dapat :


1. Cara Kerja 7 SEGMENT
2. program Arduino
3. Merangkai Rangkaian 7 SEGMENT
4. Prinsip kerja Arduino
5. Memahami Software Arduino

II. ALAT & BAHAN:


1. Arduino
2. Kabel jumper
3. SEGMENT
4. Resistor
5. Protoboard

III. RANGKAIAN
a. 7 SEGMET

Sevent segment terdiri dari dua buah jenis yaitu sevent segment command anoda dan
commmand chatoda
Seven segment command chatoda merupakan sevent segment ber command GND, sevent
segment memimiliki 10 , dua diantaranya merupakan command dan 8 lainnya untuk pin
setiap LED pada sevent segment.
b. Rangkaian

IV. PROGRAM KODE


int S1= 10; digitalWrite(S1, LOW);
int S2= 9; digitalWrite(S2, HIGH);
int S3= 8; digitalWrite(S3, HIGH);
int S4= 7; digitalWrite(S4, LOW);
int S5= 6; digitalWrite(S5, LOW);
int S6= 5; digitalWrite(S6, LOW);
int S7= 4; digitalWrite(S7, LOW);
void setup(){ delay(1000);
pinMode (S1,OUTPUT); digitalWrite(S1, LOW);
pinMode (S2,OUTPUT); digitalWrite(S2, LOW);
pinMode (S3,OUTPUT); digitalWrite(S3, LOW);
pinMode (S4,OUTPUT); digitalWrite(S4, LOW);
pinMode (S5,OUTPUT); digitalWrite(S5, LOW);
pinMode (S6,OUTPUT); digitalWrite(S6, LOW);
pinMode (S7,OUTPUT); digitalWrite(S7, LOW);
} delay(1000);
void loop(){ }

V. PRINSIP KERJA:

VI. KESIMPULAN:
JOBSHEET MIKROKONTROLER
XII TITL

SMK STRADA Tanggal


Nama :
Sistem Microkontroller
Kelas : Menyalakan 7 SEGMENT COUNTER Instruktur:
Job : 6 ANODA A. SIREGAR

I. TUJUAN: Setelah praktek diharapkan siswa dapat :


1. Cara Kerja 7 SEGMENT
2. program Arduino
3. Merangkai Rangkaian 7 SEGMENT
4. Prinsip kerja Arduino
5. Memahami Software Arduino

II. ALAT & BAHAN:


1. Arduino
2. Kabel jumper
3. SEGMENT
4. Resistor
5. Protoboard

III. RANGKAIAN

Rangkaian
IV. PROGRAM KODE
int S1= 10; digitalWrite(S2, HIGH);
int S2= 9; digitalWrite(S3, HIGH);
int S3= 8; digitalWrite(S4, LOW);
int S4= 7; digitalWrite(S5, LOW);
int S5= 6; digitalWrite(S6, LOW);
int S6= 5; digitalWrite(S7, LOW);
int S7= 4; delay(1000);
void setup(){ // program untuk angka 2
pinMode (S1,OUTPUT); digitalWrite(S1, HIGH);
pinMode (S2,OUTPUT); digitalWrite(S2, HIGH);
pinMode (S3,OUTPUT); digitalWrite(S3, LOW);
pinMode (S4,OUTPUT); digitalWrite(S4, HIGH );
pinMode (S5,OUTPUT); digitalWrite(S5, HIGH);
pinMode (S6,OUTPUT); digitalWrite(S6, LOW);
pinMode (S7,OUTPUT); digitalWrite(S7, HIGH);
} delay(1000);
void loop(){ // BUATLAH PROGRAM ANGKA
// program untuk angka 1 UNTUK ANGKA SELANJUTNYA

digitalWrite(S1, LOW); }

V. PRINSIP KERJA:

VI. KESIMPULAN:
JOBSHEET MIKROKONTROLER
XII TITL

SMK STRADA Tanggal


Nama :
Sistem Microkontroller
Kelas : Menyalakan 7 SEGMENT COUNTER Instruktur:
Job : 7 A. SIREGAR

I. TUJUAN: Setelah praktek diharapkan siswa dapat :


1. Cara Kerja 7 SEGMENT
2. program Arduino
3. Merangkai Rangkaian 7 SEGMENT
4. Prinsip kerja Arduino
5. Memahami Software Arduino

II. ALAT & BAHAN:


1. Arduino
2. Kabel jumper
3. SEGMENT
4. Resistor
5. Protoboard

III. RANGKAIAN

Rangkaian

IV. PROGRAM KODE


int pinA = 2; OUTPUT);
int pinB = 3; pinMode(pinD, OUTPUT);
int pinC = 4; pinMode(pinE, OUTPUT);
int pinD = 5; pinMode(pinF, OUTPUT);
int pinE = 6; pinMode(pinG, OUTPUT);
int pinF = 7; }
int pinG = 8;
void loop()
void setup() {
{ //angka 1
pinMode(pinA, OUTPUT); digitalWrite(pinA, HIGH );
pinMode(pinB, OUTPUT); digitalWrite(pinB, LOW);
pinMode(pinC,
digitalWrite(pinG, LOW);
digitalWrite(pinC, LOW); delay(1000);
digitalWrite(pinD, HIGH); //angka 3
digitalWrite(pinE, HIGH); digitalWrite(pinA, LOW);
digitalWrite(pinF, HIGH); digitalWrite(pinB, LOW);
digitalWrite(pinG, HIGH); digitalWrite(pinC, LOW);
delay(1000); digitalWrite(pinD, LOW);
//angka 2 digitalWrite(pinE, HIGH);
digitalWrite(pinA, LOW); digitalWrite(pinF, HIGH);
digitalWrite(pinB, LOW); digitalWrite(pinG, LOW);
digitalWrite(pinC, HIGH); delay(1000);
digitalWrite(pinD, LOW); // // BUATLAH PROGRAM ANGKA
digitalWrite(pinE, LOW); UNTUK ANGKA SELANJUTNYA
}
digitalWrite(pinF, HIGH);

V. PRINSIP KERJA:

VI. KESIMPULAN:
JOBSHEET MIKROKONTROLER
XII TITL

SMK STRADA Tanggal


Nama :
Sistem Microkontroller
Kelas : Menyalakan 7 SEGMENT UP AND DOWN Instruktur:
Job : 8 A. SIREGAR

I. TUJUAN: Setelah praktek diharapkan siswa dapat :


1. Cara Kerja 7 SEGMENT
2. program Arduino
3. Merangkai Rangkaian 7 SEGMENT
4. Prinsip kerja Arduino
5. Memahami Software Arduino

II. ALAT & BAHAN:


1. Arduino
2. Kabel jumper
3. SEGMENT
4. Resistor
5. Protoboard

III. RANGKAIAN

Rangkaian
IV. PROGRAM KODE
int A = 3; }
int B = 4; counter--;
int C = 6; Serial.println(counter);
int D = 5; changeNumber(counter);
int E = 7; delay(300);
int F = 8; }
int G = 9; else
int DP = 10; {
int switchUpPin = 13; Serial.println("OFF");
int switchDownPin = 12; }
int counter = 0; delay(50);
int buttonUpState = 0; }
int lastButtonUpState = 0; changeNumber(counter);
int buttonDownState = 0; }
int lastButtonDownState = 0; void changeNumber(int buttonPress)
void setup() {
{ switch (buttonPress)
Serial.begin(9600); {
pinMode(A, OUTPUT); //number 0
pinMode(B, OUTPUT); case 0:
pinMode(C, OUTPUT); digitalWrite(A, LOW);
pinMode(D, OUTPUT); digitalWrite(B, LOW);
pinMode(E, OUTPUT); digitalWrite(C, LOW);
pinMode(F, OUTPUT); digitalWrite(D, LOW);
pinMode(G, OUTPUT); digitalWrite(E, LOW);
pinMode(DP, OUTPUT); digitalWrite(F, LOW);
digitalWrite(DP ,HIGH); digitalWrite(G, HIGH);
} break;
void loop() //number 1
{ case 1:
buttonUpState = digitalRead(switchUpPin); digitalWrite(A, HIGH);
buttonDownState = digitalWrite(B, LOW);
digitalRead(switchDownPin); digitalWrite(C, LOW);
digitalWrite(D, HIGH);
if (buttonUpState != lastButtonUpState) digitalWrite(E, HIGH);
{ digitalWrite(F, HIGH);
if (buttonUpState == HIGH) digitalWrite(G, HIGH);
{ break;
if(counter == 9) //number 2
{ case 2:
counter = -1; digitalWrite(A, LOW);
} digitalWrite(B, LOW);
counter++; digitalWrite(C, HIGH);
Serial.println(counter); digitalWrite(D, LOW);
changeNumber(counter); digitalWrite(E, LOW);
delay(300); digitalWrite(F, HIGH);
} digitalWrite(G, LOW);
else break;
{ //number 3
Serial.println("OFF"); case 3:
} digitalWrite(A, LOW);
delay(50); digitalWrite(B, LOW);
} digitalWrite(C, LOW);
if (buttonDownState != lastButtonDownState) digitalWrite(D, LOW);
{ digitalWrite(E, HIGH);
if (buttonDownState == HIGH) digitalWrite(F, HIGH);
{ digitalWrite(G, LOW);
if(counter == 0) break;
{ }
counter = 10; }
V. PRINSIP KERJA:

VI. KESIMPULAN: