You need to enable javaScript to run this app.

TERMOMETER CEK SUHU-ARDUINO

  • Kamis, 17 Oktober 2024
  • Administrator
  • 0 komentar

BAHAN :

  1. Sensor GY-906 MLX90614
  2. ARDUINO UNO
  3. LCD16X2 I2C
  4. DFPLAYER MINI+MICROSD
  5. SPEAKER 8OHM
  6. BREADBOARD 400PIN
  7. KABEL JUMPER DAN KABEL USB
  8. R330
  9. PUSHBUTTON

SKEMA :


KODING :

#include <Wire.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal_I2C.h> //include melalaui file
#include <DFPlayer_Mini_Mp3.h> //include melalui file
#include <Adafruit_MLX90614.h> //instal di library manager
LiquidCrystal_I2C lcd (0x27, 16, 2);
SoftwareSerial mySerial(11, 10); //RX, TX
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
int temp;
#define button 2
String result;

void setup() {
  Serial.begin(9600);
  Serial.println("Adafruit MLX90614 test");  
  mlx.begin();  
  lcd.begin();
  mySerial.begin (9600);
  mp3_set_serial (mySerial);
  mp3_set_volume (50);
  pinMode(button,INPUT_PULLUP);
 
}

void loop() {
//  lcd.setCursor (0,0);
//  lcd.print("Cek Suhu Tubuh: ");
 
  temp = mlx.readObjectTempC();
  Serial.print("tObject = "); Serial.print(temp); Serial.println("*C");
  Serial.println();

  if (temp >= 38){
    result = "Suhu Bahaya";
  }else {
    result = "Suhu Aman";
  }

    lcd.setCursor (0,0);
    lcd.print("Suhu : ");
    lcd.print(temp);
    lcd.print((char)223);
    lcd.print("C    ");
    lcd.setCursor (0,1);
    lcd.print(result);

  if (digitalRead(button) == 0 ){
    lcd.setCursor (0,0);
    lcd.print("Suhu : ");
    lcd.print(temp);
    lcd.print((char)223);
    lcd.print("C    ");
    lcd.setCursor (0,1);
    lcd.print(result);
    mp3_play (temp);
    delay(2000);
    mp3_play(111);
    delay(2000);
    lcd.clear();
  }
 
}

File MP3 didownload dan disimpan ke kartu microSD :LINK AUDIO

LINK KODING : DISINI

Bagikan artikel ini:

Beri Komentar

Jajak Pendapat

PELAJARAN ELEKTRONIKA YANG PALING ANDA SUKAI ADALAH ?

Hasil
Banner