Skip to the content
PCBKitNew board
2 layers100 × 100 mmPcb schematics, the printed circuit board in 3D

Pcb schematics

AniMB/Clock-radio

The code forclock-radio for ECE 299

Size
100 × 100 mm
Copper layers
2
Thickness
1.6 mm
Parts
73
Nets
65
Pads
199
Tracks, vias
332, 13
Pours
3
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
20 May 2025
Updated
6 Aug 2025

Overview

Pcb schematics is an open-source printed circuit board by AniMB, from the AniMB/Clock-radio repository on GitHub, published under the LGPL-2.1 licence. It is a 2-layer board of 100 × 100 mm with 73 parts on 65 nets, routed with 332 tracks and 13 vias.

It is built around the LM386. Its parts include 16 capacitors, 8 resistors, 5 connectors, 4 ICs and 1 switch. It belongs with the RP2040 boards of this library.

Main components

1

README

README.md

⏰ Clock Radio – MicroPython Smart Clock System

mi69.py is the main script of an embedded, Wi-Fi-enabled FM radio and smart clock interface built on MicroPython. It combines a real-time clock, OLED UI, FM tuner, and web connectivity into a single-threaded yet responsive application, suitable for microcontrollers like the Raspberry Pi Pico W.


🚦 Architecture Overview

text
             ┌────────────┐
             │   Button   │◄────────────┐
             └────┬───────┘             │
                  ▼                     │
             ┌─────────────┐     Debounce, Hold Detection
             │    Main     │─────────────┘
             │   (mi69.py) │
             └────┬────────┘
        ┌─────────┴─────────┐
        ▼                   ▼
┌────────────┐       ┌────────────┐
│  Display   │       │   Radio    │
│ (OLED + UI)│       │  (FM chip) │
└────┬───────┘       └────┬───────┘
     ▼                    ▼
 ┌──────────┐      ┌────────────┐
 │ Web Time │      │ Web Server │◄──── Access via browser
 └──────────┘      └────────────┘

🧠 Code Modules

mi69.py – Main Control Loop

  • Initializes components (RTC, FM radio, OLED, Button, Web).
  • Sets up interrupt-safe button handling (short vs. long press).
  • Periodically updates:
    • Display (clock, station, volume)
    • State file (web_data.json)
  • Starts the HTTP server in a separate thread.
Core Mechanics
  • oled_dirty, json_dirty flags minimize redundant writes
  • utime.ticks_ms() is used to throttle updates
  • JSON I/O and OLED are locked via a thread-safe _lock
  • Long press (>3 sec) and debounce logic built-in

libraries/display.py – OLED Drawing

Encapsulates all drawing on the OLED display using framebuf:

  • display_clock_time(rtc.datetime())
  • display_radio_freq(101.9)
  • display_volume(5)

Also handles font scaling, screen clearing, and line placement.


libraries/radio.py – FM Radio Control

Controls an FM tuner (likely via I2C/SPI). Key methods:

  • set_freq(freq): set frequency (MHz)
  • seek_up() / seek_down(): scan for stations
  • set_volume(level): 0–15 volume levels

Keeps state internally for restoring or syncing with UI/web.


config/resources.py – Global Shared State

Contains:

  • Button pin definitions
  • Flags: oled_dirty, json_dirty, btn_short_req, etc.
  • Constants: debounce delay, hold time threshold
  • A global _lock used by both threads

This is the “RAM” for the system shared across all modules.


web_connectivity/web.py – HTTP Server

A simple HTTP server that runs on a new thread:

  • Serves a web interface (to be extended)
  • API routes:
    • GET /status: Return JSON state
    • POST /set_time, POST /set_volume, etc.
  • Reads/writes web_data.json using the shared _lock

This lets users control and monitor the device remotely.


web_data.json – State File

JSON-encoded structure for UI and web server to share state.

json
{
  "volume": 5,
  "frequency": 101.9,
  "time": "12:34:56",
  "alarm_enabled": false
}

Used for persistence and as a synchronization bridge.


🧵 Concurrency & Thread Safety

  • Uses MicroPython’s _thread module for background web server
  • Ensures safety via _lock for:
    • JSON file access
    • OLED updates
python
from _thread import start_new_thread
start_new_thread(WebServer().start, ())

🔋 Efficiency Considerations

  • OLED and JSON updates are rate-limited using ticks_ms()
  • Button reads are debounced
  • Threads are lightweight, preventing blocking I/O
  • Display refreshes only on changes

🚀 Future Extensions

  • 📆 Alarm scheduling + snooze logic
  • 🌐 NTP time sync
  • 📱 Better web UI with sliders & buttons
  • 📻 Station presets & memory
  • 🔌 BLE or MQTT integration

