Search This Blog

Thursday, August 14, 2025

PC drive bay mod

One of my PC is in an old case reused from a previous machine.  It was from the old days before long GPU was a thing. Between the GPU and tower CPU heatsink, I loses 3 HDD bays due to mechanical interferences.  

What I wanted is to rotate the drive bays by 90 degrees with the connector side facing side of the case so that they can easily be worked on.  I have decided to take matters into my own hands literally.

Not the first time I modded something in this PC.  I have swapped out the USB 2.0 connectors with USB3.0 on the front panel and Intel heatsink mounting brackets on my AM4!

My new PC case sort of does that and they even have removable drive bays. At the last minute, someone decided to put the connectors other side of the case so you'll still need to open up the panel on the other side to plug/unplug the cables.  They could have done the minimal like what I wanted by simply rotating the drive so that the connectors are accessible at the front.  See my Corsair 100R Hotswap style drive bay upgrade for how it could make swapping drives easier.  Obviously the OEM could have easily sold an optional $50 midplane upgrade.

The before picture

I removed the drive bays panels by drilling through the 8 rivets that held them in place.  I used my Dremel with a cutting wheel to cut and trim the panels into 2 sets - one for the 2 bays for the front and the other for 5 bays that are rotated by 90 degrees.

The thick cutting wheels I bought from aliexpress are great.  The 2 disc lasted enough to finish the job and finally broke when they were worn down to a bout 1 cm in diameter and got caught.  A bit of clean up with a rough file for finishing/deburring and the panels are good enough to be used.

A bit of free hand work with a Dremel cutting wheel

The front drive bays are mounted back where they belong.  They are short enough that they don't need additional supports.  The problem is the much taller panels that needs some for bracing on the cut ends.

I designed a 2 parts drive bays for a removable 2.5" SSD that is also mechanically strong enough to be used as bracing.





The bay is printed vertically with the blocked side on the plate.  4 large 6-32 nuts are inserted into the slots at the back.  The large nuts provide a lot of contact are and help to spread out the forces.  

The caddy is printed as is without support.  Here is what they looks like printed in PLA+.  The opening and the standoffs allows for some air to reach on the bottom side of the case.  The hexagons allows for some flexing of the studded sides for screwless mounting.

It took a lot of trial and error to get the cantilevers working with the right stiffness and those silly mounting studs to be of the right shape/length and sizes.  The latches handles are still too flimsy, but the latches are deep enough that they are locked.


Here is a picture of one the the early mechanical fit test.  They are a bit claustrophobic as the two bays barely missed the other.  The printed part was stiff enough for bracing the cut panels, so I didn't have to look for additional supports.


There are too many places I could mount the drive bay as portions of the bottom case have raised shaped for added mechanical strength.  I have to use piece of FR4 to raise the mounts. This is actually the second  mounting spot as it left just enough clearance for a 15mm fan.   It reminds me of the Simpson diagram of carving a Puffer fish.


This is what my new drive bays look like.  There is enough clearance of 28.5 cm for a long GPU.  This leaves just enough space for my new GPU (in my other PC). B580LE : 272 mm x 115 mm x 45 mm


Top drive bay shows how much space the 3.3" HDD would take up before the modification.  The clearance of old drive bays was so bad that it would interfere with even the shorter GPU I have.  There isn't a whole lot I can do for really long GPU in this tradition PC case.  My newer case has the PSU on the bottom and cleared up space to the edge of the case, so it can take really long GPU that have broken the PCIe mechanical specs.

Now I can add/replace HDD and the connectors  as they are easily accessible from the side of the case. 


Now I just need to order a 120mm x 15mm fan.

Files at my github 3D page.

Monday, August 11, 2025

Dockstar cooling mod

Doctstar relies on natural convection for cooling.  It has cooling vents on the sides and a "chimney" of vents at the top. Both it and the docked HDD can get quite warm if left running for a while.

I have designed a forced air cooling system.  A small 40mm x7 cooling fan is used to draw exhaust air from 3 vents at the left, right and the chimney. The air exits at the back side of the HDD.

The air vent draws air from the front part of the case near the CPU and its DDR memory.


Here are the result after idling at 30.4C room temperature for 20 minutes.

Temperature is taken with an IR thermometer after running idle for 20 minutes at room temperature of 30.4C.  

