I'm a beginner in electronics, so I just have an idea in my head and don't know how to actually make it. I want to make a countdown circuit, for an event in next 5 month. The display format is like this:


Days have 3 digits, hours, minutes and seconds have 2 digits and I want to show the numbers on 7-segment displays. I just want to show remained time to a specific time, some day in October. I want to make it with a PIC or anything that you suggest.
I googled it, but just found a MM:SS countdown circuit. I can't expand it for solving my question. How can I do that?

  • \$\begingroup\$ Do you want it on 7 segment displays, an LCD, ...? Anyway, it would look pretty similar to a HH:MM circuit - could you show us what you found for that? \$\endgroup\$ – user17592 May 18 '13 at 15:52
  • 1
    \$\begingroup\$ +1 to counter the fly-by downvote. The question could do with some improvement, sure, but helping the OP understand what those improvements could be, is way more useful than a silent down-vote. \$\endgroup\$ – Anindo Ghosh May 18 '13 at 16:19
  • 2
    \$\begingroup\$ To Netmoon: What exactly do you mean by "make it with ... TTL"? The PIC is a microcontroller, whereas TTL i.e. Transistor-Transistor-Logic, is a set of logic signaling standards used by various electronic components, including some microcontrollers. On the question itself, please edit the question to describe, with relevant links, your findings so far, to enable other members to understand how far you are along the path to your goal, and what level of answer would help you best. \$\endgroup\$ – Anindo Ghosh May 18 '13 at 16:23
  • \$\begingroup\$ @anindo & camil : edited... i hope i can explain right about my question. \$\endgroup\$ – Netmoon May 18 '13 at 17:20
  • \$\begingroup\$ I would do it using a microcontroller with a RTC chip (or the built-in RTC on your microcontroller, like some microcontrollers have). Read from the RTC every second and then calculate the difference between your target date/time and the current date/time. There probably are better ways of doing that. \$\endgroup\$ – Renan May 18 '13 at 17:27

In order to expand the display to displaying DDD MM HH, you need five more I/O lines for the DDD and SS. The PIC16F84A microntroller shown in the linked circuit has only 13 I/O lines and there are all used. (If you don't need the buzzer and relay outputs then potentially you have two spare outputs, but as I mentioned above, you need five.)

So If you want to stay with the PIC16F series of microcontrollers in your linked circuit, I would expand it to meet your needs using a PIC16F883 which has 24 I/O pins. (They make PIC16F microcontrollers with 18 and 20 I/O pins, but only in SMD packages, and I assume you want through-hole). Just add five more outputs going to additional transistors like T1-T4 driving the five new seven segment displays, and the a-g inputs of the displays to the parallel bus coming out of resistor pack R5-R11.

For a crystal, you need to choose one that has a tight tolerance as possible to keep the drift to a minimum. Timer1 of the PIC16F883 can run off of a 32KHz 30 ppm watch crystal.

Software wise, set up Timer1 to interrupt once a second. Use the Set and Select buttons as in the previous application to set up the initial DDD:HH:MM:SS values. On each interrupt, update the display -- decrement seconds, when they roll over from 00 to 59, decrement minutes etc.

  • \$\begingroup\$ as i explained above i'm beginner, but when read your answer i understood that i should start reading about PICs, right? i just have 20 days to create this circuit, i want to present it to my friend and just make her happy. but i think 20 days is too small for reading and understanding PICs. can you lead me to best reference or book or website that help me to create this circuit as soon as possible? \$\endgroup\$ – Netmoon May 18 '13 at 19:57
  • 1
    \$\begingroup\$ This may be too ambitious to accomplish in 20 days, unless you can devote a lot of time each day to it. The earlier projects were both written in PIC16 assembly language, not C, so you would need to learn that first -- or you could write the program from scratch in C if you know that language. You will need to get the datasheet for the PICF883 and download a development system from Microchip. (continued)... \$\endgroup\$ – tcrosley May 18 '13 at 23:09
  • \$\begingroup\$ You will need to get a book that covers either assembly such as The PIC Microcontroller: Your Personal Introductory Course, Third Edition or C -- PIC Microcontrollers - Programming in C. Finally you will need to get a programmer such as the PICKit 3 to program the PIC. \$\endgroup\$ – tcrosley May 18 '13 at 23:11
  • \$\begingroup\$ thanks a lot. it's complete answer that i search it :) . i know but i try hard to understand and accomplish this mission in 20 days ;) . i vote this answer, and start reading this books, and some days check this page for any other suggestions. thanks :) \$\endgroup\$ – Netmoon May 20 '13 at 7:08

I highly recommend you to use a LCD instead of bunch of 7-segments. You can configure the digits easily. PCB will be much easier to build. Much more less soldering and easier to control in software.

LCD can be used with direct wiring of 8 pins. I recommend you 2x16 LCD with a HD44780 chip in it. You can find in net for HD44780 examples a lot.

As for timer, i recommend a RTC (real time clock). Exp. DS1302. These chips are for real time clocking. So you don't have to use any PIC's timer interrupts and a counter for this job.

  • \$\begingroup\$ if you look at the circuit the OP linked to, you will see that the 7 wires going to the segments a-g are connected in parallel to all the of the displays, and the segments multiplexed. \$\endgroup\$ – tcrosley May 19 '13 at 1:12
  • \$\begingroup\$ Perfect link. Thank you. Didn't know this 4543 chip. But i think segments are not multiplexed. I think T1-T4 transistors are for deciding working segment. \$\endgroup\$ – Hammers May 19 '13 at 1:24

The fastest way to do this is with an Arduino based board. Get a board, a clock module like this one https://www.sparkfun.com/products/99 and connect them together. You will probably need a Mega to have enough IO pins to driver the displays. Ask any coding questions on StackOverflow (the programming Q&A) site.

Or - here is a project with an Arduino type board called the "Teensy" to build a display like the time machine Delorean in "Back To The Future". http://learn.adafruit.com/delorean-time-circuit/background He has a parts list and sample code that could be adapted.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.