Flame Sensor Using Bharat Pi Board AndOled Display
by tmvinay95 in Living > Education
12 Views, 0 Favorites, 0 Comments
Flame Sensor Using Bharat Pi Board AndOled Display
The flame detection system is a compact and efficient solution designed to detect fire hazards using a flame sensor, the Bharat Pi board, and an OLED display. This system leverages the digital output of the flame sensor to identify the presence of a flame in real time. When a flame is detected, the system displays an alert message on the OLED screen, making it highly useful for fire safety applications.
This setup is ideal for environments where early fire detection is critical, such as kitchens, laboratories, factories, and remote locations. It is cost-effective, energy-efficient, and simple to integrate into existing safety systems.
By using the Bharat Pi board as the central processor, this system offers reliable performance and can be customized further for specific requirements. The OLED display ensures clear and immediate visual feedback, enhancing the user experience.
Supplies
Hardware Connections
- Flame Sensor:
- VCC → Connect to the 3.3V or 5V pin of the Bharat Pi board.
- GND → Connect to the GND pin of the Bharat Pi board.
- DO (Digital Output) → Connect to GPIO27 of the Bharat Pi board.
- OLED Display:
- VCC → Connect to the 3.3V pin of the Bharat Pi board.
- GND → Connect to the GND pin of the Bharat Pi board.
- SCL (Clock) → Connect to GPIO3 (I2C SCL pin).
- SDA (Data) → Connect to GPIO2 (I2C SDA pin).
Diagram Description
- The flame sensor detects the presence of a flame and sends a digital signal (LOW for flame detected, HIGH for no flame) to GPIO27.
- The OLED display communicates with the Bharat Pi board over the I2C protocol using GPIO2 and GPIO3 for data exchange.
CODING
#include<Wire.h>
#include<Adafruit_GFX.h>
#include<Adafruit_SSD1306.h>
#define flame 27
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
int flamevalue=0;
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup(){
Serial.begin(9600);
pinMode(flame,INPUT);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.display();
delay(2000);
}
void loop(){
flamevalue=digitalRead(flame);
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 10);
if (flamevalue == HIGH) {
Serial.println("The fire is present");
display.clearDisplay();
display.setTextSize(2);
display.setCursor(0,16);
display.print("fire ");
display.setTextSize(2);
display.setCursor(0,32);
display.print("Detected");
} else {
Serial.print("no fire detected");
display.print("no fire");
delay(2000);
}
display.display();
delay(1000);
}
Downloads
About Bhart Pi Board
The Bharat Pi board is an Indian-developed microcontroller or microcomputer board, similar to the Raspberry Pi or Arduino. It is designed to promote innovation in IoT, embedded systems, and robotics while supporting local manufacturing.
Key Features
- Compact Design:
- Small and portable, making it ideal for embedded systems and prototyping.
- GPIO Support:
- General-purpose input/output pins for interfacing with sensors, displays, actuators, and other peripherals.
- Programming Compatibility:
- Supports programming in Python, C, or C++.
- Works with common development environments like Arduino IDE or MicroPython (depending on the architecture).
- Connectivity Options:
- May include Wi-Fi, Bluetooth, or Ethernet for IoT applications (varies by model).
- I/O Interfaces:
- Includes standard communication interfaces such as:
- I2C: For connecting devices like OLEDs, sensors, etc.
- SPI: For high-speed data communication.
- UART: For serial communication with modules like GPS or GSM.
- Power Options:
- Can be powered via USB or external power supplies.
Applications
- IoT Projects:
- Smart home automation, environmental monitoring, etc.
- Education:
- Teaching coding, hardware interfacing, and robotics.
- Prototyping:
- Testing and developing electronic projects.
- Industrial Use:
- Automation and control systems.
Advantages
- Affordable and locally manufactured.
- Supports open-source development.
- Accessible for beginners and professionals alike.