From c00ff9a3b56b6aa28367488f62afcc6f8185a91f Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Sat, 25 Oct 2025 16:23:39 +0800 Subject: Render rest of the project write ups. --- _projects/bumblebee.md | 28 ++++++++ _projects/bumblebee/index.md | 27 -------- _projects/desktop-unix.md | 31 +++++++++ _projects/desktop-unix/index.md | 30 --------- _projects/etlas.md | 67 +++++++++++++++++++ _projects/etlas/index.md | 66 ------------------- _projects/fpm-door-lock.md | 114 +++++++++++++++++++++++++++++++++ _projects/fpm-door-lock/index.md | 113 -------------------------------- _projects/matrix-digital-rain.md | 38 +++++++++++ _projects/matrix-digital-rain/index.md | 37 ----------- 10 files changed, 278 insertions(+), 273 deletions(-) create mode 100644 _projects/bumblebee.md delete mode 100644 _projects/bumblebee/index.md create mode 100644 _projects/desktop-unix.md delete mode 100644 _projects/desktop-unix/index.md create mode 100644 _projects/etlas.md delete mode 100644 _projects/etlas/index.md create mode 100644 _projects/fpm-door-lock.md delete mode 100644 _projects/fpm-door-lock/index.md create mode 100644 _projects/matrix-digital-rain.md delete mode 100644 _projects/matrix-digital-rain/index.md (limited to '_projects') diff --git a/_projects/bumblebee.md b/_projects/bumblebee.md new file mode 100644 index 0000000..3da51cc --- /dev/null +++ b/_projects/bumblebee.md @@ -0,0 +1,28 @@ +--- +title: "Bumblebee: turn browser sessions to code" +date: 2025-04-02 +author: W. D. Sadeep Madurange +thumbnail: thumb.png +layout: post +--- + +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 {{< link +src="https://github.com/desjarlais/Scintilla.NET" class="external" +target="_blank" rel="noopener noreferrer">}}Scintilla.NET{{< /link >}}. 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/_projects/bumblebee/index.md b/_projects/bumblebee/index.md deleted file mode 100644 index 9be1657..0000000 --- a/_projects/bumblebee/index.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "Bumblebee: turn browser sessions to code" -date: 2025-04-02T00:00:00+08:00 -author: W. D. Sadeep Madurange -thumbnail: thumb.png ---- - -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 {{< link -src="https://github.com/desjarlais/Scintilla.NET" class="external" -target="_blank" rel="noopener noreferrer">}}Scintilla.NET{{< /link >}}. 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/_projects/desktop-unix.md b/_projects/desktop-unix.md new file mode 100644 index 0000000..befbaab --- /dev/null +++ b/_projects/desktop-unix.md @@ -0,0 +1,31 @@ +--- +title: Unix for the desktop +date: 2025-09-21 +author: Wickramage Don Sadeep Madurange +thumbnail: linux.png +layout: post +--- + +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](linux.png) + +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](openbsd.png) + +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](dotfiles.tar.gz) diff --git a/_projects/desktop-unix/index.md b/_projects/desktop-unix/index.md deleted file mode 100644 index 9dfb050..0000000 --- a/_projects/desktop-unix/index.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Unix for the desktop -date: 2025-09-21T00:00:00+08:00 -author: Wickramage Don Sadeep Madurange -thumbnail: linux.png ---- - -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](linux.png) - -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](openbsd.png) - -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](dotfiles.tar.gz) diff --git a/_projects/etlas.md b/_projects/etlas.md new file mode 100644 index 0000000..3b62ba3 --- /dev/null +++ b/_projects/etlas.md @@ -0,0 +1,67 @@ +--- +title: "Etlas: e-paper display for news, stocks, and the weather" +date: 2024-09-05 +author: W. D. Sadeep Madurange +thumbnail: dash.jpg +layout: post +--- + +Etlas is a news, stock market, and weather tracker powered by an ESP32 NodeMCU +D1, featuring a 7.5-inch {{< link src="https://www.waveshare.com/" +class="external" target="_blank" rel="noopener noreferrer">}}Waveshare{{< +/link>}} e-paper display and a DHT22 sensor module. + + + + + + +
frontback
+ +The top left panel displays the end-of-day stock prices from the {{< link +src="https://polygon.io/" class="external" target="_blank" +rel="noopener noreferrer" >}}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](etlas_arch.png) + +Unlike my [e-reader](/projects/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 {{< link +src="https://www.channelnewsasia.com/" class="external" target="_blank" +rel="noopener noreferrer" >}}Channel News Asia{{< /link>}} 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 {{< link src="https://github.com/Fonger/ESP8266-RTOS-DHT" +class="external" target="_blank" rel="noopener noreferrer" >}}this{{< /link>}} +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 {{< +link src="https://github.com/waveshareteam/e-Paper" class="external" +target="_blank" rel="noopener noreferrer" >}}examples{{< /link>}} 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](source.tar.gz) diff --git a/_projects/etlas/index.md b/_projects/etlas/index.md deleted file mode 100644 index 3729d5d..0000000 --- a/_projects/etlas/index.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: "Etlas: e-paper display for news, stocks, and the weather" -date: 2024-09-05T00:00:00+08:00 -author: W. D. Sadeep Madurange -thumbnail: dash.jpg ---- - -Etlas is a news, stock market, and weather tracker powered by an ESP32 NodeMCU -D1, featuring a 7.5-inch {{< link src="https://www.waveshare.com/" -class="external" target="_blank" rel="noopener noreferrer">}}Waveshare{{< -/link>}} e-paper display and a DHT22 sensor module. - - - - - - -
frontback
- -The top left panel displays the end-of-day stock prices from the {{< link -src="https://polygon.io/" class="external" target="_blank" -rel="noopener noreferrer" >}}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](etlas_arch.png) - -Unlike my [e-reader](/projects/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 {{< link -src="https://www.channelnewsasia.com/" class="external" target="_blank" -rel="noopener noreferrer" >}}Channel News Asia{{< /link>}} 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 {{< link src="https://github.com/Fonger/ESP8266-RTOS-DHT" -class="external" target="_blank" rel="noopener noreferrer" >}}this{{< /link>}} -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 {{< -link src="https://github.com/waveshareteam/e-Paper" class="external" -target="_blank" rel="noopener noreferrer" >}}examples{{< /link>}} 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](source.tar.gz) diff --git a/_projects/fpm-door-lock.md b/_projects/fpm-door-lock.md new file mode 100644 index 0000000..c6d5364 --- /dev/null +++ b/_projects/fpm-door-lock.md @@ -0,0 +1,114 @@ +--- +title: Fingerprint door lock +date: 2025-10-03 +author: W. D. Sadeep Madurange +thumbnail: pcb.jpg +layout: post +--- + +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](source.tar.gz), [gerber.zip](gerber.zip) diff --git a/_projects/fpm-door-lock/index.md b/_projects/fpm-door-lock/index.md deleted file mode 100644 index 9122332..0000000 --- a/_projects/fpm-door-lock/index.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: Prototype fingerprint door lock -date: 2025-10-03T00:00:00+08:00 -author: W. D. Sadeep Madurange -thumbnail: pcb.jpg ---- - -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](source.tar.gz), [gerber.zip](gerber.zip) diff --git a/_projects/matrix-digital-rain.md b/_projects/matrix-digital-rain.md new file mode 100644 index 0000000..c385907 --- /dev/null +++ b/_projects/matrix-digital-rain.md @@ -0,0 +1,38 @@ +--- +title: The Matrix digital rain +date: 2024-01-12 +author: W. D. Sadeep Madurange +thumbnail: thumb.png +layout: post +--- + +The famous digital rain from the movie The Matrix implemented in C for +the Unix terminal without using any GUI/TUI kits: + + + +Domsson's {{< link src="https://github.com/domsson/fakesteak" class="external" +target="_blank" rel="noopener noreferrer" >}}Fakesteak{{< /link >}} inspired +this project. I added the following features while trying to keep the original +project's simplicity intact as much as possible: + +- Customize the rain color to match the theme of the setup. +- Support for UTF-32 characters. +- The ghosting effect of old monochrome displays. +- The rain more closely resembles the original from the first movie. + +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](source.tar.gz) diff --git a/_projects/matrix-digital-rain/index.md b/_projects/matrix-digital-rain/index.md deleted file mode 100644 index f2fa23d..0000000 --- a/_projects/matrix-digital-rain/index.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: The Matrix digital rain for Unix terminals -date: 2024-01-12T00:00:00+08:00 -author: W. D. Sadeep Madurange -thumbnail: thumb.png ---- - -The famous digital rain from the movie The Matrix implemented in C for -the Unix terminal without using any GUI/TUI kits: - - - -Domsson's {{< link src="https://github.com/domsson/fakesteak" class="external" -target="_blank" rel="noopener noreferrer" >}}Fakesteak{{< /link >}} inspired -this project. I added the following features while trying to keep the original -project's simplicity intact as much as possible: - -- Customize the rain color to match the theme of the setup. -- Support for UTF-32 characters. -- The ghosting effect of old monochrome displays. -- The rain more closely resembles the original from the first movie. - -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](source.tar.gz) -- cgit v1.2.3