The 3D printed design is made of 2 parts that can be glued together.  The part holding the fan acts as a lid that is glued onto the vent.  The 40mm x 7 fan is friction fit to the assembly.  There are 2 flat surfaces - one along the top part of the cradle and one that make contacts with the top of the case.   I used 3M VHB tape on them to attach the assembly to the Dockstar.

The 5V fan wires is routed through the air duct  and spliced to the USB connector for power.  I have also modified the case to bring out the 3V TTL serial port from the 2mm headers.

My USB HDD case is a bit smaller than the Seagate one. I have designed an insert for the cradle that sits next to the serial port.  There is a slot that allows for reflection of the light from the HDD status LED. 



USB driver status LED

Files are upload to my github 3D project directory.


Sunday, September 1, 2024

Charger adapter for Xbox 360 battery pack

 

The battery charger in the Xbox 360 controller isn't exactly robust.  From time to time it would stop charging the NiMH battery pack.  This is a quick and dirty hack for a temporary charger that helps to charge the battery pack so that it can resume normal charging again.

I made this adapter from a 2 cell screw driver charge cradle.  Ironically there are no fancy electronics for charge termination.  The charger uses a small transformer and rectifier diodes without filter capacitor.  I would not recommend leaving the battery pack on the cradle for more than a few hours.

Charging indicator

I added a charging indicator.   The output voltage is a tad bit high for my liking. The negative terminal of the battery pack has a silicon diode in series for a bit of voltage drop and as a way to detect charge current. During charging, the transistor monitors the voltage drop across a silicon diode and turns on the high efficiency green LED.



