Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Arduino 2-Step Programmable Timer Circuit, Schemes and Mind Maps of Computer Programming

How to make a simple 2-step Arduino programmable timer circuit that can be used to switch an electrical load ON/OFF with independently adjustable ON and OFF timings. The article provides a program code that can be compiled and uploaded to the Arduino board to start the timer function. The document also includes a circuit diagram with the Arduino connections.

Typology: Schemes and Mind Maps

2022/2023

Available from 07/16/2023

abu-taha
abu-taha 🇮🇳

1 document

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Arduino 2-Step Programmable Timer Circuit
In this article we learn how to make a simple 2-step Arduino
programmable timer circuit, which can be used to switch an
electrical load ON/OFF with independently adjustable ON and OFF
timings.
For example if you want a light to remain ON for 24 hours and OFF
for 2 hours, you can simply do this through a quick modification in
the program code. In the same way you can customize the output
timings to any other desired set of time intervals by changing the
code appropriately.
You just have to-compile and upload-the following code to your
Arduino board and start the timer function as per your specific
application needs.
Program Code
void setup(){
pinMode(13, OUTPUT);
}
void loop(){
digitalWrite(13, HIGH);
delay(86400000);
digitalWrite(13, LOW);
delay(3600000);
}
In the above example code the
lines-delay(86400000);-and-delay(3600000);-determine the output
ON and OFF delay time intervals respectively, in milliseconds. Here,
the figure-86400000-milliseconds corresponds to 24 hours,
while-3600000-exhibits 1 hour delay.
You can customize these two values as per your personal preference
to get the required output delays.
pf3
pf4

Partial preview of the text

Download Arduino 2-Step Programmable Timer Circuit and more Schemes and Mind Maps Computer Programming in PDF only on Docsity!

Arduino 2-Step Programmable Timer Circuit

In this article we learn how to make a simple 2-step Arduino programmable timer circuit, which can be used to switch an electrical load ON/OFF with independently adjustable ON and OFF timings. For example if you want a light to remain ON for 24 hours and OFF for 2 hours, you can simply do this through a quick modification in the program code. In the same way you can customize the output timings to any other desired set of time intervals by changing the code appropriately. You just have to compile and upload the following code to your Arduino board and start the timer function as per your specific application needs. Program Code void setup(){ pinMode(13, OUTPUT); } void loop(){ digitalWrite(13, HIGH); delay(86400000); digitalWrite(13, LOW); delay(3600000); } In the above example code the lines delay(86400000); and delay(3600000); determine the output ON and OFF delay time intervals respectively, in milliseconds. Here, the figure 86400000 milliseconds corresponds to 24 hours, while 3600000 exhibits 1 hour delay. You can customize these two values as per your personal preference to get the required output delays.

Once setup and powered, the Arduino will continue switching between the two step ON/OFF timing sequence. as long as power remains applied to the system. Circuit Diagram The complete circuit diagram along with the Arduino connections can be witnessed in the following diagram:

  •  Relay 12V/400 ohm/SPDT/5 amp =
  •  12V AC to DC Adapter =