user35097: I want to make a very small 7-hour timer circuit that can turn on a relay after 7 hours. I am trying to make the first prototype with an Arduino Nano but I can't understand how to program it for such purpose. So please help me out.
Once I make a prototype in Arduino then I was thinking to make a small one  using an ATtiny13. Can I use an ATtiny13 for such purpose?

user30005: 
cant understand how to program it for such purpose so please help me out

it is fairly easy to approach such questions:
1) you can program any?
2) can you program this mcu to blink an led?
3) can you program this mcu to do short time counting?
4) can you program this mcu to do long time counting?
what you help helps you the most depends on your  answers to those questions.

user35138: The question is whether its a one shot triggering ON the relay after 7 hours and thereafter you always leave it ON or its some periodic process where every 7 hours, you want the relay to trigger ON and OFF alternatively. Presuming the latter, this can be done in 2 ways:
1) Configure a hardware timer interrupt to call a small function every second and increment a variable within that function. So after 1 hour your variables value must be 3600, therefore after 7 hours it will be 25,200. Once the variable is equal to 25200, you can ON the relay and reset the variable to 0. Factors such as the number of hardware timers and its resolution differs from one MCU to another.
2) Use a Real Time Clock like the DS1307 for this purpose and save you hardware timers for performing some other time critical operations.
Hope this helps!.

35097: <p>I want to make a very small 7-hour timer circuit that can turn on a relay after 7 hours. I am trying to make the first prototype with an Arduino Nano but I can't understand how to program it for such purpose. So please help me out.</p>

<p>Once I make a prototype in Arduino then I was thinking to make a small one  using an ATtiny13. Can I use an ATtiny13 for such purpose?</p>
 30005: <blockquote>
  <p>cant understand how to program it for such purpose so please help me out</p>
</blockquote>

<p>it is fairly easy to approach such questions:</p>

<p>1) you can program any?</p>

<p>2) can you program this mcu to blink an led?</p>

<p>3) can you program this mcu to do short time counting?</p>

<p>4) can you program this mcu to do long time counting?</p>

<p>what you help helps you the most depends on your  answers to those questions.</p>
 35138: <p>The question is whether its a one shot triggering ON the relay after 7 hours and thereafter you always leave it ON or its some periodic process where every 7 hours, you want the relay to trigger ON and OFF alternatively. Presuming the latter, this can be done in 2 ways:</p>

<p>1) Configure a hardware timer interrupt to call a small function every second and increment a variable within that function. So after 1 hour your variables value must be 3600, therefore after 7 hours it will be 25,200. Once the variable is equal to 25200, you can ON the relay and reset the variable to 0. Factors such as the number of hardware timers and its resolution differs from one MCU to another.</p>

<p>2) Use a Real Time Clock like the DS1307 for this purpose and save you hardware timers for performing some other time critical operations.</p>

<p>Hope this helps!.</p>
