manuals.online logo
Brands
  1. Home
  2. •
  3. Brands
  4. •
  5. Lucid Technologies
  6. •
  7. Alarm Clock
  8. •
  9. Lucid Technologies CK3-1 User manual

Lucid Technologies CK3-1 User manual

Popular Alarm Clock manuals by other brands

dyras ALCL-002WH instruction manual

dyras

dyras ALCL-002WH instruction manual

Livoo AR321 user manual

Livoo

Livoo AR321 user manual

Steren CLK-210 user manual

Steren

Steren CLK-210 user manual

COP-USA ALCDVR32-SL user manual

COP-USA

COP-USA ALCDVR32-SL user manual

Casio PQ-70 user manual

Casio

Casio PQ-70 user manual

iHome IA63 user manual

iHome

iHome IA63 user manual

ANJANK AC-190 Instruction manual and warranty

ANJANK

ANJANK AC-190 Instruction manual and warranty

Dexford RCT200 operating manual

Dexford

Dexford RCT200 operating manual

Philips AJL303/37B user manual

Philips

Philips AJL303/37B user manual

RST Q754 Operation manual

RST

RST Q754 Operation manual

Sharper Image 204050 instruction manual

Sharper Image

Sharper Image 204050 instruction manual

Philips HF3505/70 Quick start card

Philips

Philips HF3505/70 Quick start card

SVINZ SCC009 user manual

SVINZ

SVINZ SCC009 user manual

Clas Ohlson 918863 quick guide

Clas Ohlson

Clas Ohlson 918863 quick guide

Timex T128 user manual

Timex

Timex T128 user manual

Krown Visual VibeAlert user manual

Krown

Krown Visual VibeAlert user manual

Coopers 9765 instructions

Coopers

Coopers 9765 instructions

Gro Company groclock How to use

Gro Company

Gro Company groclock How to use

manuals.online logo
manuals.online logoBrands
  • About & Mission
  • Contact us
  • Privacy Policy
  • Terms and Conditions

Copyright 2025 Manuals.Online. All Rights Reserved.

