How to make the device turn off automatically

Hello
I’m working on a school project about an incubation system in which the device can automatically shut down in accordance with the specified time.
but I am still confused how to make the device turn off automatically when the timer is finished?
does anyone have code samples or projects?
Please help

thank you

Have you looked at the timer example in the Sketch Builder?
https://examples.blynk.cc/?board=ESP8266&shield=ESP8266%20WiFi&example=Widgets%2FTimer

Pete.

1 Like

Yes, but I don’t understand how to write code to make the device automatically turn off when the timer is over. can you help me ?

Its pretty simple. Connect a relay. So that after a set period of time is done, it will trigger the relay and turn off the device. This is what i understood by reading your post, and what you are trying to achieve.

1 Like

You don’t have to, it’s already been done for you in the example…

  // You'll get HIGH/1 at startTime and LOW/0 at stopTime.
  // this method will be triggered every day
  // until you remove widget or stop project or
  // clean stop/start fields of widget

Pete.

2 Likes

so no need to set the relay pin on the arduino ide source code?

Thank u