Using arduino, I want to turn on a TEC when the temperature of a box exceeds 2 d
ID: 3874872 • Letter: U
Question
Using arduino, I want to turn on a TEC when the temperature of a box exceeds 2 degrees Celsius. I also want to turn on 2 fans at this same temperature. Once the temperature dips below 2 degrees Celsius, I want to turn off the TEC, but have the fans shut down 2 minutes later.I understand the main idea of how to code this, but the delay implementation is giving me a little trouble. Any help would be appreciated! Using arduino, I want to turn on a TEC when the temperature of a box exceeds 2 degrees Celsius. I also want to turn on 2 fans at this same temperature. Once the temperature dips below 2 degrees Celsius, I want to turn off the TEC, but have the fans shut down 2 minutes later.
I understand the main idea of how to code this, but the delay implementation is giving me a little trouble. Any help would be appreciated!
I understand the main idea of how to code this, but the delay implementation is giving me a little trouble. Any help would be appreciated!
Explanation / Answer
As your question isn't very clear regarding what help you require, I assume you know how to code the whole program. Regarding the delay implementation, what you can do is
stop(){
digitalWrite(13, LOW); //Here 13 refers to the pin which is connected with TEC.
delay(120000); //1200000ms= 2minutes*60seconds*1000
digitalWrite(8, LOW); //8 is fan1
digitalWrite(9, LOW); //9 is fan2
}
Hope I could solve your quesry. If you still have any doubt, kindly comment below. Happy Learning :)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.