FLAME INTENSITY MONITOR

COMPONENTS NEEDED

CIRCUIT DIAGRAM


#include <U8g2lib.h>
#include <Wire.h>
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0);
int fire;
int percentage;
void setup() {
  u8g2.begin();
  u8g2.setFont(u8g2_font_t0_12b_mr );
  u8g2.setCursor(30, 16);
  u8g2.print("fire");
  u8g2.setCursor(37, 32);
  u8g2.print("monitor");
  u8g2.sendBuffer();
  delay(6000);
}
void loop() {
  fire=analogRead(A5); //connect sensor to A0 pin of Arduino
  percentage= map(fire,1023,0,0,100);
  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_maniac_tr);
  u8g2.setCursor(1, 30);
  u8g2.print(" ");
  u8g2.println(percentage);
  u8g2.setFont(u8g2_font_maniac_tr);
  u8g2.setCursor(60, 30);
  u8g2.print(" % ");
  u8g2.sendBuffer();
  delay(1000);
}
  

Leave a comment