You are browsing as a guest. Sign up (or log in) to start making projects!

james-lian

@james-lian

Joined June 8th, 2026

  • 18Devlogs
  • 6Projects
  • 1Ships
  • 15Votes
Amateur software dev + aspiring hardware dev
Open comments for this post

1h 42m 56s logged

Devlog #3 - PCB design

Once I had the design finalized from the schematic, it was straightforward enough to convert it into a PCB. I spent some time rearranging components to try and use as little space as possible.

I had to leave some extra space for the ENS160+AHT21 air quality sensor, as it doesn’t work without consistent exposure to air.

2
0
35
Open comments for this post

1h 37m 22s logged

Devlog #2 - schematic design

After confirming that the ESP-01S was a viable microcontroller for this project, I continued with designing the schematic for the PCB.


Power Management

ESP-01S is a 3.3V native controller, and the ENS160+AHT21 and the I2C OLED both use 3.3V logic. If I plug my 12V DC adapter directly into the ESP-01S, I’ll fry all my MCU components. Thus, I’m using an LM2596 buck converter to step-down some of the charge to 3.3V.


Air Quality Sensor + MCU

This section contains the sensor components and MCU. The air quality sensors and the OLED both share the same SCL/SDA I2C communication pins, which we established was possible in the previous devlog.


Flip-Flop Switch + MOSFET

Since the pins on the ESP-01S are being used, I decided to try exploring other options to turn my fan ON/OFF. I decided to use a flip-flop switch circuit. This allows me to persistently alter the fan’s ON/OFF state by simply clicking one pushbutton.

The flip-flop switch circuit is a bistable multivibrator. It has two stable states where it can output a persistent signal (either 0 or 1), thus why we say it can represent a single bit of information.

One of the states (transistors) is connected to a MOSFET (STP55NF06L), a heavy-duty voltage-controlled component which handles heavy loads much better than a simple transistor. The MOSFET helps control the fan.

I attached a flyback diode in parallel to the fan. Because a fan is fundamentally wire coiled around magnets (an inductor), when the flip-flop switch suddenly turns off, the magnetic field of the fan collapses, converting back into an extremely high-voltage electric signal that, if not protected against, could instantly fry my MOSFET. The flyback diode allows the current to loop back around through the inductor until it is harmlessly dissipated as heat.


Power-On Circuit

On its own, the flip-flop switch’s initial state is hard to control . It’s based on chance, and small manufacturing differences between identical resistors and capacitors used in the circuit.
To ensure the flip-flop switch always initializes to an OFF state, I added a tiny 10nF capacitor to one of the transistors. This makes one of the transistors slightly slower, thus ensuring the other one will always “win” the race condition.


Next, I’ll be designing the PCB and programming the ESP-01S!

0
0
4
Open comments for this post

46m logged

Devlog #1 - breadboard prototype

I’ve been soldering a lot more recently thanks to starting a variety of electronics projects, and I’m starting to feel the need to get a fume extractor and some sort of air quality sensor to monitor my workspace.
After some consideration, I decided making my own fume extractor would be a fun project idea, and also a great way to use up some electronics components that I have lying around.


Components

To make this project, I ordered some cheap $6 12V cooling fans meant for PC setups. For the microcontroller, I’ll be using an ESP-01S, an ENS160+AHT21 (which can measure air quality and VOCs), and an I2C 0.91 inch OLED display, all components I already have. I spent some time desoldering the OLED display from an older PCB project to reuse it in this one.


Breadboarding

The ESP-01S is an incredibly small controller, with only two pins (GPIO0 and GPIO2) available as digital pins (apart from RX and TX, but I plan to use those for debugging). Since both the OLED and the ENS160+AHT21 are I2C components that communicate with Serial Data (SDA) and Serial Clock (SCL), theoretically these components could share GPIO0 and GPIO2 as SDA and SCL pins if they had different device addresses.
However, to be sure, I breadboarded and flashed a quick program to output the addresses and confirm that I had three separate, unique identifiers.


Now that I have this information, I’m ready to design the PCB next.

0
0
4
Open comments for this post

3h 23m 38s logged

Devlog #3

PCB Design Mistakes

