{"id":487,"date":"2022-11-18T02:04:51","date_gmt":"2022-11-18T02:04:51","guid":{"rendered":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/?p=487"},"modified":"2022-12-15T20:04:23","modified_gmt":"2022-12-15T20:04:23","slug":"flame-sensor-and-relay-fan","status":"publish","type":"post","link":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/2022\/11\/18\/flame-sensor-and-relay-fan\/","title":{"rendered":"Flame sensor and Relay (Fan)"},"content":{"rendered":"<p>For part of the final project for my first-year engineering class, I had to design a circuit that would extinguish a flame upon sensing it. To accomplish this task, I used a flame sensor in connection to a relay and a fan. The flame sensor can detect both flames and UV light as well as being able to output both digital and analog signals. I used the analog output of the sensor for this circuit. Upon sensing a flame or IR light source, it sends a signal to the Arduino. Then a signal is sent to the relay. A relay is a switch controlled by an electromagnet, so once it receives a signal, it switches to power on the fan. Here is a video showcasing the circuit in action.<\/p>\n<p><iframe loading=\"lazy\" title=\"Flame Sensor, Relay, and Fan\" width=\"1080\" height=\"608\" src=\"https:\/\/www.youtube.com\/embed\/93EzmMzugUo?feature=oembed\"  allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>Here is the code for the circuit and a diagram of the fan and the relay.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-492 alignleft\" src=\"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-content\/uploads\/sites\/1702\/2022\/11\/Flame-sensor-code-300x250.png\" alt=\"\" width=\"478\" height=\"398\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div class='et-learn-more clearfix'>\n\t\t\t\t\t<h3 class='heading-more'>Flame Sensor Code<span class='et_learnmore_arrow'><span><\/span><\/span><\/h3>\n\t\t\t\t\t<div class='learn-more-content'>int sensorValue = 0;<\/p>\n<p>void setup() {<\/p>\n<p>pinMode(A0, INPUT);<\/p>\n<p>Serial.begin(9600); pinMode(LED_BUILTIN, OUTPUT);<\/p>\n<p>}<\/p>\n<p>void loop() {<\/p>\n<p>sensorValue = analogRead(A0);<\/p>\n<p>Serial.println(sensorValue);<\/p>\n<p>delay(10);<\/p>\n<p>if(sensorValue &lt;= 700){ digitalWrite(13, HIGH);<\/p>\n<p>}<\/p>\n<p>else{<\/p>\n<p>digitalWrite(13, LOW);<\/p>\n<p>}<\/p>\n<p>}<\/div>\n\t\t\t\t<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-493\" src=\"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-content\/uploads\/sites\/1702\/2022\/11\/relay-diagram-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For part of the final project for my first-year engineering class, I had to design a circuit that would extinguish a flame upon sensing it. To accomplish this task, I used a flame sensor in connection to a relay and a fan. The flame sensor can detect both flames and UV light as well as [&hellip;]<\/p>\n","protected":false},"author":1821,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[8,9],"tags":[],"class_list":["post-487","post","type-post","status-publish","format-standard","hentry","category-engr-199","category-fire-fighting-robot"],"_links":{"self":[{"href":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-json\/wp\/v2\/posts\/487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-json\/wp\/v2\/users\/1821"}],"replies":[{"embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-json\/wp\/v2\/comments?post=487"}],"version-history":[{"count":11,"href":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-json\/wp\/v2\/posts\/487\/revisions"}],"predecessor-version":[{"id":602,"href":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-json\/wp\/v2\/posts\/487\/revisions\/602"}],"wp:attachment":[{"href":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-json\/wp\/v2\/media?parent=487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-json\/wp\/v2\/categories?post=487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/jclay2-engr\/wp-json\/wp\/v2\/tags?post=487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}