Hiba Kharma
Published

Fire Detection Prototype using Hexabitz Modules

This fire detection prototype measures room temperature and color and sends an audible alarm in the event of a fire.

BeginnerFull instructions provided2 hours145
Fire Detection Prototype using Hexabitz Modules

Things used in this project

Hardware components

Audio Speaker Module (H07R30)
Hexabitz Audio Speaker Module (H07R30)
×1
4-Pin USB-Serial Prototype Cable
Hexabitz 4-Pin USB-Serial Prototype Cable
×1
BitzClamp
Hexabitz BitzClamp
×3
Hexabitz Temperature, Humidity, Light, Color, Sound and Motion Sensor Hub (H0AR9x)
×1
STLINK-V3MODS Programmer (H40Rx)
Hexabitz STLINK-V3MODS Programmer (H40Rx)
×1
RGB LED Module (H01R0x)
Hexabitz RGB LED Module (H01R0x)
×1

Software apps and online services

STM32CUBEPROG
STMicroelectronics STM32CUBEPROG

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

project

Code

Untitled file

C/C++
/*
 BitzOS (BOS) V0.2.5 - Copyright (C) 2017-2021 Hexabitz
 All rights reserved

 File Name     : main.c
 Description   : Main program body.
 */
/* Includes ------------------------------------------------------------------*/
#include "BOS.h"

/* Private variables ---------------------------------------------------------*/
uint16_t Redd, Greenn, Bluee;
float temperaturee;
/* Private function prototypes -----------------------------------------------*/

/* Main function ------------------------------------------------------------*/
int main(void){

	Module_Init();		//Initialize Module &  BitzOS

	//Don't place your code here.
	for(;;){
	}
}/*
 BitzOS (BOS) V0.2.5 - Copyright (C) 2017-2021 Hexabitz
 All rights reserved

 File Name     : main.c
 Description   : Main program body.
 */
/* Includes ------------------------------------------------------------------*/
#include "BOS.h"

/* Private variables ---------------------------------------------------------*/
uint16_t Redd, Greenn, Bluee;
float temperaturee;
/* Private function prototypes -----------------------------------------------*/

/* Main function ------------------------------------------------------------*/
int main(void){

	Module_Init();		//Initialize Module &  BitzOS

	//Don't place your code here.
	for(;;){
	}
}

/*-----------------------------------------------------------*/

/* User Task */
void UserTask(void *argument){

		while(1){
		SampleRGB( &Redd,&Greenn,&Bluee);
		SampleTemperature( &temperaturee);
		if((Redd>=(Greenn+1))&&(Redd>=(Bluee+2)))
		{

				if(temperaturee > 8.0f)
					{

					  messageParams[0] = 1;
					  messageParams[1] = 4;
					  messageParams[2] = 10;
					  SendMessageToModule (2, CODE_H07R3_PLAY_TUNE,3);
					  
					  messageParams[0] = 0;
					   messageParams[1] = RED;
					   messageParams[2] = 100;
					  SendMessageToModule(3, CODE_H01R0_COLOR, 3);
					  Delay_ms(1);
					}


		}
		else
							{
								SendMessageToModule(3, CODE_H01R0_OFF, 0);
							}
		HAL_Delay(1);


	}
}

/*-----------------------------------------------------------*/




--------------------------------------------*/

Credits

Hiba Kharma
2 projects • 5 followers

Comments