After soldering the components on last time, I found several issues with the design. First, it appears that I wired the 555 timer wrong - I ordered an NE555 timer which takes 5V logic instead of one that was compatible with 3.3V logic. Even after soldering a wire to fix that, something else with the design was wrong, which led to the component constantly outputting a HIGH signal.

Instead of spending time trying to fix it, I decided to just scratch out all the traces connecting it and removing the component altogether. Rather than retrieving a frequency from the touch capacitance sensor via hardware, I opted for a pure software route instead. I soldered a wire directly from the capacitance sensor’s copper pad to pin 1, and then using software, I would repeatedly drive the pin HIGH, and then measure the amount of time it takes for the pin to reach LOW (measuring the amount of time it takes for the copper pad to discharge).

This allows me to approximate the capacitance of the copper pad via the formula t = R * C. The capacitance will increase when my finger approaches the pad, and so by counting the cycles it takes for the capacitor to discharge, our program can tell when the capacitive sensor was touched.

The soil moisture capacitive sensor is basically the same concept in action. When the sensor is placed in dry soil, the capacitance will be low (as soil is dielectric), and timing for discharge will be low as well. When the soil is watered, capacitance will increase (as water is a strong dielectric), which will thus increase the time it takes for the soil capacitive probes to discharge.

The only problem was that it turned out I had wired the RC circuit for the soil capacitive probes incorrectly as well, which I thus spent time fixing.


Shipping

After testing the code and ensuring it worked, I went back and redesigned the PCBs to fix the mistakes I found in these physical prototypes. I’ll be shipping this project soon!

0
0
4
Open comments for this post

55m 12s logged

Devlog #2

Soldering

The PCBs and components arrived, so I spent today soldering everything together. This was the first time I’ve soldered in a couple years, so apologies if it looks rusty. I realized belatedly as I was soldering that I made one mistake: I forgot to order the I2C OLED display. I’ll be attaching it as it arrives in the coming days.

Additionally, I’ve kept the legs of most of the components intact for now, in case I want to reuse them for other projects in the future.

0
0
8
Open comments for this post

1h 24m 29s logged

This is the initial schematic for a solar cell that charges a lithium ion coin cell via the BQ25504 Texas Instruments battery charger. This one took quite a while to setup as I had completely fudged the resistor value calculations at the start in order to get my desired output voltage. I believe this will still need more tuning in the future so that the proper voltage will output under indoor lighting conditions.

0
0
2
Open comments for this post

2h 16m 1s logged

I’ve completed a schematic and an initial PCB layout for my own DIY capacitive sensor calipers, although I will definitely redo the layout to ensure a more efficient trace design.

How the design works
The Xiao Seeeduino RP2040 acts as the MCU controller of the calipers. It will control the copper pads of the capacitive sensors, and an LCD screen. I’m using an 74HC595 to convert 3 pin outputs into eight.

All the MCU and electrical components will be placed on the slider (head of the calipers). The stator (ruler body) will be a separate component that doesn’t contain any electrical components, consisting of only floating copper pads.

The capacitive pads: How is the signal received?
Although not currently placed, I will be placing several copper islands to form an Receiver (Rx) electrode and a Transmitter (Tx) array on the bottomside of the stator head. The bottom of the stator head directly faces the top of the stator, which will contain alternating 2.5mm wide floating copper pads spaced 2.5mm apart. This essentially forms a capacitor - two conductors separated by a layer of insulating material (a thin sheet of air).

The Tx array will be a periodic pattern of copper pads: 8 in total per every 5 mm cycle. To bridge the air gap between the slider and the stator, I need to generate an AC signal (which radiates electromagnetic radiation much better than DC by creating a displacement current). The Tx and Rx electrodes are fundamentally a capacitor, after all. The 8 copper pads perform marvelously for simulating an AC signal without actually using digital-to-analog converters. I use the 8-pad Tx array to generate an 8-phase signal (driving half of them HIGH and half of them LOW, and then rapidly shifting the square wave right, going from 0deg phase shift to 360deg in 45deg increments). Using the RP2040, I can generate the 8-phase signal at very high speeds (e.g. 100 kHz) with the PIO state machines. A high frequency is needed to limit capacitive reactance (resistance to AC current), whose formula is given by Xc = 1/2πfC. Our homemade capacitor has an extremely low capacitance (C) value (picofarads), and thus my frequency (f) must be high for me to get any usable signal.

