Hello All,
Working on a Poofer project, or something similar (see: ESP8266 Powered Propane Poofer - SparkFun Learn). I want to wirelessly activate a propane fire pit, and have a flame-out indicator send a signal back to the app if no flame is detected.
TL;DR: Trying to get a “return signal” from my “FLAME OUT” LED back through the DEV board to show in the App.
Instead of manually operating the Igniter and Solenoid(s), I have a flame controller that I will be switching On/Off with the Dev Board via a relay. The controller is able to automatically switch on the Igniter and Solenoids, and includes a flame sensor that monitors if there is flame present. If there is not flame present (flame blows out, out of fuel, etc) the controller will (temporarily) shut down the solenoid/fuel flow for safety, and activate an LED light/send a signal through a 1/4" tab that tells the operator there is no flame.
HOW DO I GET THIS (RETURN) SIGNAL BACK THROUGH THE DEV BOARD TO SHOW IN MY APP??
Either the flame controller signal-out wire can attach directly to the DEV Board, or I can have that signal out wire connect to a relay, and then attach to the DEV Board. Question is: is this possible/is it possible to send a signal TO the Dev Board and then have it show up as active/ON in the app? And then turn OFF when the signal is lost (indicating flame is again present)??
Thanks for your help!
@Nick_SparkX would really appreciate your help because you’re the GOAT with this stuff!
Hey! I’m happy to have a look!
Are you using the ESP8266 and the ESP8266WiFi Library like in my project or are you on another platform?
If you’re using something similar to the example code, you’ll notice that the app is really just a webpage that you’re building out of Strings and then serving over the WiFi, so all you need to do is connect the flame out LED to an input pin (either directly or using a relay or a transistor) and then digitalRead() that pin while you’re building the webpage.
In the example code for the propane poofer, you’ll see a line like this:
if ( digitalRead(IGNITION_PIN) == 0 ){
s += "Ignitior is currently turned OFF.";}
else{
s += "Ignitior is currently turned ON.";}
s += "<br><br>\r\n"; // Go to the next line.
You could use the same structure, for example, and do this:
if ( digitalRead(FLAMEOUT_PIN) == 1 ){
s += "Flame Out Detected";}
s += "<br><br>\r\n"; // Go to the next line.
This just adds a line of text to the page that says “Flame Out Detected” whenever that pin goes high. Of course you could put whatever HTML there that you wanted, so it could show an alert box or a selected radio button or an emoji or whatever looks better than a line of text.
1 Like
Steps to Get the Flame-Out Signal Back to Your Dev Board:
- Connect the Flame Sensor Output to the Dev Board:
- Connect the signal-out wire from your flame controller (which indicates no flame) directly to a GPIO pin on your ESP8266 Dev Board.
- Ensure you use a voltage divider if the flame controller’s output signal is higher than 3.3V (the safe operating voltage for ESP8266).
- Read the Signal in Your Code:
- Write a simple code to read the state of the GPIO pin where the signal is connected. For example, if using GPIO5:
cpp
Copy code
const int flameOutPin = 5;
void setup() {
pinMode(flameOutPin, INPUT);
Serial.begin(115200);
}
void loop() {
int flameStatus = digitalRead(flameOutPin);
if (flameStatus == HIGH) {
Serial.println("Flame Out!");
// Add code to update your app
} else {
Serial.println("Flame Present");
// Add code to update your app
}
delay(1000); // Check every second
}
- Send the Signal to Your App:
- Use a communication protocol like MQTT or HTTP to send the status to your app. Here’s an example using MQTT:
cpp
Copy code
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";
const char* mqttServer = "your_MQTT_BROKER_IP";
const int mqttPort = 1883;
const char* mqttUser = "your_MQTT_USERNAME";
const char* mqttPassword = "your_MQTT_PASSWORD";
WiFiClient espClient;
PubSubClient client(espClient);
const int flameOutPin = 5;
void setup() {
pinMode(flameOutPin, INPUT);
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.println("Connecting to WiFi...");
}
client.setServer(mqttServer, mqttPort);
while (!client.connected()) {
Serial.println("Connecting to MQTT...");
if (client.connect("ESP8266Client", mqttUser, mqttPassword)) {
Serial.println("connected");
} else {
Serial.print("failed with state ");
Serial.print(client.state());
delay(2000);
}
}
}
void loop() {
int flameStatus = digitalRead(flameOutPin);
if (flameStatus == HIGH) {
client.publish("flame/status", "out");
} else {
client.publish("flame/status", "present");
}
delay(1000);
}
Important Notes:
- Safety First: Ensure all components are rated for the voltages and currents you’ll be using, especially since you’re dealing with propane.
- Testing: Thoroughly test your setup in a safe environment to ensure reliable operation.
This approach should get you up and running with a flame-out indicator in your app. Enjoy your project and stay safe!
1 Like
Thank you @Nick_SparkX and @emberjune !! I will update as the project progresses