From 79e9eec0ac05634fe367220df701b20c91523291 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Sat, 25 Oct 2025 10:53:52 +0800 Subject: Project folder. --- _site/about.html | 30 ----- _site/about/index.html | 33 +++++ _site/assets/css/main.css | 6 + _site/blog/post-1/index.html | 34 ----- _site/blog/post-1/index/index.html | 37 ++++++ _site/index.html | 50 ++++++- _site/projects/bumblebee/bee.mp4 | Bin 0 -> 2352029 bytes _site/projects/bumblebee/index/index.html | 18 +++ _site/projects/bumblebee/thumb.png | Bin 0 -> 125909 bytes _site/projects/desktop-unix/dotfiles.tar.gz | Bin 0 -> 6397999 bytes _site/projects/desktop-unix/index/index.html | 23 ++++ _site/projects/desktop-unix/linux.png | Bin 0 -> 206255 bytes _site/projects/desktop-unix/openbsd.png | Bin 0 -> 318897 bytes _site/projects/e-reader/circuit.svg | 145 +++++++++++++++++++++ _site/projects/e-reader/ereader.mp4 | Bin 0 -> 9775756 bytes _site/projects/e-reader/index/index.html | 81 ++++++++++++ _site/projects/e-reader/source.tar.gz | Bin 0 -> 14304 bytes _site/projects/e-reader/thumb.png | Bin 0 -> 674187 bytes _site/projects/etlas/circuit.svg | 105 +++++++++++++++ _site/projects/etlas/dash.jpg | Bin 0 -> 85874 bytes _site/projects/etlas/etlas_arch.png | Bin 0 -> 47732 bytes _site/projects/etlas/index/index.html | 50 +++++++ _site/projects/etlas/pcb.jpg | Bin 0 -> 75769 bytes _site/projects/etlas/schematic.svg | 4 + _site/projects/etlas/source.tar.gz | Bin 0 -> 46871 bytes _site/projects/fpm-door-lock/breadboard.jpg | Bin 0 -> 46771 bytes _site/projects/fpm-door-lock/footprint.png | Bin 0 -> 198127 bytes _site/projects/fpm-door-lock/gerber.zip | Bin 0 -> 89431 bytes _site/projects/fpm-door-lock/index/index.html | 106 +++++++++++++++ _site/projects/fpm-door-lock/pcb.jpg | Bin 0 -> 68237 bytes _site/projects/fpm-door-lock/pcb1.jpg | Bin 0 -> 37068 bytes _site/projects/fpm-door-lock/source.tar.gz | Bin 0 -> 29473 bytes _site/projects/fpm-door-lock/video.mp4 | Bin 0 -> 13264594 bytes _site/projects/index.html | 62 +++++++++ .../projects/matrix-digital-rain/index/index.html | 31 +++++ _site/projects/matrix-digital-rain/katakana.png | Bin 0 -> 133709 bytes _site/projects/matrix-digital-rain/matrix.mp4 | Bin 0 -> 930430 bytes _site/projects/matrix-digital-rain/source.tar.gz | Bin 0 -> 2075 bytes _site/projects/matrix-digital-rain/thumb.png | Bin 0 -> 122502 bytes _site/projects/post-1/index.html | 34 ----- 40 files changed, 747 insertions(+), 102 deletions(-) delete mode 100644 _site/about.html create mode 100644 _site/about/index.html delete mode 100644 _site/blog/post-1/index.html create mode 100644 _site/blog/post-1/index/index.html create mode 100644 _site/projects/bumblebee/bee.mp4 create mode 100644 _site/projects/bumblebee/index/index.html create mode 100644 _site/projects/bumblebee/thumb.png create mode 100644 _site/projects/desktop-unix/dotfiles.tar.gz create mode 100644 _site/projects/desktop-unix/index/index.html create mode 100644 _site/projects/desktop-unix/linux.png create mode 100644 _site/projects/desktop-unix/openbsd.png create mode 100644 _site/projects/e-reader/circuit.svg create mode 100644 _site/projects/e-reader/ereader.mp4 create mode 100644 _site/projects/e-reader/index/index.html create mode 100644 _site/projects/e-reader/source.tar.gz create mode 100644 _site/projects/e-reader/thumb.png create mode 100644 _site/projects/etlas/circuit.svg create mode 100644 _site/projects/etlas/dash.jpg create mode 100644 _site/projects/etlas/etlas_arch.png create mode 100644 _site/projects/etlas/index/index.html create mode 100644 _site/projects/etlas/pcb.jpg create mode 100644 _site/projects/etlas/schematic.svg create mode 100644 _site/projects/etlas/source.tar.gz create mode 100644 _site/projects/fpm-door-lock/breadboard.jpg create mode 100644 _site/projects/fpm-door-lock/footprint.png create mode 100644 _site/projects/fpm-door-lock/gerber.zip create mode 100644 _site/projects/fpm-door-lock/index/index.html create mode 100644 _site/projects/fpm-door-lock/pcb.jpg create mode 100644 _site/projects/fpm-door-lock/pcb1.jpg create mode 100644 _site/projects/fpm-door-lock/source.tar.gz create mode 100644 _site/projects/fpm-door-lock/video.mp4 create mode 100644 _site/projects/index.html create mode 100644 _site/projects/matrix-digital-rain/index/index.html create mode 100644 _site/projects/matrix-digital-rain/katakana.png create mode 100644 _site/projects/matrix-digital-rain/matrix.mp4 create mode 100644 _site/projects/matrix-digital-rain/source.tar.gz create mode 100644 _site/projects/matrix-digital-rain/thumb.png delete mode 100644 _site/projects/post-1/index.html (limited to '_site') diff --git a/_site/about.html b/_site/about.html deleted file mode 100644 index 1274d2a..0000000 --- a/_site/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - About - - - - - - -
- -
- -

