Ever since I've started using Linux I've been obsessed with doing custom routers and trying to cram as much functionality in the less amount of space possible. 'Space' so far being hard drive space, so I set out to build me a new router to substitute the old P5-233 Dell that was working as my firewall. Like pretty much every other hardware project I've done, planning was absent in the process as I prefer to do things Mc Guiver-style and surprise myself.
Step 1: Let the games begin!
I usually try to spend as little money as possible in projects, as such you can always find a good amount of "spare parts" in boxes in my garage. I already had a single board computer that was removed from a controller box, probably used in manufacturing. The power requirements were a bit troublesome for a SBC, but scavenging around found a power supply from a text terminal that would match the board perfectly (in terms of voltages at least).
Step 2: Giving it a body
Show All 7 Items
The computer turned on ok and seems to be in working order. I left it on a few hours to make sure the power supply would not overheat. With that out of the way it was time to build a case. While looking for a power supply I came across a damaged APC UPS and noticed it's dimensions matched that of the computer and power supply. So I set out to gut out the UPS and try to fit the components inside it. It was a rather simple although tiresome process of bending, ripping and filing plastic. One hour later the motherboard and the power supply were mounted in the case.
Step 3: The operating system
I already use Linux for desktops, severs and router, so it was the obvious choice. I installed Debian Etch in a hard disk, but I wasn't able to make it fit anyway inside the case. I didn't had a spare laptop hard drive in hand but did have a compact flash memory and IDE adapter from a previous project. The CF memory was a bit small (256 MB) to fit a standard install so googling around a bit found Vadim Berkgaut's Debian router distribution. It's a stripped down Debian sarge install generated using debootstrap, a custom kernel and supporting scripts. Once installed in a CF the distribution copies itself to a ramdisk during boot, this means that it works fast, won't wear down the flash device and can be turned off without shutting it down. As it is a standard Debian distribution it can use natives packages (.deb) and the packages handling system (dpkg, apt) so it can be expanded and modified later on. Changes can them be written to flash with a simple command or just reboot to go back to the previous state. All in all an excellent piece of work.
Step 4: Finishing it up
With most of it done, I cut out a piece of cardboard to avoid any part of the power supply and motherboard from shorting each other out. Since this motherboard didn't had a network adapter, I figured I could plug a USB hub and a couple of USB network adapters. I routed the USB port to the outside where the phone line surge protection plug was.
Step 5: Updates
During the process of writing this instructable a couple of things came up: The whole things was heating up too much, having WIFI capabilities would be awesome, a power led would be useful :). Having a working system I set out to improve some things about it. Adding a power led was just a matter or removing if from the front panel of another computer and gluing it to the place where the original power led was located. I also removed the power switch as I didn't want to keep cutting extra hole in the case and I could just pull the plug as this system tolerates that just fine. To lower the temperature of the system was just a matter of cutting some extra pieces of plastic from the original vent and adding a small fan, the fan already had a motherboard style power connector, so wiring it was a snap. Before the fan, the system was running at 60 degrees Celsius, triggering the temperature alarm of the motherboard, now the temperature reads a much cooler 48 degrees.
Step 6: WiFi!
Show All 11 Items
Wireless networking has become pretty much like Google, I can't remember how life was without it. Since this board didn't had a network connection much less a PCMCIA or a mini-PCI slot, an USB WiFi adapter was my only choice. Getting an USB card in the remaining space was a bit of a challenge. The card is question is a Belkin F5D6050U, old, ugly, poor performer, but it was all I had. Proceeded to strip it to the bare minimum, and upon closer inspection realized I could de solder the antennas and solder a new pigtail for an external antenna for improved performance. The pigtail donor was a failed project which in turn got it from a damaged Senao radio. The TNC connector fitted perfectly where the original power button of the UPS was located. Added a second USB cable for the card, and enclosed it in case of a DAT DDS tape.
Step 7: The final product
The whole thing is just L12"xW8"xH3", weights just over 2 pounds and fits inside a laptop bag nicely. The CPU is a Celeron 366 Mhz, but since it is a Medocino core with L2 cache has fairly good power and with 256MB of RAM, the system boots up and works very fast. For connectivity an USB NIC works just fine, I thought about fitting the USB NIC inside the case and making simple RJ45-Keystone dongle, but having the USB port externally available proved better when I wanted to copy a file from a Pen drive. At the beginning I just wanted a small linux router, at the end I got a case-mod-embedded-portable-stealth router-access-point what more could a computer geek ask for? Hmmm... maybe installing TinyX, Fluxbox and an USB sound card and expand it as a portable desktop too :)
Step 8: More updates! - Power outlets
Show All 8 Items
Since posting the article I've got a lot of mail and some pretty good suggestions, so I went ahead at implemented some. Because of space constraints the power outlets of the ups had to be remove, however upon closer inspection it seemed possible to create just enough space to accommodate two or three power outlets.
Since now we are talking about moving 120 volts just next to low voltage DC parts I though I would be safer to go with UL electrical grade parts. Once again going to thru the recycle bin found another dead UPS and removed, a set of the power plugs. These were not going to work as the power connectors run horizontally and the slots on the UPS-PC ran vertically. So I had to forget about UL compliance and stuff, and just hack together anything that could moved current from one place to another. Another visit later to the computer cemetery produced a Y power splitter. This would work as the end parts could be mounted flush inside the UPS. To allow for greater cable flexibility the outer jacked was removed and as much of the plastic was removed from the "face" of the plugs. Got them glued to the plastic, aligned with the slots and connected to the power plug of the UPS in parallel fashion, green to green (ground), white to white (neutral) and black to black (line). Next, to add a permanent network card.
Step 9: More updates! - Network, USB and multimedia ports.
Show All 25 Items
The other recommendation that I though could be implemented was the addition of a network card. At first I didn't add this because I knew it meant having to get an USB hub inside the case and with so many interconnections (PC -> USB header -> USB cable -> USB hub -> USB cable -> Network card) which could cause a voltage drop and the insides of the case were already crammed enough. The solution was to eliminate as many cables and connections as possible and wire everything together. So first up the 4-port USB hub, dismantled it, and de soldered 3 of the female USB-A connectors. One would be used for the network card, two would be made into external ports, the other would remain internal for future expansion (maybe a sound card). Next the network card, dismantled it and de soldered the USB-A male port and soldered 4 cables directly from the USB hub to the USB network card, finally glued the card and the hub together. Then prepared a network extension cable by taking a length of network cable (about 6") cimped a male RJ-45 connector on one end (for the network card) and put a female RJ-45 on the other side. Glued the female RJ-45 connector to the motherboard and cut out and access slot in the "front" of the UPS the same shape as the connector. In the future the male RJ-45 could be eliminated and the cable soldered directly to the network card to get a better electrical connection.
To make the headers for the other two USB ports was just a matter of de soldering them from and old board like the modem shown and solder them back to the USB hub. After the headers were soldered, took a small board with 2 external USB port and 2 jack ports from another computers front panel. Connected the external ports to the USB hub headers, and placed the external ports in the opening previously used for the other USB connector. Again liberal use of hot glue was required, as this part receives some torque when plugging or removing USB devices and cables. Close everything up and the UPS-PC now has a permanent network adapter, two external USB port, 2 functional power slots and provisions to add multimedia capabilities in the future.