(C) Lucid Technologies 1
USER’S MANUAL
VERSION 0.8
03 January, 2010
for
CK3-1 CLOCK & THERMOMETER BOARD
Lucid Technologies
http://www.lucidtechnologies.info/
Email: [email protected]
Copyright (C) 2009 by Lucid Technologies
All rights reserved
The information in this manual has been carefully checked and is believed to be accurate.
However, Lucid Technologies makes no warranty for the use of its products and assumes no
responsibility for any errors which may appear in this document. Lucid Technologies reserves the
right to make changes in the products contained in this manual in order to improve design or
performance and to supply the best possible product. Lucid Technologies assumes no liability
arising out of the application or use of any product or circuit described herein; neither does it
convey any license under its patent rights, nor the rights of others.
CK3 Alarm Clock and Thermometer
(C) Lucid Technologies 2
CONTENTS
1.0 Introduction
2.0 Circuit Description
3.0 Software Description
4.0 Operation
5.0 Circuit Board Construction
6.0 Installation
7.0 Customization
Appendix A CK3 Parts List
Appendix B CK3 Board Layout
Appendix C Chassis Parts List
Appendix D Chassis Details
Appendix E RS-232 Serial Interface Connector
Appendix F RS-232 Communications Setup
Appendix G MIDI Current-loop Interface Connector
Appendix H References
Appendix I Schematics
CK3 Alarm Clock and Thermometer
(C) Lucid Technologies 3
1.0 Introduction
The CK3 is a multi-function circuit board providing a real-time clock, thermometer, RS-232
serial port, and MIDI style current-loop output. The CK3 is designed to interface with a DB1
clock-display via Serial Peripheral Interface (SPI). The CK3 also uses SPI to communicate with the
real-time clock chip and input shift registers. The thermometer chip uses a 1-wire communication
interface. Through changes in software, and hardware options, it is possible to implement almost
any timing function imaginable.
2.0 Circuit Description
2.1 Power Supply
Schematic sheet 1 (Appendix I) shows the power supply circuitry. D2 isolates the 9VDC
wall transformer from the CK3. All the alarm clock circuitry runs on +5V, which is provided by
U3, a 78S40 universal switching regulator subsystem. It is the core of a high efficiency step-down
regulator capable of accepting a wide range of input voltages. The regulator is designed to deliver
+5V at up to 100 mA of current. Under normal operating conditions the alarm clock draws between
30 and 50 mA, depending on the number of active segments in the display. Ground and +5V test
points are provided on the CK3 - see Appendix B.
Bypass capacitors (0.1 uFd) are located near integrated circuits around the board.
2.2 Microcontroller and RS-232 Serial Port
The PIC16F87 microcontroller, or PIC for short, is designated as U1 on sheet 2 of the
schematics. The PIC has 4096 words of flash program memory, 368 bytes of data memory (RAM),
256 bytes of EEPROM memory, a 16-bit timer with prescaler (TMR1), an internal clock oscillator,
a universal asynchronous receiver transmitter (UART), and 16 multi-functional input/output (I/O)
lines. Lucid Technologies standard software for the CK3 sets the internal oscillator to 4 MHz. The
PIC operates at one-fourth of the oscillator frequency or 1 MHz. The 1 MHz operating frequency is
provided at the RA6 test point - see Appendix B. TMR1 overflow interrupts provide a 7.629 Hz
clock used for non-time-keeping delays.
The RS-232 serial port connector (J2) is described in detail in Appendix E. U2 is a
MAX232A, 5V-powered RS-232 interface with two drivers and two receivers. One receiver/driver
pair handles RS-232 data to/from the CK3. The other receiver/driver pair receives RTS and sends it
back to the host as CTS. RTS is also routed to the RB6 input on the PIC. Standard
communications baud rates can be selected with jumpers BDR0 and BDR1. See Appendix F for
details of serial communications setup.
2.3 Real Time Clock and Thermometer
The real time clock (RTC) circuit is shown on sheet 3 of the schematics. The DS1305 chip is
a self contained RTC running off a 32.768 watch crystal. The DS1305 implements a full calendar -
from seconds to years, has dual alarms, a Serial Peripheral Interface (SPI), and 96 bytes of user
RAM. The DS1305 has two open drain outputs, one for each alarm, that go low at alarm time and
are reset by software.
The DS1305 also has a power backup feature that may be implemented with a battery or
super-capacitor; the CK3 uses a super-capacitor (C11). The super-capacitor takes about an hour to
charge, and once charged it can keep the clock and user RAM powered for eight days. The use of
CK3 Alarm Clock and Thermometer
(C) Lucid Technologies 4
the super-capacitor power backup is a big improvement over the battery backup used on the CK2.
As batteries age they can lose capacity, resulting in short backup times, or leak, resulting in circuit
board damage. Use of a super-capacitor solves both of these problems.
The DS18S20 thermometer chip is a 3-lead TO-92 package. It communicates with the PIC
via a bidirectional “1-wire” interface. The DS18S20 is accurate from -10 to 85 degrees Celsius but
most of the other chips on the CK3 are rated for the standard commercial temperature range of 0 to
70 degrees Celsius (32 to 158 degrees Fahrenheit). The software limits the temperature readout to
the commercial range.
2.4 Alarm Circuitry and Current-loop
The alarm and current-loop circuitry are shown on sheet 4 of the schematics.
Alarm audio is produced by the piezoelectric speaker, PS1. The terminals of the speaker are
driven by U5.1 and U5.2 respectively. The Alarm_Audio signal from the PIC is inverted by U5.3 so
that the terminals of the speaker are driven in opposition. This increases the volume compared to
the CK2 where only one speaker terminal was driven against ground. If desired, speaker volume
can be reduced by increasing R12 and R13. On the CK2 board, digital noise on the supply could be
heard in a quiet room even when the alarm was off. The CK3 eliminates this with the Alarm_Gate
signal from the PIC. When Alarm_Gate is logic-0 both terminals of the speaker are driven to logic-
1, thus there is no differential voltage across the speaker to be heard as noise. Lucid Technologies
standard software for the CK3 turns on the Alarm_Gate whenever the alarm is sounding.
The current-loop connector (J3) is configured as a MIDI-OUT connection (Appendix G).
The signal routed to J3 is determined by the jumper on header J5. One, and only one, of the three
positions on J5 should have a jumper. The current-loop is also controlled by the Alarm_Gate signal
from the PIC. When Alarm_Gate is off (logic-0) no current flows, when Alarm_Gate is on (logic-1)
current will flow according to the signal selected on J5. When J5 is in the GATE position, current
flows when Alarm_Gate is on. This can be used to activate a remote alarm such as a shaker for the
blind, or a light for the deaf. When J5 is in the AUDIO position, the current flow replicates the
Alarm_Audio signal. The optically isolated audio signal can be amplified to sound a remote alarm.
When J5 is in the MIDI position, the current flow replicates the PIC UART transmit. If the PIC
baud rate is set to 31250 baud then valid MIDI messages can be sent. Lucid Technologies standard
software for the CK3 does not implement MIDI messages.
2.5 Shift Register Inputs
To implement dual alarms the CK3 needs to read seven switches. It also needs to read five
option jumpers and two alarm interrupts. To do this two 74HC165 8-bit parallel-input/serial-output
shift registers were configured as a 16-bit SPI input port. Schematic sheet 5 shows the circuit.
Parallel load of the shift registers happens when the SR_Select signal goes high. Data is clocked out
of the daisy-chained shift registers by the SPI_Clock signal. The inverted output is used because the
shift register data is inverted again by the open-drain output gate, U6.3. An open-drain output is
required because SPI_In is a wire-OR’ed signal.
3.0 Software Description
3.1 Assembler source code
CK3 Alarm Clock and Thermometer
(C) Lucid Technologies 5
The assembly language source code for the standard CK3 alarm clock is included on the
disk that came with your kit. The source code is well commented and highly modular. If you know
PIC assembly language it should be easy to understand. If you want to learn more about PIC
programming and the free Microchip Assembler (MPASM) consult some of the excellent resources
on the Microchip web site (see Appendix H for the URL).
The source code begins with several blocks of comments and equates. The comments, lines
that begin with a semicolon, are explanatory text that don’t generate any assembly code. Equates
associate understandable names with fixed numeric values. For example the decimal value 103 is
used to set the UART to 2400 baud, this value is given a more understandable name via the equate:
BD2400 equ D'103'.
The first block, PIC16F87 HARDWARE SETUP, has definitions of the PIC’s I/O pins,
memory addresses, and equates for baud rate settings. The second block, DB1 DISPLAY DATA,
defines the usage of the digits and annunciators on the DB1, and has equates for specific displays.
The third block defines the control and data registers in the DS1305 Real-Time-Clock. The fourth
block defines the PIC I/O pin for the 1-wire interface with the DS18S20 high precision
thermometer. The fifth block is equates for ASCII characters.
The next three blocks are assembler directives, variable definitions and macro definitions.
See the MPASM documentation if you are unfamiliar with any of these concepts.
3.2 Interrupts
The next part of the source code is the interrupt service routine. Only one interrupt is active
in the standard CK3 software, that is the Timer 1 (TMR1) overflow interrupt. The TMR1 prescaler
clocks the 16-bit counter at 500 kHz which produces an overflow interrupt every 131 milliseconds
(7.629 Hz). The interrupt service routine clears the interrupt flag and increments the Timer 1
overflow counter (tmr1ofc) variable.
3.3 Subroutines
The subroutines come next in the source code. The subroutines are well documented and
should be easy to follow for anyone who is familiar with PIC assembly language. The subroutines
are divided into five groups.
1) General Subroutines, such as data conversion; hex to ascii, binary to BCD, delays, etc.
2) UART Subroutines, such as setting baud rates, transmitting and receiving bytes, etc.
3) Synchronous Serial Port Subroutines exchange data with the display, real-time-clock, and
shift register inputs via the SPI.
4) One-wire Bus Subroutines communicate with the DS18S20 thermometer chip. These
routines come from Dallas Semiconductor AN2420 with very little change.
5) Alarm Clock Subroutines to set clock and alarm times, format time data for display, and
generate alarm tones.
3.4 Main Program
The power on reset initialization code begins at the MAIN label. The internal oscillator is
set to 4 MHz, the direction of the I/O ports is set, the TMR1 overflow interrupt is set to 7.629 Hz,
the DB1 display controller and RTC chip are initialized, then the TMR1 overflow interrupt is
enabled.
The label LOOP is the top of the main program loop. The program reads RB6 to see if RTS
CK3 Alarm Clock and Thermometer
(C) Lucid Technologies 6
is ON, which means a computer is connected to the RS-232 serial port (J2). If RTS is ON then
program control jumps to label HOST_COM. Host communications is discussed in the next section.
The program then reads and stores all 16 bits from the input shift registers, which includes the
TEMP bit. If TEMP bit is zero then program control goes to TEMP_MODE, otherwise it goes to
CLOCK_MODE.
In TEMP_MODE the program first calls the temperature read routine which reads the
Celsius temperature from the DS18S20, converts it to Fahrenheit, and stores both values in RAM. If
there is no response from the DS18S20 the display will show the message “Err1". This could
happen if a DS18S20 is not installed or is installed backwards. Next the program checks the CENT
(Centigrade or Celsius) bit from the previous read of the input shift registers. If CENT bit is zero
then the Celsius temperature is displayed, otherwise the Fahrenheit temperature is displayed. The
program then delays for approximately 9 seconds then jumps back to LOOP.
In CLOCK_MODE the program checks the A1ENB (Alarm1 Enabled) bit from the previous
read of the input shift registers. If Alarm1 is disabled the program clears the flags for the Alarm1
LED and the Alarm1 audio, then program control jumps to check Alarm2. If Alarm1 is enabled the
program set the flag for the Alarm1 LED and tests the Alarm1 interrupt bit from the previous read
of the input shift registers. If the Alarm1 interrupt is active the program sets the Alarm1 audio flag,
resets the Alarm1 interrupt on the DS1305, then adds 30 to the current minute count and stores the
sum in variable A1end. The program then follows the same process for Alarm2. Next the program
checks the Alarm1 set bit (A1set), from the previous read of the input shift registers, and if active
branches to the set Alarm1 subroutine. The program then checks the Alarm2 set and Time set bits.
The program then reads the current time from the DS1305 and displays. If the Alarm1 audio flag is
set and A1end time has not been reached the program calls the Alarm1 audio routine then jumps to
LOOP. If Alarm1 is inactive the program then checks Alarm2 in the same way. The alarm audio
routines produces about one second of audio before control jumps to LOOP. The time between calls
of the active alarm audio routine is about 160 microseconds so there is no audible interruption of
the sound.
3.5 Serial host communications
When the CK3 is connected via J2 to host computer running a terminal program setup as
shown in Appendix F, the clock display will blank and the following menu should appear in the
host computer’s terminal window.
Lucid Technologies - Clock3
Firmware B.03
1 Set alarm 1
2 Set alarm 2
3 Set clock
4 Display time
5 Display temperature
6 Display settings
7 Exit
?
Menu options are selected by typing the corresponding single number. In the following examples
CK3 Alarm Clock and Thermometer
(C) Lucid Technologies 7
the text sent by the CK3 is in italics, the text entered by the user is regular bold. Here is how one
would set Alarm1 to 0645 (6:45 AM). Note that numeric entries require two digits.
?1
Hour(00-23) = 06
Minutes(00-59) = 45
Remember that the DS1305 keeps a full calendar. This example sets the clock to 1730 and zero
seconds on Thursday the 22nd of January, 2009. Because the day, month and year are not needed for
simple alarm clock operations they can only be set via serial host communications.
?3
Year(00-99) = 09
Month(01-12) = 01
Day of month(01-31) = 22
Day of week(01=Monday) = 04
Hour(00-23) = 17
Minutes(00-59) = 30
Option 4 allows one to check the current time.
?4
Time = 17:30:07
Day of week(01=Monday) = 04
Day of month(01-31) = 22
Month(01-12) = 01
Year(00-99) = 09
Option 5 will display the temperature in Celsius and Fahrenheit.
?5
Temperature = 22C = 072F
Option 6 will display the alarms and the state of jumper options.
?6
Alarm1 = 06:45:00
Alarm2 = 19:05:00
Time display selected
24 hour display selected
Fahrenheit display selected
2400 baud
Option 7 is selected to terminate host communications. The normal clock display will return after
the RS-232 cable is disconnected.
4.0 Operation
CK3 Alarm Clock and Thermometer
(C) Lucid Technologies 8
Figure 4.2 Annunciator LED definitions.
4.1 Option jumpers
The CK3 has five option jumpers located at the upper right corner of the circuit board as
shown in Appendix B. When the 24HR jumper is open the CK3 defaults to 12 hour format, when it
is shorted all times are displayed in 24 hour format.
When the TEMP jumper is open the CK3 defaults to clock mode, when it is shorted the CK3
is in thermometer mode. In thermometer mode the CENT jumper determines how temperatures are
displayed. With the CENT jumper open temperature is shown on the Fahrenheit scale, with the
jumper shorted temperature is shown on the Celsius scale. The thermometer chip is rated from 0 to
70 degrees Celsius, 32 to 158 degrees Fahrenheit, so the temperature display has to handle both 2
and 3 digit temperature displays, this is shown in Figure 3.1.
Figure 4.1 Display formats for Celsius, two digit, and three digit Fahrenheit.
The BRD0 and BRD1 jumpers set the baud rate, see Appendix F for details.
4.2 Setting times
There are three times that can be set - time of day, Alarm1 time, and Alarm2 time.
Assuming normally-open pushbuttons are used for the set switches, to set any of the times press and
hold the set pushbutton for that time. While the set pushbutton is held, press either the minute set or
hour set pushbutton. Hold the second pushbutton down until the minutes or hours increment to the
correct value. If you miss the correct value just keep the button depressed and the minutes or hours
will wrap around. When setting times the minutes and hours are independent so the hour will not
increment when the minutes go from 59 to 00.
During normal operation the colon, between the hours and minutes digits, blinks every other
second. When any time set switch is active the colon will be on continuously.
4.3 Display annunciators
There are four discrete annunciator
LEDs on the display board; their function is
shown here in Figure 4.2. The LEDs to the
right of the time display are the AM and PM
indicators; AM is the upper indicator and PM
is the lower. The AM and PM indicators are
not used for the 24 hour display format. The
alarm indicators are on continuously whenever
their respective alarm is enabled. The alarm indicators blink whenever their respective alarm is
being set.
CK3 Alarm Clock and Thermometer
(C) Lucid Technologies 9
4.3 Power backup
The DS1305 RTC has a super-capacitor power backup (C11). The super-capacitor takes
about an hour to charge, and once charged it can keep the clock and user RAM powered for eight
days. This is more than enough to keep the time accurate through typical power interruptions. The
DS1305 is the only chip with backup power, but it is the chip that keeps the time and the alarms,
not the microcontroller. Alarms that trigger during a power outage will not sound until the power
returns.
4.4 Alarms
Each alarm has a distinctive sound so you can tell which alarm is sounding just by hearing
them. Alarm1 alternates between two tones: high, low, high, low, etc. Alarm2 is a rapidly
descending series of eight tones that repeats every second.
When a alarm occurs the tone will sound for 30 minutes or until the enable switch is toggled
off. If the sounding of the alarms overlaps Alarm1 will take precedence.
5.0 Circuit Board Construction
5.1 Preparation
You will need the following tools:
> A low wattage soldering pencil, approximately 10 to 20 Watts.
> Flux core solder wire, organic flux core preferred.
> Lead benders.
> Lead/wire clippers.
Before beginning assemble, carefully check the CK3 circuit board for shorted or incomplete
traces and confirm all parts against the list in Appendix A.
5.2 Assembly checklist
Check the value/type of each part as you assemble the board. Clip excess lead length from
each component after it's soldered. See Appendix B for parts placement.
Insert and solder the low-profile sockets for:
____ U1 18-pin DIP.
____ U2 16-pin DIP.
____ U3 16-pin DIP.
____ U4 16-pin DIP.
____ U5 14-pin DIP.
____ U6 14-pin DIP.
____ U7 16-pin DIP.
____ U8 16-pin DIP.
Insert and solder the following components.
____ R1 1.0 ohm, 0.25W, 5% (brown-black-gold-gold)
CK3 Alarm Clock and Thermometer
(C) Lucid Technologies 10
____ R2 30K, 0.25W, 5% (orange-black-orange-gold)
____ R3 10K, 0.25W, 5% (brown-black-orange-gold)
____ R4 10K, 0.25W, 5% (brown-black-orange-gold)
____ R5 100 ohm, 0.25W, 5% (brown-black-brown-gold)
____ R6 1.1K, 0.25W, 5% (brown-brown-red-gold)
____ R7 1.1K, 0.25W, 5% (brown-brown-red-gold)
____ R8 1.1K, 0.25W, 5% (brown-brown-red-gold)
____ R9 4.7K, 0.25W, 5% (yellow-violet-red-gold)
____ R10 10K, 0.25W, 5% (brown-black-orange-gold)
____ R11 10K, 0.25W, 5% (brown-black-orange-gold)
____ R12 220 ohm, 0.25W, 5% (red-red-brown-gold)
____ R13 220 ohm, 0.25W, 5% (red-red-brown-gold)
____ R14 220 ohm, 0.25W, 5% (red-red-brown-gold)
____ R15 220 ohm, 0.25W, 5% (red-red-brown-gold)
____ RN1 10k, 10-pin SIP, pin 1 goes in the square pad.
____ RN2 10k, 10-pin SIP, pin 1 goes in the square pad.
____ D1 1N5818, banded end toward square pad.
____ D2 1N5818, banded end toward square pad.
____ C1 560 pFd, radial
____ C2 0.1 uFd, radial
____ C3 0.1 uFd, radial
____ C4 0.1 uFd, radial
____ C5 47 uFd, positive lead toward square pad.
____ C6 100 uFd, positive lead toward square pad.
____ C7 100 uFd, positive lead toward square pad.
____ C8 0.1 uFd, radial
____ C9 0.1 uFd, radial
____ C10 0.1 uFd, radial
____ C11 0.33F, 5.5V, radial
____ C12 1.0uF, radial
____ C13 1.0uF, radial
____ C14 1.0uF, radial
____ C15 1.0uF, radial
____ C16 0.1 uFd, radial
____ C17 0.1 uFd, radial
____ Y1 bend leads to center crystal between hold-down pad.
____ Secure Y1 with a clipped lead wire over the crystal can.
____ L1 150uH inductor
____ P1 piezoelectric speaker
____ U9 DS18S20 in TO-92 package
____ J1 DC power jack
____ J2 DB9 female
____ J3 DIN-5 receptacle
____ J5 3x2 jumper header