About page

- -

This page tells you a little bit about me.

-
- - - diff --git a/_site/about/index.html b/_site/about/index.html new file mode 100644 index 0000000..6546e0b --- /dev/null +++ b/_site/about/index.html @@ -0,0 +1,33 @@ + + + + + About + + + + + + +
+ +
+ +

About page

+ +

This page tells you a little bit about me.

+
+ + + diff --git a/_site/assets/css/main.css b/_site/assets/css/main.css index e58a791..0a787f2 100644 --- a/_site/assets/css/main.css +++ b/_site/assets/css/main.css @@ -32,6 +32,11 @@ img { mix-blend-mode: multiply; } +table { + border: none; + width: 100%; +} + #navlist > .active > a { color: #000; font-weight: 600; @@ -157,3 +162,4 @@ and (min-device-width : 768px) { margin-right:0; } } + diff --git a/_site/blog/post-1/index.html b/_site/blog/post-1/index.html deleted file mode 100644 index db0b37e..0000000 --- a/_site/blog/post-1/index.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Index - - - - - - -
- -
- -

An apple is a sweet, edible fruit produced by an apple tree.

- -

Apple trees are cultivated worldwide, and are the most widely grown -species in the genus Malus. The tree originated in Central Asia, where -its wild ancestor, Malus sieversii, is still found today. Apples have -been grown for thousands of years in Asia and Europe, and were brought -to North America by European colonists.

-
- - - diff --git a/_site/blog/post-1/index/index.html b/_site/blog/post-1/index/index.html new file mode 100644 index 0000000..de0e7ef --- /dev/null +++ b/_site/blog/post-1/index/index.html @@ -0,0 +1,37 @@ + + + + + Index + + + + + + +
+ +
+ +

An apple is a sweet, edible fruit produced by an apple tree.

+ +

Apple trees are cultivated worldwide, and are the most widely grown +species in the genus Malus. The tree originated in Central Asia, where +its wild ancestor, Malus sieversii, is still found today. Apples have +been grown for thousands of years in Asia and Europe, and were brought +to North America by European colonists.

