Ebook : Make BIG LED Water Level Indicator
Ide pembuatan alat ini, ketika saya akan mandi, tiba-tiba ketika saya mernyalakan Kran air, air tidak keluar.
Padahal tandon air saya menggunakan otomatis berupa pelampung bandul merk ͞Radar͟, dimana pompa air otomatis mengisi tandon kalau air tinggal separoh.
Langsung saya naik ke tower tempat tandon air, ternyata tali bandul pelampung putus, sehingga switch
otomatis tidak tertarik, akibatnya pompa air tidak mennyala.
Timbulah ide saya untuk membuat indikator level air, sehingga jika terjadi hal diatas, akan segera di
ketahui dan dapat diatasi.
JADI ALAT INI HANYA UNTUK MENGETAHUI LEVEL/KETINGGIAN AIR SAJA, BUKAN KONTROL KETINGGIAN
Foto Proses Pembuatan
PCB saya cat agar berwarna hitam
Pemasangan kabel pita untuk menyambung display dan sensor ultrasonic
Rangkaian sudah terpasang di dinding :
PETUNJUK ;
1.
Rakit rangkaian sesuai dengan skema, untuk IC Atmega 328 gunakan soket
IC 28 Pin.
2.
masukkan sketch tandon air.ino
3.
Buka dengan software ARDUINO IDE.
4.
Masukkan sketch dengan Board Arduino UNO.
5.
Cabut IC atmega 328 dari board Arduino UNO, kemudian pasang pada
rangkaian anda.
Coding / sketch arduino IDE :
//Coded by MATHEW VARGHESE
//edited by : www.rokhmad.com WA : 08157712604
//Perhatian !! Penomoran IC sebenarnya ini berbeda dengan PIN pada Board arduino
int trig = 11; // Attach Trig of ultrasonic sensor to pin 11
int echo = 10; // Attach Echo of ultrasonic sensor to pin 10
int pin9 = 2; //Lower level
int pin2 = 9;//highest level
void setup() {
pinMode (pin2, OUTPUT);// Set pins to output for controlling I/O
void loop()
{
// Establish variables for duration of the ping,
// and the distance result in inches and centimeters:
long duration, in, cm; //'in' is inches and 'cm' is centimeter
// The PING is triggered by a HIGH pulse of 2 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
pinMode(trig, OUTPUT);
digitalWrite(trig, LOW);
delayMicroseconds(2);
digitalWrite(trig, HIGH);
delayMicroseconds(5);
digitalWrite(trig, LOW);
// The same pin is used to read the signal from the PING: a HIGH
// pulse whose duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
pinMode(echo, INPUT);
duration = pulseIn(echo, HIGH);
// Convert the time into a distance
in = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);
digitalWrite(pin3, LOW);
digitalWrite(pin4, LOW);
digitalWrite(pin5, LOW);
digitalWrite(pin6, LOW);
digitalWrite(pin7, LOW);
digitalWrite(pin8, LOW);
digitalWrite(pin9, LOW);
if (in < 40)
digitalWrite(pin9, HIGH); //Full Level
long microsecondsToInches(long microseconds)
{
// According to Parallax's datasheet for the PING, there are
// 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
// second). This gives the distance travelled by the ping, outbound
// and return, so we divide by 2 to get the distance of the obstacle.
// See: http://www.parallax.com/dl/docs/prod/acc/28015-PI...
return microseconds / 74 / 2;
}
long microsecondsToCentimeters(long microseconds)
{
// The speed of sound is 340 m/s or 29 microseconds per centimeter.
// The ping travels out and back, so to find the distance of the
// object we take half of the distance travelled.
return microseconds / 29 / 2;
}
salam e-dukasi
www.rokhmad.com