As with any project, we will first see the schematic diagram to see its connections and investigate its operation a bit.


The operation of the system is very easy, firstly we will use ARDUINO for the creation of the code, for which we will use 2 libraries, the COUNT TIMER and the LIBRARY LIQUID CRYSTAL I2C library, taking that into account, then we will upload our code to our atmega 328p and we will start the test, we will have four buttons one for programming, another for uploading the account, another for lowering the account and finally START

This system has the autosave in the EPROM, that is to say, if we turn off the system, the final programming of the account will be saved.

The project has an optocoupled RELAY output and will turn on any domestic device that works at 220VAC 60HZ or 110vac at 50HZ and has a buzzer that will activate once the count is finished and will notify us that the ignition time has expired and the output will turn off .

The project works at 12VDC but the microcontroller at 5VDC, so internally on the pcb it has a 5VDC regulator and it has an LCD16x2 screen to view the count.

 Arduino Uno

Arduino Uno is a microcontroller board based on the ATmega328P (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.. You can tinker with your Uno without worrying too much about doing something wrong, worst case scenario you can replace the chip for a few dollars and start over again.

"Uno" means one in Italian and was chosen to mark the release of Arduino Software (IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the reference versions of Arduino, now evolved to newer releases. The Uno board is the first in a series of USB Arduino boards, and the reference model for the Arduino platform; for an extensive list of current, past or outdated boards see the Arduino index of boards.


#include   //
LiquidCrystal_I2C lcd(0x27, 16, 2)// LCD HEX address 0x3F -- change according to yours
#include "Countimer.h" //
Countimer tdown;
#include <EEPROM.h>

#define bt_set    A3
#define bt_up     A2
#define bt_down   A1
#define bt_start  A0

int time_s = 0;
int time_m = 0;
int time_h = 0;

int set = 0;
int flag1=0, flag2=0;

int relay = 7;
int buzzer = 6;

void setup() {
Serial.begin (9600);

pinMode(bt_set,   INPUT_PULLUP);
pinMode(bt_up,    INPUT_PULLUP);
pinMode(bt_down,  INPUT_PULLUP);
pinMode(bt_start, INPUT_PULLUP);

pinMode(relay, OUTPUT);
pinMode(buzzer, OUTPUT);

lcd.print("  Temporizador   ");
lcd.print("Electronica ABC");
tdown.setInterval(print_time, 999);

void print_time(){
time_s = time_s-1;
if(time_s<0){time_s=59; time_m = time_m-1;}
if(time_m<0){time_m=59; time_h = time_h-1;}

void tdownComplete(){Serial.print("ok");}


void loop(){;

if(digitalRead (bt_set) == 0){
if(flag1==0 && flag2==0){flag1=1;
set = set+1;

if(digitalRead (bt_up) == 0){
if(set==0){tdown.start(); flag2=1;}
Read more »