Count down timer based on PIC16F628A and OLED display
module. Included C code and circuit diagram. Time span is 99 minutes. Setting the time is by the Rotary Encoder, for increasing or decreasing the time.
When the time reaches zero the buzzer sounds for
30 seconds. To stop the buzzer turn the Rotary Encoder.
22nF caps are for switch bounce.
OLED module is 0.96" 128x64, 4 pins connector I2C interface. Driver IC
is SSD1306.
Rotary Encoder is from EBAY: https://www.ebay.co.uk/sch/i.html
OLED EGG TIMER AND THERMOMETER
Count down timer based on PIC16F876A and OLED display
module. Included C code and circuit diagram. Time span is 100 minutes. Setting the time is by MINUTES /
SECONDS pushbuttons which advances the minutes display by 1 per second.
Holding the pushbutton counts faster. Pressing MINUTES and SECONDS
together resets the display. Pressing START / STOP starts the countdown.
Pressing START / STOP during count pauses or restarts the counting. When the time reaches zero the buzzer sounds for
30 seconds. DS18B20 digital sensor has temperature reading of -55 to 99.9 centigrade. The sensor doesn't require calibration. The software updates the reading every 10 seconds.
OLED module is 0.96" 128x64, 4 pins connector I2C interface. Driver IC
is SSD1306.
Timer based on PIC16F628A and OLED 0.96", 128x64, SSD1306 driver. Included C code for MPLAB-X, and circuit diagram. Time span is 1 second to 99 minutes. Setting the time is by pressing 4 keys starting with tenth of minutes. * key starts the countdown, # key stops the countdown and zeros the time, to stops the alarm press any key.
Relay drive output is high from start to alarm, it can be used for driving a relay for external functions. OLED brightness can be set in the code.
Buzzer is a piezo crystal.
OLED EGG TIMER WITH DS18B20 THERMOMETER
Timer based on PIC16F628A and OLED 0.96", 128x64, SSD1306 driver. Included C code for MPLAB-X, and circuit diagram. Time span is 1 second to 99 minutes. Setting the time is by Min / Sec pushbuttons. To reset the time press Sec and Min simultaneously. Stop/Start button starts, pauses the countdown and stops the alarm.
Relay drive output is high from start to alarm, it can be used for driving a relay for external functions. OLED brightness can be set in the code.
Temperature sensor is DS18B20, range -55 to 99.9 centigrade.
EGG TIMER WITH TM1637 LED MODULE
Timer based on PIC16F628A 4 digits 7 segment module. Included C code for MPLAB-X, and circuit diagram. Time span is 1 second to 99 minutes. Setting the time is by Min / Sec pushbuttons. To reset the time press Sec and Min simultaneously. Stop/Start button starts, pauses the countdown and stops the alarm.
Relay drive output is on from start to alarm, it can be used for driving a relay for external functions. LED brightness can be set in the code, value can be 0-7
LCD EGG TIMER WITH REPEAT CYCLE
Timer based on PIC16F628A LCD Module and a watch crystal. Included C code, and circuit diagram. Time span is 1 second to 99 minutes. Setting the time is by Min pushbutton which advances the minutes display by 2 per second, the Sec pushbutton advances the seconds. To reset the time press Sec and Min simultaneously.
The counting generated by the 32768Hz crystal oscillator. The CPU frequency is 4MHz from the internal oscillator. Egg Timer: CYCLE switch open. Pressing start turns on the LED and relay and starts the countdown. When the time reaches zero the buzzer sounds for 20 seconds. After the alarm the displayed time sets to the recent time. Repeat Timer: CYCLE switch closed. Pressing start turns on the LED and relay and starts the countdown. At end of count down LED and relay toggle and count down repeats.
Older version of software included. You are free to use the circuit diagram and the software with no
limitations.
LCD Module can be either 8 digits or 16X1 or 16X2
The buzzer is driven by a frequency of 2KHz, a piezo buzzer for that frequency will give optimal output.
The crystal is a watch crystal, refer to the data sheet for the recommended capacitors. Most crystals use 22pF-47pF.
The LED can be linked if not needed
Relay can be omitted if not needed.
The contrast pot can also blank out the display so set it if the display is dark or blank.
Pressing the Sec and Min together resets the time.
ARDUINO LED EGG TIMER
99 minutes 7 segments LED display, Arduino Uno or Nano egg timer. Seconds displayed, minutes are set by buttons. Also buttons for start and stop, pressing together MIN and MINx10 resets the display. Alarm at the end of count down switches on a piezo buzzer.
The code multiplexes the 4 digits at frequency of 120Hz. 7 segment LEDs are common cathode, 4 separate digits can be used with segments a to g linked. cc1 is the digit on the right. The LEDs I used are 5621AS.
4 DIGITS LED EGG TIMER
Count down timer based on PIC16F628A and a watch crystal. Included C code and circuit diagram. Time span is 100 minutes. Setting the time is by MINUTES /
SECONDS pushbuttons which advances the minutes display by 1 per second.
Holding the pushbutton counts faster. Pressing MINUTES and SECONDS
together resets the display. Pressing START / STOP starts the countdown.
Pressing START / STOP during count pauses or restarts the counting. When the time reaches zero the buzzer sounds for
10 seconds and the display flashes.
Transistors are BC337 or equivalent.
The oscillator
is a watch crystal of 32.768 KHz. The 22pF can vary with different
crystal makes.
The 4 digits display is common cathode, the 7 resistors of 220 ohms enable current of
16 mA max averages at 4 mA through each segment which is on for quarter time. The seven segments, a to g, of one digit are linked to the corresponding seven segments in the other digits.
The decimal point can be used between minutes and seconds. Alternatively
you can use different colour or smaller size digits for the seconds
display.
The buzzer, piezo buzzer is driven by a frequency of
2KHz.
2 DIGITS LED EGG TIMER
Timer based on PIC16F628A and a watch crystal. Included ASM, C code, and circuit diagram. Time span is 1 to 99 minutes. Setting the time is by +MINUTE/RESET pushbutton which advances the minutes display by 1 per second, the +MINUTE X 10 pushbutton advances the tens of minutes digit. Pressing START sounds the buzzer for 0.25 sec and starts the countdown. When the time reaches zero the buzzer sounds for 20 seconds and the display flashes 'AL'. Pressing +MINUTE/RESET pushbutton resets the timer and/or stops the buzzer.
Transistors are BC337 or equivalent.
The 2 digits display is common cathode, the 7 resistors of 390 ohms enable current of 6 mA total averages at 3 mA through each segment which is on for half the time. The seven segments, a to g, of one digit are linked to the corresponding seven segments in the other digit.
The 2 digits are multiplexed by pins 17 and 18 that drive the common cathodes.
The buzzer is driven by a frequency of 1KHz, a piezo buzzer for that frequency will give optimal output.
PCB for 2 Digits Timer by GAB GOB
Gabriel designed a PCB for this project using EAGLE PCB 5.9 .
01.09.2024 - 11:26 Name: Moty Comment: Hi Alex, I've revised the Arduino timer.
02.08.2024 - 17:54 Name: Alex Comment: Hello, Moty! I really messed up the RX0 and TX1 pins.
26.07.2024 - 21:45 Name: Comment: Hi Moty, many thanks for very prompt reply, I'll do a pcb for it. Just that I had the part's and wanted a simple one to convert a Scanner into a uV expsosure box. Thanks again, good luck, Dave
26.07.2024 - 21:36 Name: Moty Comment: Hi David,
The drawing is right, for lack of pins pin 16 is shared, the only draw back is that you can't set the time while the alarm is on.
26.07.2024 - 19:40 Name: David Comment: Hi, looking at the LED Egg timer above, can you please confirm that the Buzzer o/p on pin 16 (R07) of the Pic16F628A is correct - it shows it is used to adjust the seconds as well, thanks Dave.
16.07.2024 - 21:45 Name: Moty Comment: Hi Alex,
0 is RX and 1 is TX. Using these pins make the code easier. When you program the Arduino disconnect the 220R resistors from these two pins, they may be interfering with the serial programming.
16.07.2024 - 18:04 Name: Alex Comment: Hi, Moty! When using the Arduino LED EGG TIMER on the Arduino Nano board, there are incomprehensible symbols instead of some numbers and most likely when the LEDs of the UART line light up, since pins D0 and D1 are used. You don't have anything written about it. How can I fix this? Is it possible to use analog pins A4 and A5?
09.07.2024 - 17:41 Name: Moty Comment: digitalWrite() instruction is too slow to get 1000 Hz from a digital output.
07.07.2024 - 18:06 Name: Alex Comment: Hello, Moty!
How to make ARDUINO LED EGG TIMER output to a passive buzzer with a frequency of 1000 hertz and an interval of 1 second?
17.03.2024 - 16:48 Name: Moty Comment: In Function void mux() change every LOW to HIGH and every HIGH to LOW.
17.03.2024 - 15:02 Name: Alex Comment: Hello, Moty! If you use an Arduino timer without transistors, what changes do you need to make in the sketch?
25.09.2022 - 16:39 Name: Alex Comment: Hello Moty! Can you change the program so that there are minutes and seconds instead of hours and minutes?
27.10.2021 - 11:49 Name: Alex Comment: Hello Moty! Now everything is fine with the installation of minutes and tens of minutes! Thank you!
26.10.2021 - 17:48 Name: Moty Comment: Hi Alex,
Thanks for the note. I've corrected the errors.
26.10.2021 - 11:38 Name: Alex Comment: Hello Moty! The relay is switched on and off. Should the buzzer sound before the buttons turn off? When setting minutes and tens of minutes after the number 9, the corresponding indicator sign goes off, if you keep the installation buttons and continue, then incomprehensible symbols. Is that what it should be? If so, why not do 0 again after 9?
22.10.2021 - 13:59 Name: Moty Comment: Download the software, the folder egg_relay has the code for the relay. You can find in Technical Tips how to drive a relay from pin 13.
21.10.2021 - 19:16 Name: Alex Comment: I see.
How do I make the Start button switch on the relay and start the countdown, and when the time reaches zero, the buzzer sounds within 30 seconds?
This is done in your LCD EGG TIMER WITH REPEAT CYCLE timer. But it is necessary on LED indicators.
21.10.2021 - 15:38 Name: Moty Comment: Flashing decimal point requires major change to the flow of the program. The clock displays seconds so I can't see the need for it.
20.10.2021 - 20:31 Name: Comment: Hello Moty!
How do I make a flashing point once a second in the timer on Arduino?
19.10.2021 - 22:39 Name: Moty Comment: Hi Alex,
Connect a 220 ohm resistor between the decimal point pin and the 5V.
That works for most displays.
19.10.2021 - 19:34 Name: Alex Comment: Meaning a timer on Arduino.
19.10.2021 - 19:32 Name: Alex Comment: Hi! How do I light an indicator separation colon for hours or a decimal point in the second digit if the indicator is without a separation colon?
19.10.2021 - 01:53 Name: zanbik Comment: good
01.09.2021 - 23:06 Name: Alex Comment: Hi! Can you make an output for the Arduino timer to control the reverse load and sound the buzzer for 30 seconds?
05.02.2018 - 19:18 Name: Moty Comment: Hi Imsa, You probably need an alarm clock, there are many projects on the net, look at this one: https://github.com/srashid3/embedded-alarm-clock
05.02.2018 - 07:01 Name: Imsa Naga Comment: Dear Sir,
I trying to learn PIC and found your circuit very encouraging.
Would you be kind enough to modify your circuit such that:
1. The timer continues for at least 30 days.
2. Timer Switch ON Buzzer/Relay for 10-15 seconds and switch off and this cycle repeat for the 30 days duration.
3. Provide Re-set Switch
4. Provide Temp&Humidity Sensor with LCD Display
If the above can be shared with all your esteemed readers I am sure there would be may useful applications for the same.
Thank you very much in advance.
imsayuba@gmail.com
30.08.2016 - 08:09 Name: tarek Comment: Bien
11.04.2016 - 06:11 Name: mat Comment: this circuit works?
08.01.2016 - 00:43 Name: JESUS SANCHEZ V Comment: ME PARESEN MUY INTERESANTES TUS DISEŅOS Y PROYECTOS QUIERO PROBAR ESTE TAIMER GRACIAS.
26.12.2015 - 20:02 Name: Moty Comment: Thank you.
I don't use simulators.
26.12.2015 - 13:40 Name: Naser Comment: Hi Dear,
Nice work! Can I have the Proteus project as well please?
Keep up the good work and god bless you.
Naser
28.03.2015 - 16:57 Name: Moty Comment: Hi Sumit, this project doesn't have an output for relay.
27.03.2015 - 18:29 Name: sumit kumar Comment: sir,where add the relay in this circuit...??????
23.01.2015 - 16:30 Name: QAMAR SHAIKH
Comment: LOOKS VERY NICE PROJECT I WILL TRY IT
THANKS
REGARDS.
28.11.2014 - 04:17 Name: Jack Schmidling Comment: Everything works but the countdown. I can set the mins and 10mins but all it does is blink when I press start. The beeper blinks also but that is the end of the joy.
Any ideas what I am doing wrong?
Jack
Marengo, Illinois
27.11.2014 - 20:37 Name: Moty Comment: Hi Jack,
I've never tested the HEX file generated by MPLAB X so that could be a source of problems. Try programming the pic with the HEX file in the MPLAB or ASM folder.
If any of the LED digits goes off after pressing Start then it could be the crystal oscillator, try changing the 2 caps of 47pF to 22pF.
Check that your 5V supply doesn't dip below 4.5V when you press Start, the brown-out reset operates at 4.5V.
27.11.2014 - 04:55 Name: Jack Schmidling Comment: Everything works but the countdown. I can set the mins and 10mins but all it does is blink when I press start. The beeper blinks also but that is the end of the joy.
Any ideas what I am doing wrong?
Jack
Marengo, Illinois
21.08.2014 - 12:55 Name: Moty Comment: Hi Guptab.
Yes, you can use this project in your commercial circuit. You are free to use the circuit diagram and the software with no limitations.
I'll be happy to look at your final product when you have info for it.
20.08.2014 - 19:59 Name: guptab Comment: Can i use it in my commercial circuit
26.04.2014 - 17:56 Name: jayendra Comment: we want memory back up
24.04.2014 - 00:25 Name: manoj soorya Comment: I get this error while compile
Build C:\Documents and Settings\sethu\Desktop\egg_timer\New Folder\t for device 16F628
Using driver C:\Program Files\HI-TECH Software\PICC\std\9.60\bin\picc.exe
Executing: "C:\Program Files\HI-TECH Software\PICC\std\9.60\bin\picc.exe" -q -g --asmlist --chip=16F628 "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s" -P --char=unsigned -C "C:\Documents and Settings\sethu\Desktop\egg_timer\egg_timer.c"
Warning [176] C:\Documents and Settings\sethu\Desktop\egg_timer\egg_timer.c; 144.0 missing newline
Error [987] C:\Documents and Settings\sethu\Desktop\egg_timer\egg_timer.c; 30.16 arguments redeclared
Warning [361] C:\Documents and Settings\sethu\Desktop\egg_timer\egg_timer.c; 107.1 function declared implicit int
Warning [361] C:\Documents and Settings\sethu\Desktop\egg_timer\egg_timer.c; 119.1 function declared implicit int
Warning [337] C:\Documents and Settings\sethu\Desktop\egg_timer\egg_timer.c; 143.15 line does not have a newline on the end
********** Build failed! **************
24.04.2014 - 00:07 Name: manoj soorya Comment: Hi moty,
Can you give me the hex file for what i Want? Its a request...I cant compile with Hi-Tech compiler...I dont know why?...
23.04.2014 - 23:56 Name: manoj soorya Comment: Hi moty,
Can you give me the hex file for what i Want? Its a request...I cant compile with Hi-Tech compiler...I dont know why?...
23.04.2014 - 22:31 Name: Moty
Comment: Hi Manoj, For the C code I use the free Hi-Tech compiler that comes with the MPLAB. To use another compiler you need to migrate the code.
It is quite easy to change the code to a power off timer and I'm sure you will enjoy doing it.
23.04.2014 - 18:26 Name: Manoj Soorya Comment: Which compailore you used?
22.04.2014 - 23:37 Name: manoj soorya Comment: Power Off Timer means when press the start button, the 13th pin of 16F628 was ON. When the time reaches 00, the 13th pin OFF. Please provide me the code and schematic.
Thank you for your GREAT PROJECT.
22.04.2014 - 23:32 Name: Manoj Soorya Comment: Hi Motty...
Can you make a power off timer as same as the above timer...Its super for me.
Thank you for sharing.
21.04.2014 - 20:55 Name: edo Comment: super projekt,thank you!
21.04.2014 - 20:21 Name: edo Comment: super projekt,thank you!
14.04.2014 - 16:36 Name: jayendra Comment: We want memory in this timer
16.09.2013 - 02:21 Name: Moty Comment: Hi Ray.
I don't have a basic code for the projects. Try Google or MikroElectronica for a converter.
15.09.2013 - 01:36 Name: Ray Comment: Could you email me a copy in basic.?? I don't know asm or hex programing or do you know of a program that will convert hex or asm to basic??? I would like to change the time from 99 minutes to ten and remove all start buttons works on power up in other words a 10 minute timer Thanks for any comments Ray
11.09.2013 - 15:59 Name: spirou Comment: very nice, thank you for the sharing
I completed the installation and it works perfectly,
I will wish to make just one change on the asm program for the start button or a switch, the countdown time is running when the contact is closed (and remains closed); if the contact opens the timer is stopped
Thank you very much in advance for all
10.09.2013 - 23:04 Name: michel Comment: very nice project thank you
10.09.2013 - 23:03 Name: Comment:
11.04.2013 - 13:50 Name: Moty Comment: Hi Gabriel.
Thank you for the offer. If you wish I can add the PCB to the website with credit to your name. My egg timer is built on a stripboard, your PCB can be helpful to others.
11.04.2013 - 01:29 Name: Gabriel Comment: Hi Dear,
I'm starting with this project, as I can do to count 99 seconds? if you want I can send the eagle PCB for this project. Very good job, thank you!
03.11.2011 - 14:55 Name: John Comment: Thanks for this fine project.
If you need a PCB board for your next project, I can recomend
www.h-instruments.ecrater.com. 5 pcs 50x50mm 2 layer for 29.95$ 26.05.2010 - 23:43 Name: Comment: