Binary (BCD) clock with PIC series microcontroller




A. PREFACE

        Since I made a few kind of clocks design, I may very fond of to search many kind of clocks circuit on the net. Many unusual clock usually very interesting for me. This time my searching bump to a binary clock. Not a true binary in fact, because binary number hard to interpreted than binary coded decimal (BCD) number. A few kind of designs out there, but at last I found one that meet to my purpose, Binary Clock from Elektor Electronics magazine, jul-aug/2006 edition. You can find it at the download section (020390-1 for the article and 020390-11 for the firmware source code). The original version use PIC16C54 type of microcontroller. The pins compatible with PIC16F84/A type. Another kind is Dave's simple binary clock hard disk. He utilize a junk hard disk case and blue leds display. A cool color. My project inspired by the two of these designs. So the project begin. More enjoyable and more fun! I plan to place it at my living room. Cool clock design!


B. SCHEMATIC

        Here I drawn the clock circuit again but with some modification to meet my purpose. As many of my clock design before, the clock must need a back-up battery to retain the time. Original version get the clock from main line 50 Hz frequency. We know that this may not to be very accurate while the processor run from a crystal in fact. So the modification also take the advantage of this option using optimization of the firmware itself. So the input that needs for the clock can be use for sensing the power failure option. PIC 16F84/A and PIC 16F628 type both are pins compatible with PIC16C54 type. So it does not the matter to the I/O section. Just use like that at all. 

        So the schematic are like this (BCD_ClkS.sch, BCD_Clock_Sch.pdf).

C. LAYOUT

        Original version already included with PCB design. It was very compact. So for you who want to build it with the same version like the author can use that design. I prefer to make my own design, because I plan to use big LEDs with blue color. May be 12 mm if it could be found on the market. Very very cool. The PCB separate in 2 pieces, one for the controller and another for LEDs display. Here is the prototype looks like :







Here is the PCB layout (BCD_ClkP.pcb, BCD_Clock_Layout.pdf, BCD_Clock_Artwork.pdf).

D. PART LIST

        Here are the part list for this BCD clock :

   1. Resistors :
      R1 ~ R6 = 2k2, 1/4W, 5% .................................... 6 pcs
      R7 ~ R11, R16 = 220 Ohm, 1/4W, 5% .......................... 6 pcs
      R12 ~ R14 = 10k, 1/4W, 5% .................................. 3 pcs
      R17 = 4k7, 1/4W, 5% ........................................ 1 pcs
   2. Capasitors :
      C1 ~ C2 = 22 pF (for oscillator) ........................... 2 pcs
      C3 = 100 nF (for IC decoupling, used as necessary).......... 1 pcs
      C4 = 33uF/16V .............................................. 1 pcs
      C5 = 100uF/16V ............................................. 1 pcs
   3. Semiconductors :
      IC1 = PIC16F84/A (PIC microcontroller) ..................... 1 pcs
      IC1 alt = PIC16F628 (PIC microcontroller) .................. 1 pcs
      IC2 = 7805 (Voltage regulator) ............................. 1 pcs
      Q1 ~ Q6 = BC548B (NPN transistor) .......................... 6 pcs
      D2, D3 = 1N914 (Silicon diode) ............................. 2 pcs
      D1, BD = 1N4007 (Silicon diode) ............................ 5 pcs
      DZ = 4V7 (Zener diode) ..................................... 1 pcs
      LED1 ~ LED20 = 12mm, Blu (For indicator) .................. 20 pcs
      LED21 = 3mm, Red (For indicator) ........................... 1 pcs
   4. Others :
      X1 = 4 MHz (Clock Crystal oscillator) ...................... 1 pcs
      Optional IC socket for 18-pins (use 20-pins) ............... 1 pcs
      Optional terminal connector CON1 ~ CON2 = 2 pin (power) .... 2 pcs
      S1 ~ S2 = Miniature push button (Push on) .................. 2 pcs
      TR1 = Miniature transformer, P-220V/S-12V, 100 mA .......... 1 pcs

E. FIRMWARE

        Because the original firmware programmed for PIC16C54 type, some changes must be made to accommodate the newer type. But still doesn't mean at all, just only a protocol to support new type. This old firmware can be run also by my own modification. New firmware support for back-up battery option and more accurate time keeping. You can choose which one you want to use. Time keeping algorithm is the same as with the design for Digital clock version. Note that, bin_clk is the modified old version and bcd_clk is the new version for PIC16F84/A type. For another PIC16F628 type, please change the proper lines.



Here is the firmware : BCD Clock (Bin_Clk.asm, Bin_Clk.hex, BCD_Clk.asm, BCD_Clk.hex).

F. PROTOTYPE

        For my prototype, I combine the controller board and display board to be one all, besides that I put some circuit to flash indicators for directions at night or when the moment unit or ten count become zero. These all a little hard to see in the dark. These leds will blink for 1 Hz rate, to show the seconds blink indicator also. The 1 Hz clock derivate from a piece of ex broken quartz clock. The idea come from Pino's one second time base. A good explanation. I use small transformers from ex panel indicator lamp. The rating about 220V to 6V, 100mA each. By connecting it serial, I get 12V, 100mA power. I hope that it could drive the leds, because the leds drive with multiplexing also.













G. IMPLEMENTATION

        Here is the implementation of my prototype. The prototype assembled with an acrylic box (made from CD jewel box) to prevent it from dirty. I put it at my living room. So I can see it time to time with pleasure. It looks elegant with the big blue leds, isn't it? Make your own BCD clock!











H. HOW TO READ

        Someone always ask, how to read the clock?

Here how to read the clock. Red leds at the top line and left column are for the direction only, it will be blink for about 1 sec continuously, for the night vision. 2 columns each from the left side represent hours, minutes, and seconds respectively. the first column represent the ten unit and the second column represent the unit. For hours number just need count from 1 to 23, for minutes and seconds count from 1 to 59. Numbers are represented by the binary count. The first blue leds line from top represent 20 = 1 and the next lines represent 21 = 2, 22 = 4, and 23 = 8 respectively  to bottom lines. The clock reads from left to right columns and from top to bottom lines for each position. eg: clock at the right above picture represent that the time is : 21:58:18.

1 comment:

  1. Hi there,
    Nicely made project! I am yet to assemble it but will do it soon. Just one thing, line 333 had an error, it was written Hours_ten instead of Hours_Ten. just letting you know! thanks again for a well written project.

    ReplyDelete

Labels

