Timer and smoke detector.

I dont know what value you receive from a smoke detector. But switching on a relay for 10 mins, follow this approach.

  • As an initial step start with delay(), and give a delay for 10mins. Ofcourse this is not advisable, as delay will delay your entire code for 10mins. As you are learning, delay will help you easily prototype and see whether it's working.
  • Once you find your system can switch on the pin for 10mins. Have a look at the e.g. code 'Blink Without delay'. This is the advisable approach.