+
+ + + diff --git a/_site/index.html b/_site/index.html index c60b34a..22feae3 100644 --- a/_site/index.html +++ b/_site/index.html @@ -15,7 +15,10 @@ hme
  • - abt + tnk +
  • +
  • + abt
  • rss
  • @@ -26,14 +29,53 @@
  • -

    Index

    +

    Index

    An apple is a sweet, edible fruit produced by an apple tree.

  • -

    Index

    -

    An apple is a sweet, edible fruit produced by an apple tree.

    +

    Prototype e-reader

    +

    This project features a prototype e-reader powered by a 7.5-inch Waveshare e-paper display and an +ESP-WROOM-32 development board.

    + +
  • + +
  • +

    The Matrix digital rain for Unix terminals

    +

    The famous digital rain from the movie The Matrix implemented in C for +the Unix terminal without using any GUI/TUI kits:

    + +
  • + +
  • +

    Etlas: e-paper display for news, stocks, and the weather

    +

    Etlas is a news, stock market, and weather tracker powered by an ESP32 NodeMCU +D1, featuring a 7.5-inch Waveshare e-paper display and a DHT22 sensor module.

    + +
  • + +
  • +

    Bumblebee: turn browser sessions to code

    +

    Bumblebee is a web browser that turns browser sessions into C# scripts. Its +objective is to eliminate the need for authoring scripts for testing, web +scraping, and other browser automation tasks.

    + +
  • + +
  • +

    Unix for the desktop

    +

    The year 2020 transformed my personal computing experience. In March 2020, I +stumbled upon Arch Linux and discovered that I could customize my desktop +environment to look and work any way I liked. I exercised that newfound freedom +to create a Matrix-themed setup:

    + +
  • + +
  • +

    Prototype fingerprint door lock

    +

    This project features a fingerprint door lock powered by an ATmega328P +microcontroller.

  • diff --git a/_site/projects/bumblebee/bee.mp4 b/_site/projects/bumblebee/bee.mp4 new file mode 100644 index 0000000..835600d Binary files /dev/null and b/_site/projects/bumblebee/bee.mp4 differ diff --git a/_site/projects/bumblebee/index/index.html b/_site/projects/bumblebee/index/index.html new file mode 100644 index 0000000..162a9c0 --- /dev/null +++ b/_site/projects/bumblebee/index/index.html @@ -0,0 +1,18 @@ +

    Bumblebee is a web browser that turns browser sessions into C# scripts. Its +objective is to eliminate the need for authoring scripts for testing, web +scraping, and other browser automation tasks.

    + + + +

    Bumblebee is a Windows Forms application written in C#. The rendering of web +content is handled by the embedded Microsoft Edge browser (via WebView). The +text editor on the right is Scintilla.NET. It +enables users to override the script at any point during the session. There are +application settings that let users debounce events, ignore hidden elements +and scripts, and more.

    + +

    Unfortunately, I can’t share the source code for Bumblebee. I developed it for +an employer. Hence, the software is proprietary.

    + diff --git a/_site/projects/bumblebee/thumb.png b/_site/projects/bumblebee/thumb.png new file mode 100644 index 0000000..1e0db2b Binary files /dev/null and b/_site/projects/bumblebee/thumb.png differ diff --git a/_site/projects/desktop-unix/dotfiles.tar.gz b/_site/projects/desktop-unix/dotfiles.tar.gz new file mode 100644 index 0000000..c6774c4 Binary files /dev/null and b/_site/projects/desktop-unix/dotfiles.tar.gz differ diff --git a/_site/projects/desktop-unix/index/index.html b/_site/projects/desktop-unix/index/index.html new file mode 100644 index 0000000..8566dea --- /dev/null +++ b/_site/projects/desktop-unix/index/index.html @@ -0,0 +1,23 @@ +

    The year 2020 transformed my personal computing experience. In March 2020, I +stumbled upon Arch Linux and discovered that I could customize my desktop +environment to look and work any way I liked. I exercised that newfound freedom +to create a Matrix-themed setup:

    + +

    Arch Linux

    + +

    The system employs the X display server and the i3 window manager. The terminal +emulator used is Urxvt. The translucent effect is achieved with the help of the +Xcompmgr compositor. This sort of setup was popular among minimalist Linux +users.

    + +

    In February 2024, I switched to an OpenBSD system with Xenocara (the OpenBSD +build of X display server) as the display server and i3 as the window manager:

    + +

    OpenBSD i3

    + +

    Unlike Linux, OpenBSD includes a coherent desktop environment out of the box. +Except for the window manager, for which I prefer a tiling one, I’m now using +the default OpenBSD setup. For the window manager, I use dwm from the Suckless +team.

    + +

    Files: dotfiles.tar.gz

    diff --git a/_site/projects/desktop-unix/linux.png b/_site/projects/desktop-unix/linux.png new file mode 100644 index 0000000..40bc33b Binary files /dev/null and b/_site/projects/desktop-unix/linux.png differ diff --git a/_site/projects/desktop-unix/openbsd.png b/_site/projects/desktop-unix/openbsd.png new file mode 100644 index 0000000..d7489f7 Binary files /dev/null and b/_site/projects/desktop-unix/openbsd.png differ diff --git a/_site/projects/e-reader/circuit.svg b/_site/projects/e-reader/circuit.svg new file mode 100644 index 0000000..fd7508b --- /dev/null +++ b/_site/projects/e-reader/circuit.svg @@ -0,0 +1,145 @@ + + + + + + + + + + + 10 kΩ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 2 + 3 + 4 + + + + + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + + + + + 5 + 6 + 7 + 8 + BUS + E-Paper Display HAT + + + CS + + DC + + DIN + + CLK + + BUSY + + RST + + GND + + VCC + + ESP-WROOM-32 + + IO21 + + + IO5 + + + IO16 + + + IO23 + + + IO18 + + + IO22 + + + IO4 + + + IO2 + + + GND + + + 3V3 + + + GND + + + IO15 + + + + \ No newline at end of file diff --git a/_site/projects/e-reader/ereader.mp4 b/_site/projects/e-reader/ereader.mp4 new file mode 100644 index 0000000..a57a5b1 Binary files /dev/null and b/_site/projects/e-reader/ereader.mp4 differ diff --git a/_site/projects/e-reader/index/index.html b/_site/projects/e-reader/index/index.html new file mode 100644 index 0000000..dd58a14 --- /dev/null +++ b/_site/projects/e-reader/index/index.html @@ -0,0 +1,81 @@ +

    This project features a prototype e-reader powered by a 7.5-inch Waveshare e-paper display and an +ESP-WROOM-32 development board.

    + +

    <video style=”max-width:100%” controls=”” poster=thumb.png>

    + + +

    </video>

    + +

    Overview

    + +

    In 2017, during a short stint as a project manager, I was tasked with +installing some e-paper displays in a car park. Not knowing how they worked, I +remember marveling at their sight like a muggle witnessing magic. As someone +who enjoys reading, I found e-paper to be a true innovation. This project was +born out of that enduring curiosity and love of e-paper technology.

    + +

    The prototype, while far from ready for daily use, has some nifty features that +fellow hobbyists and tinkerers may find interesting. The reader can display +books of arbitrary sizes by streaming them over HTTP. It employs sleep modes to +minimize power consumption when not in use and records the reading progress in +the chip’s RTC memory.

    + +

    The following schematic outlines the electrical connections of the e-reader.

    + +

    circuit

    + +

    The biggest challenge when building an e-reader using an ESP32 board is its low +memory and lack of storage. My ESP-WROOM-32 board has 512 KB of SRAM and 4 MB +of flash memory, which the freeRTOS, ESP-IDF, and my own program have to share. +To put things into perspective, compare that to a Kindle Paperwhite, which has +at least 256 MB of memory and 8 GB of storage.

    + +

    Despite its constraints, as microcontrollers go, ESP32 is a powerful +system-on-a-chip with a 160 MHz dual-core processor and integrated WiFi. So, I +thought it’d be amusing to embrace the constraints and build my e-reader using +just a $5 MCU and the power of C programming.

    + +

    The file format

    + +

    The file format dictates the complexity of the embedded software. So, I’ll +begin there. The e-reader works by downloading and rendering a rasterized +monochrome image of a page (a .ebm file).

    + +

    The EBM file contains a series of bitmaps, where each bitmap corresponds to a +page of a book sized to fit the e-paper display. Each byte contains information +for rendering eight pixels. For my display, which has a resolution of 480x800, +the bitmaps are laid out along 48 KB boundaries. This simple file format lends +well to HTTP streaming, which is its main advantage, as we will soon see.

    + +

    The enclosed pdftoebm.py script in the tarball at the end of the page converts +PDF documents to an EBM file. I use it to make EBM files before uploading them +to a web server.

    + +

    How does it work?

    + +

    As the e-reader has no storage, it can’t store books locally. Instead, I first +have to upload the EBM file I want to read to a web server. The location of the +file is configured via the EBM_ARCH_URL setting in the Kconfig.projbuild +file. To read a different book, I create an EBM file with the same name and +upload it to the original location. That way, I don’t have to recompile the +embedded software.

    + +

    Upon powering up, the e-reader checks the reading progress stored in the RTC +memory. It then downloads three pages (current, previous, and next) to a +circular buffer in DMA-capable memory. When the user turns a page, one of the +two cores of the MCU transfers it from the buffer to the display over a Serial +Peripheral Interface (SPI). The other downloads a new page in the background. I +use the ESP-IDF task API to pin the two routines to each core.

    + +

    I designed the EBM format with HTTP streaming in mind. To download a page based +on the current reading progress, the e-reader specifies the page offset and the +chunk size using the HTTP Range header.

    + +

    Afterword

    + +

    It’s been six years since the car park and the displays. At the time, I knew +nothing about embedded systems or display drivers. It took a long time to +develop the skill set, but now, at last, I know how those displays worked and +how to build my own.

    + +

    Files: source.tar.gz

    diff --git a/_site/projects/e-reader/source.tar.gz b/_site/projects/e-reader/source.tar.gz new file mode 100644 index 0000000..3e343a7 Binary files /dev/null and b/_site/projects/e-reader/source.tar.gz differ diff --git a/_site/projects/e-reader/thumb.png b/_site/projects/e-reader/thumb.png new file mode 100644 index 0000000..1e222d2 Binary files /dev/null and b/_site/projects/e-reader/thumb.png differ diff --git a/_site/projects/etlas/circuit.svg b/_site/projects/etlas/circuit.svg new file mode 100644 index 0000000..6255045 --- /dev/null +++ b/_site/projects/etlas/circuit.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + AM2302 + + + DATA + + GND + + VCC + E-Paper display HAT + + + CS + + DC + + DIN + + CLK + + BUSY + + RST + + PWR + + GND + + VCC + + + + + + + + + + + + + + 1 + 2 + 3 + 4 + + + + + 1 + 2 + 3 + 4 + + ESP32 Mini NodeMCU D1 + + IO19 + + + IO15 + + + GND + + + IO27 + + + IO14 + + + IO13 + + + IO25 + + + IO26 + + + IO16 + + + GND + + + 3V3 + + + \ No newline at end of file diff --git a/_site/projects/etlas/dash.jpg b/_site/projects/etlas/dash.jpg new file mode 100644 index 0000000..cf4efc6 Binary files /dev/null and b/_site/projects/etlas/dash.jpg differ diff --git a/_site/projects/etlas/etlas_arch.png b/_site/projects/etlas/etlas_arch.png new file mode 100644 index 0000000..241e9f1 Binary files /dev/null and b/_site/projects/etlas/etlas_arch.png differ diff --git a/_site/projects/etlas/index/index.html b/_site/projects/etlas/index/index.html new file mode 100644 index 0000000..667c42e --- /dev/null +++ b/_site/projects/etlas/index/index.html @@ -0,0 +1,50 @@ +

    Etlas is a news, stock market, and weather tracker powered by an ESP32 NodeMCU +D1, featuring a 7.5-inch Waveshare e-paper display and a DHT22 sensor module.

    + + + + + + +
    frontback
    + +

    The top left panel displays the end-of-day stock prices from the Polygon.io API, relayed through my own +FastCGI-wrapped Flask app hosted on a VPS. The stock symbols can be configured +through the Flask app’s application settings. The server.fcgi script enclosed +in the tarball at the end of the page contains the Flask app.

    + +

    The following diagram outlines this system architecture.

    + +

    architecture

    + +

    Unlike my e-reader, which worked with raster images, +Etlas downloads time series data as CSV and computes the price curves on the +ESP32.

    + +

    The more prominent panel on the right of the e-paper display shows local +(Singapore) and world news from the Channel News Asia RSS feed. The MCU +downloads and parses XML data from the RSS feed directly before rendering it to +the display. Although I did it this way to avoid writing server code, it limits +the feeds from which Etlas can receive data. In a future version, I will relay +the RSS feed through a server (like the stock prices) to make it more flexible.

    + +

    The bottom panels (middle and right) display the temperature and relative +humidity from a DHT22 sensor. The DHT22 driver, arguably the most interesting +part of the software, reads real-time sensor data by comparing relative pulse +widths. The pulses themselves are too quick for the ESP32 to reliably measure +directly. I ported this +implementation for ESP8266 modules to my ESP32. All credit for the algorithm +belongs to them.

    + +

    Much of the heavy lifting of acquiring, interpreting, and rendering data from +different data sources is performed on the microcontroller using less than 512 +KB of memory. The embedded software that makes that possible is written in C +using the ESP-IDF v5.2.1. My e-paper display driver is a port of Waveshare examples for Arduino +and STM32 platforms.

    + +

    I’ve been using Etlas daily (for a couple of hours on weekdays and all day on +weekends) since August 2024. As of October 2025, it’s been running reliably for +over a year. If you are interested in an e-paper display like this, drop me an +email at the address on my home page.

    + +

    Files: source.tar.gz

    diff --git a/_site/projects/etlas/pcb.jpg b/_site/projects/etlas/pcb.jpg new file mode 100644 index 0000000..fcb40fa Binary files /dev/null and b/_site/projects/etlas/pcb.jpg differ diff --git a/_site/projects/etlas/schematic.svg b/_site/projects/etlas/schematic.svg new file mode 100644 index 0000000..3070dd1 --- /dev/null +++ b/_site/projects/etlas/schematic.svg @@ -0,0 +1,4 @@ + + + +152726131425193V3GND
    ESP32 Mini NodeMCU D1
    ESP32 Mini NodeMCU D1
    DHT22
    DHT22
    E-paper HAT
    E-paper HAT
    3.3V
    3.3V
    3.3V
    3.3V
    3.3V
    3.3V
    CS
    CS
    DC
    DC
    RST
    RST
    CLK
    CLK
    MOSY
    MOSY
    BUSY
    BUSY
    VCC
    VCC
    GND
    GND
    VCC
    VCC
    GND
    GND
    DATA
    DATA
    Text is not SVG - cannot display
    \ No newline at end of file diff --git a/_site/projects/etlas/source.tar.gz b/_site/projects/etlas/source.tar.gz new file mode 100644 index 0000000..8b12cf6 Binary files /dev/null and b/_site/projects/etlas/source.tar.gz differ diff --git a/_site/projects/fpm-door-lock/breadboard.jpg b/_site/projects/fpm-door-lock/breadboard.jpg new file mode 100644 index 0000000..2bf47a9 Binary files /dev/null and b/_site/projects/fpm-door-lock/breadboard.jpg differ diff --git a/_site/projects/fpm-door-lock/footprint.png b/_site/projects/fpm-door-lock/footprint.png new file mode 100644 index 0000000..5511bf1 Binary files /dev/null and b/_site/projects/fpm-door-lock/footprint.png differ diff --git a/_site/projects/fpm-door-lock/gerber.zip b/_site/projects/fpm-door-lock/gerber.zip new file mode 100644 index 0000000..19a9d19 Binary files /dev/null and b/_site/projects/fpm-door-lock/gerber.zip differ diff --git a/_site/projects/fpm-door-lock/index/index.html b/_site/projects/fpm-door-lock/index/index.html new file mode 100644 index 0000000..4bcc9ed --- /dev/null +++ b/_site/projects/fpm-door-lock/index/index.html @@ -0,0 +1,106 @@ +

    This project features a fingerprint door lock powered by an ATmega328P +microcontroller.

    + + + +

    Overview

    + +

    The lock comprises three subsystems: the ATmega328P, an R503 fingerprint +sensor, and an FS5106B high-torque servo. The sensor mounted on the front +surface of the door enables users to unlock it from the outside. The servo is +attached to the interior door knob. The MCU must be installed at the back of +the door to prevent unauthorized users from tampering with it.

    + +

    When no one is interacting with the lock, the MCU is in deep sleep. The sensor +and the servo each draw 13.8 mA and 4.6 mA of quiescent currents. To prevent +this idle current draw, the MCU employs MOSFETs to cut off power to them before +entering deep sleep. Doing so is crucial for conserving the battery.

    + +

    Without power, the sensor remains in a low-power state, drawing approximately +2.9 μA through a separate power rail. When a finger comes into contact with the +sensor, the sensor triggers a pin change interrupt, waking up the MCU. The MCU +activates a MOSFET, which in turn activates the sensor. Over UART, the MCU +unlocks the sensor and issues commands to scan and match the fingerprint.

    + +

    If the fingerprint matches an enrolled fingerprint, the MCU activates the blue +LED on the sensor, turns on the MOSFET connected to the servo, and sends a PWM +signal to the servo to unlock the door. Otherwise, the MCU activates the red +LED on the sensor. Finally, the MCU deactivates the MOSFETS and goes back to +sleep.

    + +

    Embedded software

    + +

    The embedded software, written in C with the help of the AVR toolchain, +includes a driver for the sensor, servo control routines, and a battery +monitoring system.

    + +

    In addition to controlling the sensor and the servo, the program strives to +maintain precise control over the sleep mode, as well as when the peripherals +are activated and for how long they remain active. I thoroughly enjoyed writing +the embedded software. There’s something magical about being able to alter the +physical world around you by uttering a few lines of C code.

    + +

    The source code of the project, which includes a driver for the R503 +fingerprint sensor module, is enclosed in the tarball linked at the end of the +page.

    + +

    The circuit board

    + +

    For this project, I designed a custom PCB and had it fabricated by JLCPCB. Like +the software, the circuit is chiefly concerned with optimizing power +consumption and extending battery life.

    + + + + + + + + + +
    + PCB + + Design +
    + PCB footprint +
    + +

    To that end, the principal components of the circuit are the 2N7000 and +NDP6020P field-effect transistors. They switch power electronically to the +servo and the fingerprint sensor, the two most power-hungry parts of the +circuit. The two MP1584EN buck converters play an axial role in efficiently +regulating power to the MCU and the sensor.

    + +

    The ATmega328P typically operates at 5 V with a 16 MHz crystal oscillator. To +further reduce power consumption, I modified the ATmega328P’s fuses to run at +3.3 V with an 8 MHz crystal oscillator.

    + +

    The bottom right area of the PCB isolates the power supply of the servo from +the rest of the circuit. This shields components such as the MCU from the +servo’s high current draw, which can exceed 1 A. The IN4007 diode in slot U2 +serves as a flyback diode, protecting the MOSFET from reverse currents +generated by the servo.

    + +

    Lastly, the 56 kΩ and 10 kΩ resistors in slots R10 and R11 form a voltage +divider circuit. Its output is fed to the ADC of the MCU, which measures the +supply voltage by comparing it to the internal bandgap reference voltage.

    + +

    Epilogue

    + +

    This project began nearly a year ago when I attempted to unlock our door +wirelessly by writing to the UART ports of two MCUs connected to inexpensive +433 MHz RF transceivers, as if there were an invisible wire between them. +Although I failed, it led me down a rabbit hole of RF communications, MOSFETs, +PCB design, and low-power circuits.

    + +

    During the project, I reinvented the wheel many times. I implemented a +low-level network stack using only RF modules and an 8-bit microcontroller, +designed my first PCB, and developed drivers from scratch. The project was far +from a smooth sail. Bad electrical connections, soldering, desoldering, and the +heartache of purchasing the wrong parts were routine. It was a long but +rewarding journey from the messy breadboard to the shiny PCB.

    + +

    Files: source.tar.gz, gerber.zip

    diff --git a/_site/projects/fpm-door-lock/pcb.jpg b/_site/projects/fpm-door-lock/pcb.jpg new file mode 100644 index 0000000..fbd800b Binary files /dev/null and b/_site/projects/fpm-door-lock/pcb.jpg differ diff --git a/_site/projects/fpm-door-lock/pcb1.jpg b/_site/projects/fpm-door-lock/pcb1.jpg new file mode 100644 index 0000000..367187d Binary files /dev/null and b/_site/projects/fpm-door-lock/pcb1.jpg differ diff --git a/_site/projects/fpm-door-lock/source.tar.gz b/_site/projects/fpm-door-lock/source.tar.gz new file mode 100644 index 0000000..ef23422 Binary files /dev/null and b/_site/projects/fpm-door-lock/source.tar.gz differ diff --git a/_site/projects/fpm-door-lock/video.mp4 b/_site/projects/fpm-door-lock/video.mp4 new file mode 100644 index 0000000..a907a9b Binary files /dev/null and b/_site/projects/fpm-door-lock/video.mp4 differ diff --git a/_site/projects/index.html b/_site/projects/index.html new file mode 100644 index 0000000..a1ebd40 --- /dev/null +++ b/_site/projects/index.html @@ -0,0 +1,62 @@ + + + + + Projects + + + + + + +
    + +
    + +
    + + + + + + + + + + + + +
    + E-reader +
    Prototype e-reader
    +
    + The Matrix +
    The Matrix digital rain
    +
    + Etlas +
    Etlas: e-paper display for news, stocks, and the weather
    +
    + Bumblebee +
    Bumblebee: turn browser sessions to code
    +
    + FPM door lock +
    Prototype fingerprint door lock
    +
    + Unix desktop +
    Unix for the desktop
    +
    +
    + + + diff --git a/_site/projects/matrix-digital-rain/index/index.html b/_site/projects/matrix-digital-rain/index/index.html new file mode 100644 index 0000000..e240834 --- /dev/null +++ b/_site/projects/matrix-digital-rain/index/index.html @@ -0,0 +1,31 @@ +

    The famous digital rain from the movie The Matrix implemented in C for +the Unix terminal without using any GUI/TUI kits:

    + + + +

    Domsson’s Fakesteak inspired +this project. I added the following features while trying to keep the original +project’s simplicity intact as much as possible:

    + + + +

    To use them, you need a terminal emulator that supports 24-bit RGB colors and +Unicode characters.

    + +

    The background, head, and tail colors of the rain can be configured via +COLOR_BG_*, COLOR_HD_*, and COLOR_TL_* settings. The UNICODE_MIN and +UNICODE_MAX values control the character set used for the rain. For instance, +use 0x30A1 and 0x30F6 for Katakana:

    + +

    + +

    Happy ricing!

    + +

    Files: source.tar.gz

    diff --git a/_site/projects/matrix-digital-rain/katakana.png b/_site/projects/matrix-digital-rain/katakana.png new file mode 100644 index 0000000..b9df873 Binary files /dev/null and b/_site/projects/matrix-digital-rain/katakana.png differ diff --git a/_site/projects/matrix-digital-rain/matrix.mp4 b/_site/projects/matrix-digital-rain/matrix.mp4 new file mode 100644 index 0000000..84a9839 Binary files /dev/null and b/_site/projects/matrix-digital-rain/matrix.mp4 differ diff --git a/_site/projects/matrix-digital-rain/source.tar.gz b/_site/projects/matrix-digital-rain/source.tar.gz new file mode 100644 index 0000000..fead280 Binary files /dev/null and b/_site/projects/matrix-digital-rain/source.tar.gz differ diff --git a/_site/projects/matrix-digital-rain/thumb.png b/_site/projects/matrix-digital-rain/thumb.png new file mode 100644 index 0000000..7e008c2 Binary files /dev/null and b/_site/projects/matrix-digital-rain/thumb.png differ diff --git a/_site/projects/post-1/index.html b/_site/projects/post-1/index.html deleted file mode 100644 index db0b37e..0000000 --- a/_site/projects/post-1/index.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Index - - - - - - -
    - -
    - -

    An apple is a sweet, edible fruit produced by an apple tree.

    - -

    Apple trees are cultivated worldwide, and are the most widely grown -species in the genus Malus. The tree originated in Central Asia, where -its wild ancestor, Malus sieversii, is still found today. Apples have -been grown for thousands of years in Asia and Europe, and were brought -to North America by European colonists.

    -
    - - - -- cgit v1.2.3