PROJECTS 8086 PIN CONFIGURATION 80X86 PROCESSORS TRANSDUCERS 8086 – ARCHITECTURE Hall-Effect Transducers INTEL 8085 OPTICAL MATERIALS BIPOLAR TRANSISTORS INTEL 8255 Optoelectronic Devices Thermistors thevenin's theorem MAXIMUM MODE CONFIGURATION OF 8086 SYSTEM ASSEMBLY LANGUAGE PROGRAMME OF 80X86 PROCESSORS POWER PLANT ENGINEERING PRIME MOVERS 8279 with 8085 MINIMUM MODE CONFIGURATION OF 8086 SYSTEM MISCELLANEOUS DEVICES MODERN ENGINEERING MATERIALS 8085 Processor- Q and A-1 BASIC CONCEPTS OF FLUID MECHANICS OSCILLATORS 8085 Processor- Q and A-2 Features of 8086 PUMPS AND TURBINES 8031/8051 MICROCONTROLLER Chemfet Transducers DIODES FIRST LAW OF THERMODYNAMICS METHOD OF STATEMENTS 8279 with 8086 HIGH VOLTAGE ENGINEERING OVERVOLATGES AND INSULATION COORDINATION Thermocouples 8251A to 8086 ARCHITECTURE OF 8031/8051 Angle-Beam Transducers DATA TRANSFER INSTRUCTIONS IN 8051/8031 INSTRUCTION SET FOR 8051/8031 INTEL 8279 KEYBOARD AND DISPLAY INTERFACES USING 8279 LOGICAL INSTRUCTIONS FOR 8051/8031 Photonic Transducers TECHNOLOGICAL TIPS THREE POINT STARTER 8257 with 8085 ARITHMETIC INSTRUCTIONS IN 8051/8031 LIGHTNING PHENOMENA Photoelectric Detectors Physical Strain Gage Transducers 8259 PROCESSOR APPLICATIONS OF HALL EFFECT BRANCHING INSTRUCTIONS FOR 8051/8031 CPU OF 8031/8051 Capacitive Transducers DECODER Electromagnetic Transducer Hall voltage INTEL 8051 MICROCONTROLLER INTEL 8251A Insulation Resistance Test PINS AND SIGNALS OF 8031/8051 Physical Transducers Resistive Transducer STARTERS Thermocouple Vacuum Gages USART-INTEL 8251A APPLICATIONs OF 8085 MICROPROCESSOR CAPACITANCE Data Transfer Instructions In 8086 Processors EARTH FAULT RELAY ELECTRIC MOTORS ELECTRICAL AND ELECTRONIC INSTRUMENTS ELECTRICAL BREAKDOWN IN GASES FIELD EFFECT TRANSISTOR (FET) INTEL 8257 IONIZATION AND DECAY PROCESSES Inductive Transducers Microprocessor and Microcontroller OVER CURRENT RELAY OVER CURRENT RELAY TESTING METHODS PhotoConductive Detectors PhotoVoltaic Detectors Registers Of 8051/8031 Microcontroller Testing Methods ADC INTERFACE AMPLIFIERS APPLICATIONS OF 8259 EARTH ELECTRODE RESISTANCE MEASUREMENT TESTING METHODS EARTH FAULT RELAY TESTING METHODS Electricity Ferrodynamic Wattmeter Fiber-Optic Transducers IC TESTER IC TESTER part-2 INTERRUPTS Intravascular imaging transducer LIGHTNING ARRESTERS MEASUREMENT SYSTEM Mechanical imaging transducers Mesh Current-2 Millman's Theorem NEGATIVE FEEDBACK Norton's Polarity Test Potentiometric transducers Ratio Test SERIAL DATA COMMUNICATION SFR OF 8051/8031 SOLIDS AND LIQUIDS Speed Control System 8085 Stepper Motor Control System Winding Resistance Test 20 MVA 6-digits 6-digits 7-segment LEDs 7-segment A-to-D A/D ADC ADVANTAGES OF CORONA ALTERNATOR BY POTIER & ASA METHOD ANALOG TO DIGITAL CONVERTER AUXILIARY TRANSFORMER AUXILIARY TRANSFORMER TESTING AUXILIARY TRANSFORMER TESTING METHODS Analog Devices A–D BERNOULLI’S PRINCIPLE BUS BAR BUS BAR TESTING Basic measuring circuits Bernoulli's Equation Bit Manipulation Instruction Buchholz relay test CORONA POWER LOSS CURRENT TRANSFORMER CURRENT TRANSFORMER TESTING Contact resistance test Current to voltage converter DAC INTERFACE DESCRIBE MULTIPLY-EXCITED Digital Storage Oscilloscope Display Driver Circuit E PROMER ELPLUS NT-111 EPROM AND STATIC RAM EXCITED MAGNETIC FIELD Electrical Machines II- Exp NO.1 Energy Meters FACTORS AFFECTING CORONA FLIP FLOPS Fluid Dynamics and Bernoulli's Equation Fluorescence Chemical Transducers Foil Strain Gages HALL EFFECT HIGH VOLTAGE ENGG HV test HYSTERESIS MOTOR Hall co-efficient Hall voltage and Hall Co-efficient High Voltage Insulator Coating Hot-wire anemometer How to Read a Capacitor? IC TESTER part-1 INSTRUMENT TRANSFORMERS Importance of Hall Effect Insulation resistance check Insulator Coating Knee point Test LEDs LEDs Display Driver LEDs Display Driver Circuit LM35 LOGIC CONTROLLER LPT LPT PORT LPT PORT EXPANDER LPT PORT LPT PORT EXTENDER Life Gone? MAGNETIC FIELD MAGNETIC FIELD SYSTEMS METHOD OF STATEMENT FOR TRANSFORMER STABILITY TEST METHODS OF REDUCING CORONA EFFECT MULTIPLY-EXCITED MULTIPLY-EXCITED MAGNETIC FIELD SYSTEMS Mesh Current Mesh Current-1 Moving Iron Instruments Multiplexing Network Theorems Node Voltage Method On-No Load And On Load Condition PLC PORT EXTENDER POTIER & ASA METHOD POWER TRANSFORMER POWER TRANSFORMER TESTING POWER TRANSFORMER TESTING METHODS PROGRAMMABLE LOGIC PROGRAMMABLE LOGIC CONTROLLER Parallel Port EXPANDER Paschen's law Piezoelectric Wave-Propagation Transducers Potential Transformer RADIO INTERFERENCE RECTIFIERS REGULATION OF ALTERNATOR REGULATION OF THREE PHASE ALTERNATOR Read a Capacitor SINGLY-EXCITED SOLIDS AND LIQUIDS Classical gas laws Secondary effects Semiconductor strain gages Speaker Driver Strain Gages Streamer theory Superposition Superposition theorem Swinburne’s Test TMOD TRANSFORMER TESTING METHODS Tape Recorder Three-Phase Wattmeter Transformer Tap Changer Transformer Testing Vector group test Virus Activity Voltage Insulator Coating Voltage To Frequency Converter Voltage to current converter What is analog-to-digital conversion Windows work for Nokia capacitor labels excitation current test magnetic balance voltage to frequency converter wiki electronic frequency converter testing voltage with a multimeter 50 hz voltages voltmeter

Search More Posts

Followers