PEMBUATAN BEL CERDAS CERMAT 10 GROUP DENGAN TAMPILAN SEVEN SEGMENT BERBASIS ARDUINO
PENDAHULUAN
Perkembangan ilmu pengetahuan dan teknologi memberikan pengaruh yang
sangat besar terhadap pendidikan. Peningkatan kualitas pendidikan dapat
dilakukan dengan berbagai macam kegiatan, salah satunya yaitu dengan
mengadakan lomba dalam bidang pendidikan. Sesuai dengan perkembangan
zaman, fasilitas perlombaan didukung dengan alat yang modern seperti
sound system, bel cerdas cermat, proyektor dll. Pada tulisan ini penulis
fokus pada bagian bel cerdas cermat. Bel cerdas cermat merupakan alat
yang memiliki beberapa tombol tekan yang menghasilkan bunyi serta
memiliki tampilan untuk menentukan pengguna yang menekan tombol
tercepat. Lomba dengan mengunakan bel cerdas cermat tidak asing lagi
dalam dunia kompetisi. Bel cerdas cermat dimanfaatkan untuk sistem adu
cepat, namun sering terjadi kesalahan dalam menentukan pengguna yang
lebih cepat menekan. Kesalahan yang ditemukan berupa 2 atau lebih lampu
menyala secara bersamaan, hal ini disebabkan karena tekanan pada tombol
yang kurang, atau selisih waktunya yang hampir bersamaan. Selain itu
alat bel cerdas cermat biasanya memiliki ukuran besar sesuai dengan
jumlah tombol yang digunakan. Untuk mengatasi ini, dibuat alat bel
cerdas cermat berbasis arduino. Alat arduino berukuran kecil sehingga
bisa menghemat tempat serta digunakan berdasarkan program yang masukkan
ke arduino. Alat bel cerdas cermat ini menggunakan sistem otomatis
sehingga memudahkan pengguna saat perlombaan tanpa mengurangi proses
kegiatan perlombaan.HASIL DAN PEMBAHASAN
Bel cerdas cermat mengunakan alat utama yaitunya Arduino. Arduino merupakan alat mikrokontroler yang multi fungsi sesuai dengan kegunaan alat yang dibuat. Fungsi dari alat arduino bergantung pada program yang dimasukkan kedalam arduino. Program ini dinamakan sketch dan proses memasukkan program ke arduino bisa menggunakan komputer.
Alat bel cerdas cermat yang dibuat memiliki 10 tombol dengan menggunakan tampilan seven segmen. Pada alat, arduino memiliki fungsi untuk mengontrol proses masukan dan keluaran dari alat bel cerdas cermat. Saat tombol 1 ditekan, maka 9 tombol yang lain di non aktifkan dan pada tampilan seven segmen akan muncul angka 01. Saat tombol 2 ditekan, maka 9 tombol yang lain di non aktifkan dan pada tampilan seven segmen akan muncul angka 02, dan seterusnya.
Sketch
//bel cerdas cermat dengan 10
group menggunakan seven segmen led
const int buttonPin1 = 2;
const int buttonPin2 = 3;
const int buttonPin3 = 4;
const int buttonPin4 = 5;
const int buttonPin5 = 6;
const int buttonPin6 = 7;
const int buttonPin7 = 8;
const int buttonPin8 = 9;
const int buttonPin9 = 10;
const int buttonPin10 = 11;
const int nada = 36;
const int ledPin1 = 22;
const int ledPin2 = 23;
const int ledPin3 = 24;
const int ledPin4 = 25;
const int ledPin5 = 26;
const int ledPin6 = 27;
const int ledPin7 = 28;
const int ledPin8 = 29;
const int ledPin9 = 30;
const int ledPin11 = 40;
const int ledPin12 = 41;
const int ledPin13 = 42;
const int ledPin14 = 43;
const int ledPin15 = 44;
const int ledPin16 = 45;
const int ledPin17 = 46;
const int ledPin18 = 47;
const int ledPin19 = 48;
const int ledPin20 = 49;
const int ledPin32 = 32;
const int ledPin33 = 33;
const int ledPin34 = 34;
const int ledPin35 = 35;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;
int buttonState4 = 0;
int buttonState5 = 0;
int buttonState6 = 0;
int buttonState7 = 0;
int buttonState8 = 0;
int buttonState9 = 0;
int buttonState10 = 0;
void setup(){
pinMode (ledPin1, OUTPUT);
pinMode (ledPin2, OUTPUT);
pinMode (ledPin3, OUTPUT);
pinMode (ledPin4, OUTPUT);
pinMode (ledPin5, OUTPUT);
pinMode (ledPin6, OUTPUT);
pinMode (ledPin7, OUTPUT);
pinMode (ledPin8, OUTPUT);
pinMode (ledPin9, OUTPUT);
pinMode (ledPin11, OUTPUT);
pinMode (ledPin12, OUTPUT);
pinMode (ledPin13, OUTPUT);
pinMode (ledPin14, OUTPUT);
pinMode (ledPin15, OUTPUT);
pinMode (ledPin16, OUTPUT);
pinMode (ledPin17, OUTPUT);
pinMode (ledPin18, OUTPUT);
pinMode (ledPin19, OUTPUT);
pinMode (ledPin20, OUTPUT);
pinMode (ledPin32, OUTPUT);
pinMode (ledPin33, OUTPUT);
pinMode
(ledPin34, OUTPUT);
pinMode (ledPin35, OUTPUT);
pinMode (buttonPin1, INPUT);
pinMode (buttonPin2, INPUT);
pinMode (buttonPin3, INPUT);
pinMode (buttonPin4, INPUT);
pinMode (buttonPin5, INPUT);
pinMode (buttonPin6, INPUT);
pinMode (buttonPin7, INPUT);
pinMode (buttonPin8, INPUT);
pinMode (buttonPin9, INPUT);
pinMode (buttonPin10, INPUT);
pinMode (nada, OUTPUT);
}
void loop(){
buttonState1 = digitalRead (buttonPin1);
buttonState2 = digitalRead (buttonPin2);
buttonState3 = digitalRead (buttonPin3);
buttonState4 = digitalRead (buttonPin4);
buttonState5 = digitalRead (buttonPin5);
buttonState6 = digitalRead (buttonPin6);
buttonState7 = digitalRead (buttonPin7);
buttonState8 = digitalRead (buttonPin8);
buttonState9 = digitalRead (buttonPin9);
buttonState10 = digitalRead (buttonPin10);
if (buttonState1 == HIGH && buttonState2 == LOW &&
buttonState3 == LOW && buttonState4 == LOW && buttonState5 ==
LOW && buttonState6 == LOW && buttonState7 == LOW &&
buttonState8 == LOW && buttonState9 == LOW && buttonState10 ==
LOW){
digitalWrite (ledPin1, HIGH);
digitalWrite (ledPin2, HIGH);
digitalWrite (ledPin8, HIGH);
digitalWrite (ledPin9, HIGH);
digitalWrite (ledPin32, HIGH);
digitalWrite (ledPin33, HIGH);
digitalWrite (ledPin34, HIGH);
digitalWrite (ledPin35, HIGH);
digitalWrite (ledPin11, HIGH);
tone (nada, 1700);
digitalWrite (buttonPin2, LOW);
digitalWrite (buttonPin3, LOW);
digitalWrite (buttonPin4, LOW);
digitalWrite (buttonPin5, LOW);
digitalWrite (buttonPin6, LOW);
digitalWrite (buttonPin7, LOW);
digitalWrite (buttonPin8, LOW);
digitalWrite (buttonPin9, LOW);
digitalWrite (buttonPin10, LOW);
}
else if (buttonState2 == HIGH && buttonState1 ==LOW &&
buttonState3 == LOW &&
buttonState4 == LOW && buttonState5 == LOW && buttonState6 ==
LOW && buttonState7 == LOW && buttonState8 == LOW &&
buttonState9 == LOW && buttonState10 == LOW){
digitalWrite (ledPin1, HIGH);
digitalWrite (ledPin5, HIGH);
digitalWrite (ledPin6, HIGH);
digitalWrite (ledPin7, HIGH);
digitalWrite (ledPin3, HIGH);
digitalWrite (ledPin8, HIGH);
digitalWrite (ledPin9, HIGH);
digitalWrite (ledPin32, HIGH);
digitalWrite (ledPin33, HIGH);
digitalWrite (ledPin34, HIGH);
digitalWrite (ledPin35, HIGH);
digitalWrite (ledPin12, HIGH);
tone (nada, 1700);
digitalWrite (buttonPin1, LOW);
digitalWrite (buttonPin3, LOW);
digitalWrite (buttonPin4, LOW);
digitalWrite (buttonPin5, LOW);
digitalWrite (buttonPin6, LOW);
digitalWrite (buttonPin7, LOW);
digitalWrite (buttonPin8, LOW);
digitalWrite (buttonPin9, LOW);
digitalWrite (buttonPin10, LOW);
}
else if (buttonState3 == HIGH && buttonState1 == LOW &&
buttonState2 == LOW &&
buttonState4 == LOW && buttonState5 == LOW && buttonState6 ==
LOW && buttonState7 == LOW && buttonState8 == LOW &&
buttonState9 == LOW && buttonState10 == LOW){
digitalWrite (ledPin1, HIGH);
digitalWrite (ledPin2, HIGH);
digitalWrite (ledPin5, HIGH);
digitalWrite (ledPin6, HIGH);
digitalWrite (ledPin7, HIGH);
digitalWrite (ledPin8, HIGH);
digitalWrite (ledPin9, HIGH);
digitalWrite (ledPin32, HIGH);
digitalWrite (ledPin33, HIGH);
digitalWrite (ledPin34, HIGH);
digitalWrite (ledPin35, HIGH);
digitalWrite (ledPin13, HIGH);
tone (nada, 1700);
digitalWrite (buttonPin1, LOW);
digitalWrite (buttonPin2, LOW);
digitalWrite (buttonPin4, LOW);
digitalWrite (buttonPin5, LOW);
digitalWrite (buttonPin6, LOW);
digitalWrite (buttonPin7, LOW);
digitalWrite (buttonPin8, LOW);
digitalWrite (buttonPin9, LOW);
digitalWrite (buttonPin10, LOW);
}
else if (buttonState4 == HIGH && buttonState1 == LOW &&
buttonState2 == LOW &&
buttonState3 == LOW && buttonState5 == LOW && buttonState6 ==
LOW && buttonState7 == LOW && buttonState8 == LOW &&
buttonState9 == LOW && buttonState10 == LOW){
digitalWrite (ledPin1, HIGH);
digitalWrite (ledPin2, HIGH);
digitalWrite (ledPin4, HIGH);
digitalWrite (ledPin6, HIGH);
digitalWrite (ledPin8, HIGH);
digitalWrite (ledPin9, HIGH);
digitalWrite (ledPin32, HIGH);
digitalWrite (ledPin33, HIGH);
digitalWrite (ledPin34, HIGH);
digitalWrite (ledPin35, HIGH);
digitalWrite (ledPin14, HIGH);
tone (nada, 1700);
digitalWrite (buttonPin1, LOW);
digitalWrite (buttonPin2, LOW);
digitalWrite (buttonPin3, LOW);
digitalWrite (buttonPin5, LOW);
digitalWrite (buttonPin6, LOW);
digitalWrite (buttonPin7, LOW);
digitalWrite (buttonPin8, LOW);
digitalWrite (buttonPin9, LOW);
digitalWrite (buttonPin10, LOW);
}
else if (buttonState5 == HIGH && buttonState1 == LOW &&
buttonState2 == LOW &&
buttonState4 == LOW && buttonState3 == LOW && buttonState6 ==
LOW && buttonState7 == LOW && buttonState8 == LOW &&
buttonState9 == LOW && buttonState10 == LOW){
digitalWrite (ledPin4, HIGH);
digitalWrite (ledPin5, HIGH);
digitalWrite (ledPin6, HIGH);
digitalWrite (ledPin7, HIGH);
digitalWrite (ledPin2, HIGH);
digitalWrite (ledPin8, HIGH);
digitalWrite (ledPin9, HIGH);
digitalWrite (ledPin32, HIGH);
digitalWrite (ledPin33, HIGH);
digitalWrite (ledPin34, HIGH);
digitalWrite (ledPin35, HIGH);
digitalWrite (ledPin15, HIGH);
tone (nada, 1700);
digitalWrite (buttonPin1, LOW);
digitalWrite (buttonPin2, LOW);
digitalWrite (buttonPin3, LOW);
digitalWrite (buttonPin4, LOW);
digitalWrite (buttonPin6, LOW);
digitalWrite (buttonPin7, LOW);
digitalWrite (buttonPin8, LOW);
digitalWrite (buttonPin9, LOW);
digitalWrite (buttonPin10, LOW);
}
else if (buttonState6 == HIGH && buttonState1 == LOW &&
buttonState2 == LOW &&
buttonState4 == LOW && buttonState5 == LOW && buttonState3 ==
LOW && buttonState7 == LOW && buttonState8 == LOW &&
buttonState9 == LOW && buttonState10 == LOW){
digitalWrite (ledPin2, HIGH);
digitalWrite (ledPin3, HIGH);
digitalWrite (ledPin4, HIGH);
digitalWrite (ledPin5, HIGH);
digitalWrite (ledPin6, HIGH);
digitalWrite (ledPin7, HIGH);
digitalWrite (ledPin8, HIGH);
digitalWrite (ledPin9, HIGH);
digitalWrite (ledPin32, HIGH);
digitalWrite (ledPin33, HIGH);
digitalWrite (ledPin34, HIGH);
digitalWrite (ledPin35, HIGH);
digitalWrite (ledPin16, HIGH);
tone (nada, 1700);
digitalWrite (buttonPin1, LOW);
digitalWrite (buttonPin2, LOW);
digitalWrite (buttonPin3, LOW);
digitalWrite (buttonPin4, LOW);
digitalWrite (buttonPin5, LOW);
digitalWrite (buttonPin7, LOW);
digitalWrite (buttonPin8, LOW);
digitalWrite (buttonPin9, LOW);
digitalWrite (buttonPin10, LOW);
}
else if (buttonState7 == HIGH && buttonState1 == LOW &&
buttonState2 == LOW &&
buttonState4 == LOW && buttonState5 == LOW && buttonState6 ==
LOW && buttonState3 == LOW && buttonState8 == LOW &&
buttonState9 == LOW && buttonState10 == LOW){
digitalWrite (ledPin1, HIGH);
digitalWrite (ledPin2, HIGH);
digitalWrite (ledPin5, HIGH);
digitalWrite (ledPin8, HIGH);
digitalWrite (ledPin9, HIGH);
digitalWrite (ledPin32, HIGH);
digitalWrite (ledPin33, HIGH);
digitalWrite (ledPin34, HIGH);
digitalWrite (ledPin35, HIGH);
digitalWrite (ledPin17, HIGH);
tone (nada, 1700);
digitalWrite (buttonPin1, LOW);
digitalWrite (buttonPin2, LOW);
digitalWrite (buttonPin3, LOW);
digitalWrite (buttonPin4, LOW);
digitalWrite (buttonPin5, LOW);
digitalWrite (buttonPin6, LOW);
digitalWrite (buttonPin8, LOW);
digitalWrite (buttonPin9, LOW);
digitalWrite (buttonPin10, LOW);
}
else if (buttonState8 == HIGH && buttonState1 == LOW &&
buttonState2 == LOW &&
buttonState4 == LOW && buttonState5 == LOW && buttonState6 ==
LOW && buttonState7 == LOW && buttonState3 == LOW &&
buttonState9 == LOW && buttonState10 == LOW){
digitalWrite (ledPin1, HIGH);
digitalWrite (ledPin2, HIGH);
digitalWrite (ledPin3, HIGH);
digitalWrite (ledPin4, HIGH);
digitalWrite (ledPin5, HIGH);
digitalWrite (ledPin6, HIGH);
digitalWrite (ledPin7, HIGH);
digitalWrite (ledPin8, HIGH);
digitalWrite (ledPin9, HIGH);
digitalWrite (ledPin32, HIGH);
digitalWrite (ledPin33, HIGH);
digitalWrite (ledPin34, HIGH);
digitalWrite (ledPin35, HIGH);
digitalWrite (ledPin18, HIGH);
tone (nada, 1700);
digitalWrite (buttonPin1, LOW);
digitalWrite (buttonPin2, LOW);
digitalWrite (buttonPin3, LOW);
digitalWrite (buttonPin4, LOW);
digitalWrite (buttonPin5, LOW);
digitalWrite (buttonPin6, LOW);
digitalWrite (buttonPin7, LOW);
digitalWrite (buttonPin9, LOW);
digitalWrite (buttonPin10, LOW);
}
else if (buttonState9 == HIGH && buttonState1 == LOW &&
buttonState2 == LOW &&
buttonState4 == LOW && buttonState5 == LOW && buttonState6 ==
LOW && buttonState7 == LOW && buttonState8 == LOW &&
buttonState3 == LOW && buttonState10 == LOW){
digitalWrite (ledPin1, HIGH);
digitalWrite (ledPin2, HIGH);
digitalWrite (ledPin4, HIGH);
digitalWrite (ledPin5, HIGH);
digitalWrite (ledPin6, HIGH);
digitalWrite (ledPin7, HIGH);
digitalWrite (ledPin8, HIGH);
digitalWrite (ledPin9, HIGH);
digitalWrite (ledPin32, HIGH);
digitalWrite (ledPin33, HIGH);
digitalWrite (ledPin34, HIGH);
digitalWrite (ledPin35, HIGH);
digitalWrite (ledPin19, HIGH);
tone (nada, 1700);
digitalWrite (buttonPin1, LOW);
digitalWrite (buttonPin2, LOW);
digitalWrite (buttonPin3, LOW);
digitalWrite (buttonPin4, LOW); digitalWrite (buttonPin5, LOW);
digitalWrite (buttonPin6, LOW);
digitalWrite (buttonPin7, LOW);
digitalWrite (buttonPin8, LOW);
digitalWrite (buttonPin10, LOW);
}
else if (buttonState10 == HIGH && buttonState1 == LOW &&
buttonState2 == LOW &&
buttonState4 == LOW && buttonState5 == LOW && buttonState6 ==
LOW && buttonState7 == LOW && buttonState8 == LOW &&
buttonState9 == LOW && buttonState3 == LOW){
digitalWrite (ledPin1, HIGH);
digitalWrite (ledPin2, HIGH);
digitalWrite (ledPin3, HIGH);
digitalWrite (ledPin4, HIGH);
digitalWrite (ledPin5, HIGH);
digitalWrite (ledPin7, HIGH);
digitalWrite (ledPin8, HIGH);
digitalWrite (ledPin9, HIGH);
digitalWrite (ledPin20, HIGH);
tone (nada, 1700);
digitalWrite (buttonPin1, LOW);
digitalWrite (buttonPin2, LOW);
digitalWrite (buttonPin3, LOW);
digitalWrite (buttonPin4, LOW);
digitalWrite (buttonPin5, LOW);
digitalWrite (buttonPin6, LOW);
digitalWrite (buttonPin7, LOW);
digitalWrite (buttonPin8, LOW);
digitalWrite (buttonPin9, LOW);
}
else if (buttonState1 == LOW && buttonState2 == LOW &&
buttonState3 == LOW &&
buttonState4 == LOW && buttonState5 == LOW && buttonState6 ==
LOW && buttonState7 == LOW && buttonState8 == LOW &&
buttonState9 == LOW && buttonState10 == LOW){
digitalWrite (ledPin1, LOW);
digitalWrite (ledPin2, LOW);
digitalWrite (ledPin3, LOW);
digitalWrite (ledPin4, LOW);
digitalWrite (ledPin5, LOW);
digitalWrite (ledPin6, LOW);
digitalWrite (ledPin7, LOW);
digitalWrite (ledPin8, LOW);
digitalWrite (ledPin9, LOW);
digitalWrite (ledPin11, LOW);
digitalWrite (ledPin12, LOW);
digitalWrite (ledPin13, LOW);
digitalWrite (ledPin14, LOW);
digitalWrite (ledPin15, LOW);
digitalWrite (ledPin16, LOW);
digitalWrite (ledPin17, LOW);
digitalWrite (ledPin18, LOW);
digitalWrite (ledPin19, LOW);
digitalWrite (ledPin20, LOW);
digitalWrite (ledPin32, LOW);
digitalWrite (ledPin33, LOW);
digitalWrite (ledPin34, LOW);
digitalWrite (ledPin35, LOW);
noTone (nada);
}
}
Comments
Post a Comment