For the initial prompt, Gemini 2.5 Deep Research was used.
Research ways to create a circuit that measures 1hz as accurately as possible. it should pulse every 1 second as accurately as possible. Provide a bill of materials, detailed pin connections, and accuracy calculations for a variety of circuits. Create UML/mermaid charts for the signal path/conditioning. Prioritize accuracy, then component count. Keep the cost around $30. Only use discrete components or TCXOs, no microcontrollers/FPGA or similar. A target for accuracy is ~500ppb.
After a few minutes, it presented a very long and detailed research paper. Skimming through the notes and thinking it left, it had a hard time working within the constraints given. Initially, it wanted to use a 32k crystal, but found it to be too inaccurate. It was able to search sites like Digikey and Mouser for potential components and none were found that would work at ~500ppb. It then switched to a TCXO method.
This way seemed to be a lot more workable. It quickly figured out that the chosen crystal frequency is a power of 2, and it can be easily divided down with binary math and discrete components.
To achieve a precise 1 Hz output through binary division, the TCXO's frequency should ideally be a power of 2. For example:
- 4.194304 MHz (2^22 Hz): This frequency divides perfectly to 1 Hz after 22 stages of binary division.
- 16.777216 MHz (2^24 Hz): This frequency requires 24 stages of binary division to reach 1 Hz.
High-speed CMOS (HC/HCT series) binary counters, such as the 74HC4060 (14-stage) or 74HC4020 (14-stage), are suitable for dividing these MHz frequencies due to their higher maximum clock frequencies compared to the older CD4000 series. Multiple counters can be cascaded to achieve the required total division ratio. For instance, to divide 2^24 Hz down to 1 Hz:
- A 74HC4060 (14-stage) can divide the 2^24 Hz input by 2^14, resulting in 2^10 Hz (1024 Hz).
- A second 74HC4020 (14-stage) can then divide the 1024 Hz input by 2^10 (using its Q10 output), yielding the final 1 Hz signal.
This approach seemed quite reasonable. After considerable part-searching, a 4.193404 MHz crystal, in stock, at a reasonable price was found. It wasn't nearly as accurate as Gemini had hoped for, ±25ppm, but that was the only available part. Other power-of-2 frequencies were just as difficult to locate (either due to availability or cost), so ±25ppm it is.
During this process, there was some back-and-forth. It was brought up that this whole thing could easily be done with a microcontroller or FPGA. Also that 1 hz oscillators do exist and could be used here.
The result
Eventually, this is what was decided on and planned.
1Hz Pulse Generator - Complete Wiring Diagram
4.194304 MHz→÷16,384→256 Hz→÷256→1 Hz
TCXO
4.194304 MHz ±25ppm
| Pin | Function | Connection |
|---|---|---|
| 1 | Enable | +3V |
| 2 | GND | GND |
| 3 | Output | → 74HC4060 Pin 10 |
| 4 | VDD | +3V |
74HC4060 (DIP-16)
14-Stage Binary Counter
| Pin | Function | Connection |
|---|---|---|
| 1 | Q12 | N/C |
| 2 | Q13 | N/C |
| 3 | Q14 | → 74HC4040 Pin 10 |
| 4 | Q6 | N/C |
| 5 | Q5 | N/C |
| 6 | Q7 | N/C |
| 7 | Q4 | N/C |
| 8 | VSS | GND |
| 9 | OSC OUT | N/C |
| 10 | OSC IN | ← TCXO Pin 3 |
| 11 | RESET | GND (via 10kΩ) |
| 12 | RESET | → Pin 11 |
| 13 | Q1 | N/C |
| 14 | Q2 | N/C |
| 15 | Q3 | N/C |
| 16 | VDD | +5V |
74HC4040 (DIP-16)
12-Stage Binary Counter
| Pin | Function | Connection |
|---|---|---|
| 1 | Q8 | → 74HC244 Pin 3 |
| 2 | Q6 | N/C |
| 3 | Q5 | N/C |
| 4 | Q7 | N/C |
| 5 | Q4 | N/C |
| 6 | Q3 | N/C |
| 7 | Q2 | N/C |
| 8 | VSS | GND |
| 9 | Q1 | N/C |
| 10 | CLOCK | ← 74HC4060 Pin 3 |
| 11 | RESET | GND |
| 12 | Q9 | N/C |
| 13 | Q11 | N/C |
| 14 | Q10 | N/C |
| 15 | Q12 | N/C |
| 16 | VDD | +5V |
74HC244 (DIP-20)
Octal Buffer/Driver
| Pin | Function | Connection |
|---|---|---|
| 1 | 1OE | GND |
| 2 | 1A1 | GND |
| 3 | 1A2 | ← 74HC4040 Pin 1 |
| 4 | 1A3 | GND |
| 5 | 1A4 | GND |
| 6 | 1Y4 | N/C |
| 7 | 1Y3 | N/C |
| 8 | 1Y2 | 1Hz OUTPUT |
| 9 | 1Y1 | N/C |
| 10 | VSS | GND |
| 11 | 2Y1 | N/C |
| 12 | 2Y2 | N/C |
| 13 | 2Y3 | N/C |
| 14 | 2Y4 | N/C |
| 15 | 2A4 | GND |
| 16 | 2A3 | GND |
| 17 | 2A2 | GND |
| 18 | 2A1 | GND |
| 19 | 2OE | +5V |
| 20 | VDD | +5V |
Power Supply Connections
| Rail | Components | Current |
|---|---|---|
| +3V | TCXO (Pins 1, 4) | ~2mA |
| +5V | 74HC4060 (Pin 16) 74HC4040 (Pin 16) 74HC244 (Pin 20) 74HC244 (Pin 19) | ~3mA |
| GND | All VSS pins All unused inputs Reset pins | Return |
Recommended Test Points
- TP1: TCXO Output (Pin 3) - 4.194304 MHz
- TP2: 74HC4060 Q14 (Pin 3) - 256 Hz
- TP3: 74HC4040 Q8 (Pin 1) - 1 Hz unbuffered
- TP4: 74HC244 Output (Pin 8) - 1 Hz buffered
- TP5: +5V Power Rail
- TP6: +3V Power Rail
- TP7: Ground Reference
Critical Wiring Notes
- Dual Power Supply: Requires both 3V and 5V rails
- Decoupling: Place 0.1µF ceramic capacitor near each IC's VDD pin
- Reset Strategy: 74HC4060 reset pins tied together through 10kΩ resistor to GND
- Unused Inputs: All unused 74HC244 inputs tied to GND to prevent floating
- TCXO Enable: Pin 1 must be connected to +3V for continuous operation
- Signal Integrity: Keep clock traces short and direct
- Ground Plane: Use solid ground plane for digital circuits
Component Specifications
- TCXO: SIT8008BI-82-30E-4.194304 (±25ppm, 3V, SMD)
- Counters: 74HC4060N, 74HC4040N (DIP packages)
- Buffer: 74HC244N (DIP-20 package)
- Capacitors: 0.1µF ceramic (×4), 10µF electrolytic (×2)
- Resistor: 10kΩ (reset pull-down)
typecad
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.