I measured the dimensions of the cradle and the battery case using a slide caliper and 3D printed their counterparts using PLA+.  The cradle contacts are small strips of iron that was used to crimp the mesh bag for my onions.  The battery contact was dremel out from old ISA slot with 0.1" pitch. 
`
The small PCB is soldered to the contacts and sit directly over it.

Metal strips from onion bags are used as
the contacts  for the drill cradle


The previous version was hand made from an old dental floss case and through hole parts

Files are released on github

Thursday, August 8, 2024

3D Printer Light Strip

I made a light strip for my 3D printer using parts I have lying around.  It uses a LDR for sensing the ambient light level and turns on.  It also shuts itself off for over-night print job when all other lights are off.

LED test - powered from a bench supply

The light strip consists of 3 PCB and a few 3D printed parts.



I used pieces of 12V LED strips soldered onto a PCB.   The strips are wired in series so that they would operate at 24V.


The 2 light strip PCB are assembled into the 2 PCB holder pieces with channels in the middle for wiring.  The are joint to a T shaped piece in the middle. The 2 side PCB are wired in parallel.  A 100K resistor (R9) has been added in parallel to the LED strips as the LED are sensitive enough to turns on through the 2200K feedback resistor.

The LED lightbar assembly is attached to the base with a M3 screw and a captured nut.  This forms an adjustable arm.


Here is the LTSpice simulation I used for the optional LED sensor.  The 2 comparators operates as a windows detector.  The lower threshold determines when the light turns on while the upper threshold is when all the lights are off.

As the LDR (R4) has a wide dynamic range, I have decided to inject the hysteresis at the reference by a positive feedback resistor R6.  It is driven from the MOSFET output which added a 180 degrees phase shift.  A capacitor C1 is added to suppress the oscillation during the on/off transitions.

V2 is used for simulating the LDR sensor by sweeping the range of voltages.


Blue trace: Comparator input
Green Trace: LED strip voltage

The following are the schematic and layout of the sensor.


The circuit  board is fasten to the  printed housing with double sided silicon adhesive tape.  The power switch is snapped into the opening in the front.   The circuit is powered from the internal 24V power supply located at the base of the printer just like the official lightbar. There is a connector for the 24V.


I used a heatshrink tubing to block off light entering to the sensor from the sides.


I routed the wires next to the one used by  filament sensor into the extruded aluminum frame on the left side.


This is a special one off design as the resistor values are empirically determined by the ambient light at my specific location and the electrical characteristics of the LDR I am using.  

I could have used trimpots for the thresholds.  The light sensor could have been implemented using a microcontroller like my Timer project.



Wednesday, May 8, 2024

CH32V Development with Visual Studio Code/Platform IO: Set up and first impression

Prerequisite:

  • Buy the WCH LinkE Emulation Debugger Module from the usual places from China for less than $5.  You won't even get to the bootstrap loader on the CH32V003 without one as there are no hardware bootstrap pins.  For higher end chips, the bootloader can download from USB using WCHISPTool.



Don't be temped by the cheaper older WCH Link module.  It is powered by CH549 (8051 core with 60K FLASH/2K RAM) It is not useful here but good for hacking it into CMSIS-DAP.

LinkE module is the one you want to get.  Powered by CH32V305 with 128K FLASH/32K RAM.  It supports for the low pin count parts that uses a single wire debug interface e.g. CH32V003 and newer chips e.g. CH32X035. 
  • Download: WCH-Link Local Burning Tool: WCH-LinkUtility.ZIP from this page.  It'll also install a COM port driver.

Select WCH-LinkRV mode, hit Set.  The blue LED turns off.  This is now the default mode.
Hit Refresh, it now shows up as RISC-V Link.

 
Note: 
    1. "Enable SDI Printf" option allows you to send debug messages on a virtual serial port piggy back on the SDI debugger interface (i.e. Semihosting). This is useful for low pin count parts. The support functions are described inside debug.h  See: https://www.cnblogs.com/liaigu/p/17628184.html  (use Chrome for translation)
    2. WCH-LinkDAP-WINUSB mode is for debugging with CH32F (Arm) series.  
    3. You can flash a new firmware and turning LinkE into a high-speed JTAG bridge similar to CH347 for DSP/FPGA using WCHLinkEJtagUpdTool.ZIP.  You'll need to re-flash the LinkE firmware to switch back.

Install IDE

  • Optional: Change PlatformIO Install Directory to path other than under your Windows user profile directory.  
Reference: https://community.platformio.org/t/vscode-install-directory/12325/2
Setting the PLATFORMIO_CORE_DIR pointing to my folder where the policies allow execution solves the issue. I set this value inside the standard Windows uservariables and then after this run the normal package installation process within VSCode.

Under Windows Advance User Setting/Environment Variable/User variable.  The highlighted path is where you want it.


Use Take Ownership on the directory if it is under "program files" to allow for write permission there.


  •  Optional: Change default project directory

See https://community.platformio.org/t/how-to-change-default-new-project-location/2828/18 

Hit the terminal icon on bottom to bring up this terminal.  For some reasons, this one works properly.

Type in the following and your directory path.  Add quotes around the path if there are any spaces.

pio settings set projects_dir  your_directory_path


PlatformIO.ini

There is a nasty surprise in the system_ch32v00x.c file. This is part of the startup code that is provided and set the SYSCLK prior to passing control to main(). 


The problem is that the default setting is for an external crystal connected to PA1 and PA2 pins.  If that assumption is incorrect, the 'RCC_HSERDY' bit will never be set. Their code doesn't handle the error properly.  Personally I prefer not having these hidden setting things up if I have to fix and handle the fail conditions.


If you don't want to edit the "system_ch32v00x.c" file, you can add a build_flags entries in the platformio.ini to add a compiler #define value.   You can use any of the listed options (line #20 - #25). I added the following:

build_flags = -D SYSCLK_FREQ_24MHZ_HSI

Creating a New Project


  • Select Platform IO on the side bar (Ant Icon), hit "Create New Project".  Give it a name.
  • Select "Generic CH32V003F4P6 (W.CH)" if you are using your own design or "CH32V003F4P6-EVT-R0 (W.CH)" for the eval board.
  • There is choice for "Noneos-SDK" for bare metal or "Arduino" platform.  The Ch32V003 part is too small for other RTOS platforms.


My bare metal Blinky.  It toggles at 2MHz.

The debugger allows for the either source code level view or assembly, but not both.  The peripheral register  are shown grouped in fields and can be shown/modified when the program is paused or in single step.

Assembly language view but it doesn't have the source code reference like the other IDE I have used.

Some of the things I like about modern IDE over basic text editors.


It shows the macro definition, what it expands to and the enum values when you mouse over it.


Popup on mouse over function
 with doxygen comment - WCH HAL function

Update:

Other Links

https://github.com/gicking/CH32V003_examples - Port of original CH32V003 examples by WCH for PlatformIO.