How do I tell position?
We take two samples (I and Q) at specific phases in the 100 kHz cycle to find the output voltage of the Rx array. Samples that return a strong signal (high output voltage) are samples whose phase aligns strongly with the copper pads of the stator. If the stator is shifted slightly and thus misaligned, the returned signal will be weaker. We can use two samples and some math to easily determine position.

All ICs are to be fitted with decoupling capacitors placed very close by to ensure the voltage supply (VCC) is not overwhelmed by the 100 kHz frequency and that a stable voltage supply is maintained at all times.

0
0
2
Open comments for this post

2h 52m 1s logged

Devlog #1

Schematic + PCB design

Finished setting up the schematic + PCB of my capacitive soil moisture sensor display. It features a capacitive sensor for detecting soil moisture, and also a capacitive touch sensor for interacting with the OLED display. The PCB features a two copper probe-fingers; one which connects to the MCU and forms a RC circuit, and the other which connects to ground.


How it works

The idea is that when the PCB is embedded in the dielectric soil, and the humidity level increases, the capacitance of the copper probes will naturally increase as well with the presence of water. Through the equation Time = Resistance * Capacitance, we can detect the change in how long the capacitor (the copper probes) take to charge/discharge, and thus approximate the humidity level, with some calibration of course.

The touch capacitance sensor (shown on f.cu) works similarly. When a finger approaches the copper pad, the capacitance of the circuit changes, and that is something we can measure. Only difference is that, for added robustness, I added a 555 timer to convert the capacitance into a frequency that the MCU can read.


Next steps

Since the PCB is already finished, the next step for me is to finish the code and order the PCB to test it out. As this is one of my very first PCBs ever, fingers crossed it’ll work 🤞

0
0
2
Open comments for this post

42m 26s logged

Succeeded in porting (?) the Vite frontend to Wpf WebView2! I’m just happy it works now. There was an issue with the Configuration Manager/build setup, where WebView2 turned out to be incompatible with the Any CPU build, and so I had to convert the solution to an x64 platform build, which works out since that’s what I intended to do in the first place.

0
0
4
Open comments for this post

5h 30m 52s logged

I’ve finished the skeleton and main UI features of my frontend Vite app (unfortunately took longer than expected). Nothing actually works cause it’s just a frontend for now. I’ll be implementing the backend next and the WebView2 functionality, before establishing communication between the frontend and backend via Windows pipes.

0
0
5
Open comments for this post

3h 16m 21s logged

I’m in the middle of transitioning from a Winforms + Windows Service backend architecture to a decoupled C# ASP.NET Web Service + React Vite frontend with WebView2.

For those who didn’t know (like me), WebView2 allows developers to embed web content (HTML/CSS/JS) directly into native Windows apps. Of course, I could’ve used Electron, but WebView2 is widely seen as more performant as it uses the Chromium runtime already built into Windows, as opposed to Electron which bundles a separate instance of Chromium and Node.js into every app, resulting in a large footprint.

I’ve redone the UI in Vite and setup the basic ASP.NET endpoints using pipes. The next steps would be to finalize a functional UI and create the WPF project that would host the WebView capabilities.

0
0
4
Open comments for this post

4h 16m 28s logged

Setup a basic UI in Winforms, which took longer than I thought. Unforunately, at the time I started this project, I didn’t know about the possibilities of a ASP.NET + React setup. I wanted to avoid Electron due to the heavy resource consumption, but since the possibility of using WebView2 exists for me now, I might transition to that soon.
I just don’t mesh very well with Winforms…

0
0
3
Open comments for this post

1h 20m logged

Finished the basic frame of the macropad casing in Fusion! I still need to make holes for the screws + adjust some further details, but there is a frame!

The way I implemented the plateless mounting style is definitely a little weird. The top half of the case has plate “cutouts”, but there’s a little bit of clearance between the MX keyswitches and the “plate”. I hope this will give my plateless macropad a bit more support

0
0
4
Open comments for this post

1h 27m 51s logged

I completely redesigned the PCB (again) to fix an error where I forgot to leave the USB port hanging off the edge… haha.
I’ve also begun the process of designing a case for the PCB in Fusion.

0
0
6

Followers

Loading…