📎 Developer Notes

  • Clear modularity: main, display, radio, web, resources
  • Code follows embedded-safe design (no dynamic memory abuse)
  • Minimal, fast and effective for real-time low-power devices

🧠 Summary

This project is a highly educational template for combining hardware control, UI, web connectivity, and concurrency in MicroPython. It’s a complete working system for embedded devices with many real-world use cases.


Parts

73
QtyValueFootprintReferences
19TestPointTestPoint:TestPoint_Keystone_5000-5004_MiniatureTP1, TP2, TP3, TP4, TP5, TP6, TP10, TP11, TP12, TP13, TP14, TP15, TP16, TP17, TP18, TP19 +3
910kΩResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR_Pullup1, R_Pullup2, R_Pullup3, R_Pullup4, R_Pullup5, R_Pullup6, R_Pullup7, R7, R8
60.01 µFCapacitor_THT:C_Axial_L3.8mm_D2.6mm_P7.50mm_HorizontalC1, C2, C9, C10, C11, C14
610ΩResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R2, R5, R6, R9, R10
4470 µFCapacitor_THT:CP_Radial_D6.3mm_P2.50mmC3, C6, C15, C16
4MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
3Conn_01x05Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_VerticalJ3, J4, J5
20.05 µFCapacitor_THT:C_Axial_L3.8mm_D2.6mm_P7.50mm_HorizontalC4, C5
20.1 µFCapacitor_THT:C_Axial_L3.8mm_D2.6mm_P7.50mm_HorizontalC12, C13
20.1 µFCapacitor_SMD:C_0603_1608MetricC7, C8
210 kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR3, R4
210kΩConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalRV1, RV2
22kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalRpullup1, Rpullup2
2LM386LM386N_4:DIP794W45P254L1016H508Q8U3, U4
2SpeakerTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_HorizontalLS1, LS2
1CUE_SJ1-352XNGConnector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_VerticalJ1
1Conn_01x01_PinConnector_Pin:Pin_D1.0mm_L10.0mm_LooseFitJ2
1OLED DisplayECE:OLED_Display_1.3DISP1
1RDA5807M_ModuleECE:RDA5807M_Module_THU2
1RPi_Pico_THModule:RaspberryPi_Pico_Common_THTU1
1SW_PushConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalSW1

Questions

How big is the Pcb schematics PCB?

It measures 100 × 100 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Pcb schematics use?

73 parts, built around the LM386. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Pcb schematics KiCad files?

From the AniMB/Clock-radio repository on GitHub, at the commit this page was made from: the board is pcb_schematics_Animish/pcb_schematics.kicad_pcb and its schematic pcb_schematics/pcb_schematics.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Pcb schematics design in my own project?

Its repository publishes it under the LGPL-2.1 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers152 × 88 mmRFBitBangSMT, the printed circuit board in 3D

    RFBitBangSMT

    profdc9/RFBitBanger

    A QRP digital transceiver created from readily available parts for off-the-grid maintenance

    271 parts222
  • 2 layers90 × 140 mmDrumkid, the printed circuit board in 3D

    Drumkid

    mattybrad/drumkid

    Version 4 was the first successful working design, with full code, schematics, Gerbers, etc available on GitHub.

    70 parts137
  • 2 layersLM80C R6, the printed circuit board in 3D

    LM80C R6

    leomil72/LM80C

    A Z80-based homebrew computer withTMS9918, AY-3-8910, Z80 CTC, Z80 PIO, and Z80 SIO

    153 parts123GPL-3.0
  • 2 layers145.3 × 44.5 mmScout, the printed circuit board in 3D

    Scout

    oskitone/scout

    3D-printed, Arduino-compatible, 17-key mono synth. Squeeeee!

    48 parts114
  • 2 layers184 × 114.8 mmPoly555, the printed circuit board in 3D

    Poly555

    oskitone/poly555

    The POLY555 is a polyphonic, analog, square wave synth based on the 555 timer chip.

    262 parts93
  • 4 layers223.3 × 120.1 mmISA FPGA v2, the printed circuit board in 3D

    ISA FPGA v2

    robfinch/Cores

    Cores ===== RTF's Cores Use at your own risk. Welcome to my galaxy of cores. Contained in the directories are IP cores, source code for digital circuits.

    132 parts78
  • 2 layers101.6 × 137.4 mmOpenxcvr, the printed circuit board in 3D

    Openxcvr

    dawsonjon/OpenXcvr

    Cost Effective HF transceiver based on max1000 FPGA module

    155 parts38MIT
  • 2 layers104.1 × 73.7 mmIsa opl2, the printed circuit board in 3D

    Isa opl2

    skiselev/isa-opl2

    ISA OPL2 Card

    61 parts36