Archive for the ‘Projects’ Category

Steve commented on my last post about how much better the CD player would be if the front buttons worked (thanks a bunch Steve, you suggested me a pile of work there!), and that joy2key and a cheap joystick would do this.

Sounds simple, so I grabbed a cheap joystick (a Genius MaxFire G-08XU), upgraded to Kubuntu (I was on an old version of Fedora, and decided it was time for a change), and off I went. Very early on, I found that this was not a common and well explained solution, so I thought I would explain how I got it to work…

First of all, a few thoughts on Kubuntu. It rocks. Doing an install, it just works (mostly), and it was easier than the last Windows install I did, because I didn’t have to go hunting for a million driver disks and set them up. Plus the fact that Kubuntu (or linux in general) comes with a nice batch of applications is good too, you don’t have to go hunting all over the net for that useful app you use to do x, you already have it.

So, following Steve’s suggestion, I downloaded joy2key. After a little initial confusion because Kubuntu does not have the joystick in the same place as joy2key was looking, I got joy2key to recognise the joystick and the button presses. The problem was I couldn’t manage to get it to talk to Amarok (the default media player). I was concerned that if I did manage to string it together, it would be held together with string, and wouldn’t just work. I needed to be able to just hit reset if the box crashed & have it come back up and playing.

So I found several other similar programs. All of these either had problems compiling (I think because of dependency problems beyond my abilities) or problems just working. I noticed a common feature of these utilities is that they did not seem to be being updated. This was worrisome to me, as I could see the hassles in getting them to work getting worse as they got older.

Just when I was about to give up, I found that Amarok has a plugin which does exactly what I need. It allows you to assign basic player commands to a joystick. I downloaded & installed it from within Amarok (only one new package required!), and it just works – assign the buttons and off you go. Sweet.

From there the process was simple, pull the joystick apart, and wire the buttons to the remaining ones on the CD player case (which were mostly still in place). It was a pretty simple job, and I kept it simpler by sticking to three buttons – pause/play, next track & back 30 seconds (back to start gave problems on the “all tracks random” playlist we run) – I couldn’t think of any other feature which would be useful.

The keyboard is still around, but is put out of sight, when we come home, all we have to do is hit the pause button to resume playing. If a song comes up we don’t like, fast forward. It just works. Excluding all of the time messing around failing to get various joystick to keyboard applications to work, it was a pretty fast process.

And before someone suggests it, no, I am not going to make a remote control for it, ok.

Oh, and while I was at it I swapped in a new HD, and found a great little IDE to USB adapter. Plug in the power brick, and you have a 100Gb USB drive. No nice case, so no use to carry around, but it will work well as a backup drive, and the adapter will come in useful to recover from any dead machines in the future.

On moving in with Susanne, I faced a minor problem. The purple cube that was holding my VIA Mini ITX PC blended in very well with what could be described as a bachelor’s apartment, but there was some resistance to its prominent placement in the new house. Given that I had burned all of my CDs to MP3 and decided that I quite liked never having to change the CD, this was a bit of a challenge. The computer obviously had to be located in close proximity with the stereo equipment, but blend in with it.

Serendipitously, at about the same time Susanne asked me if I could have a look at her CD player, as it was broken. I had a look at it, and confirmed that it was broken, and more importantly, it was beyond my abilities to repair & probably not worth paying someone competent to work on it.

At this point, I had the perfect case. Put the computer in the old CD player case, which by definition was suitable to put in the lounge. Now because I had only just moved in, I decided that I had better check whether it was ok if I trashed the CD player first, and got the green light!

First order was to pull everything out of the case & salvage anything which looked like it might be useful at a later point, leaving an empty shell.

As with my previous machine, I decided for simplicity and improved airflow, I would keep the back of the case open. Yes, this does mean that I need to be careful plugging & unplugging cables, as the motherboard is unprotected, but this happened infrequently enough that I decided that it would not be a problem. Yes it is ugly, but no it is not anywhere you look at with any frequency.

There is quite a lot of space in the case, but when I upgraded to a full size DVD burner, rather than the laptop size CD burner which was in there previously, things got a bit tight, and the layout needed to be adjusted.

The motherboard is mounted on standoffs, which unfortunately have to be different heights. When drilling these, do yourself a favour and use a slightly bigger drill than the screws need. That way you will have a little slack in case your marking was not 100% accurate.

The hard drive would not quite fit any other way so got mounted on its side at an angle. Not exactly asthetically pleasing, but it works. The hard drive is just screwed to the chassis using the normal mounting screws.

The only part which required special placement was the CD/DVD drive, which, as logic would dictate, was placed in front of the CD flap. As this was formerly a 5 CD cassette changer, there was a flap rather than a drawer to deal with. To allow me to open the CD flap to put a disk in, I needed to add a screw to the side to use as a handle. You also need to open the flap to reach the eject button for the CD. Not ideal, but it works.

So far so good. Now for the input device. If you are going to put a PC in your living room you need some flexibility with the input device. No matter how pretty or invisible the case, a great big beige keyboard attached by a cord is going to spoil the show. Wireless is the only way to go. The problem with this is almost every wireless keyboard about comes with a separate mouse. Perfect for getting lost. What I wanted was a keyboard with a trackpoint built in. Simple. Well, not so simple, but after much searching I found a no name keyboard fitting the bill. The only identifying marks are the model number – SK-7100. Best of all it was cheap. When the batteries get down, it is a bit erratic, but other than that it works very well. Ironically, the extra keys are not supported under windows, but are at least partially in Linux – in the Fedora keyboard setup, the model is listed.

It plugs into the standard mouse & keyboard plugs, and leads to a IR receiver with you put on top of your PC. Or pull it apart, shorten the cables, and glue inside the display of the case.

The CD case had a big ugly on/off switch which was not of the momentary type the motherboard wanted. That and the fact that while the button was at the front, the switch was at the back, made using the existing power button too difficult to be worth the effort. Instead I use two of the function buttons and with a little soldering and trace cutting, they now do the job. Unfortunately I can’t remember which is which most of the time, but if I am rebooting it, then something has gone wrong, so either one will work fine!

Externally, there is not a great deal indicating that the box is anything but an old CD player visible.

And when it is in place, it blends right in, just as required.

I set up the pause, play and fast forward buttons on the keyboard to work with the MP3 player (XMMS), so the majority of the time that is all that needs to be done. This is just as well, as the resolution on the TV is too blurry to be able to read any details, unless you know what the options are. It is easy enough to run a few apps to get things running again after a crash, but not good enough for much more. I go in using for maintenance, and when I need to use it.

I think it would be a good idea to set the thing up so that the play, pause & fast forward buttons on the face worked (though the serial port?), but I haven’t looked at this yet. Equally at this point you could use some unused functionality on one of the other remote controls with something like The other improvement would be for the mp3 player & VNC to start running as soon as it is booted. Then it could be playing again after a lockup with one button.

The only problem I have had is the stock fan started running very noisily, so I replaced it with one of the same size I bought from Radio Shack. This worked nice and quietly for several months, until it nice and quietly seized, resulting in a cooked CPU. The fan on the new motherboard is noisier than I would like, but I am loath to make any changes for fear of blowing the motherboard again – the machine stays on all of the time.

The specs of the box are:
Via M10000 Nehemiah
120 Gb HDD
Running Fedora Core.
NEC 16x Dual Layer DVD burner

There are a lot of PCB CAD programs out on the web, often linked to PCB manufacturing companies, but if you are just making a small one off board, these seem like using a sledge hammer as a stapler. Quite possibly a lot of fun, but probably not for all of the right reasons.

The technique I use focuses on simplicity and tools everyone has. The first step of course is to draw the layout, then etch it.

Because I am new at this, I use pen and paper to design the layout of the pcb. One of the most useful guidelines I have seen around the web is to keep all of the IC’s aligned the same way, especially keeping pin 1 in the same place – this one makes it much less likely to screw things up when you are putting it all together. Given the basic layout, it is now time to make the actual PCB mask.

To do this, I load this bmp template into the nearest painting program, such as MS Paint. The template has a regular grid with the same spacing as your components. Note the pads on the right side of the template. These are the pads to use for the components. Just copy and paste them where they need to be. Use the blue grids for your alignment.

A couple of hints.
1/ Use the biggest pads you can, but make sure they do not touch. Bigger pads mean easier soldering.
2/ The square pads at the bottom are for IC’s. The big round pads are too big, and touch when they are placed in adjacent grids.

For the traces, just draw a line between the pads. How big? Bigger is better, just make sure there is a reasonable amount of space between them.

When you have got all of the traces on and are happy that the layout is good, it is time to get rid of the blue grids. If your paint program has a global colour change, then set the blue to be white. If not, just scrub them out. Having a white spot in the center of the pads will make it easier to drill them, as it will act like a punch mark. The grid marks are unlikely to cause too many problems if you don’t scrub them, but will look messy.

Having done this, print it out so that the scale is correct. You might be able to do this by setting the dpi, or you might have a ‘print at x scale’ option, this might take a little messing about to get the size right the first time, but then just remember the settings.

If all has gone right, you will have a sheet with a design which looks like this:

This circuit controls the rear window defog in my MX5 (Miata), I didn’t feel like paying a few hundred dollars for one, but a heated glass window is really nice in the Minnesota winter. If you look carefully, you can see that the IC was put in with round pads rather than the square ones. This worked, but was a pain to solder.

Now all you have to do is etch the board. This is simple enough once you know how that we shouldn’t really post the information on the internet for fear that everyone will learn to do it. All you have to do is print the layout on a laser printer, and then iron it onto your board.

Really, that is it. There are a couple of gotchas, and some explanations, but not much.

1/ Give your pcb a polish first using some fine sandpaper or similar – we don’t want oil from finger marks messing up our work.
2/ Only a laser printer will work, not an inkjet. Laser printers put a plastic layer on the paper, which they then melt onto the paper, so when you iron it, it will melt again and stick to something else, like our pcb blank. Inkjets fire liquid ink onto the paper.
3/ What sort of paper? There is some debate on this on the net, with preferences for brands of expensive photo paper. I use whatever paper is in the printer. This is generally whatever is on sale when it is time to buy new paper. The reason the type of paper is not important is I do not peel the paper off, but now you are getting ahead of yourself.
4/ It doesn’t take long to iron the layout onto the pcb. I have a ceramic tile I use as a plate, and set the iron on full heat. A couple of minutes making sure that there are no cool spots, and you are good to go. Make sure you ask your wife/girlfriend if you can borrow her iron first. If she says no, don’t get caught.
5/ When the paper is stuck to the board, then just drop it in a bowl of water with some soap added and let it soak for a while. I generally give it 20 minutes or so, then just scrub the paper off using an old toothbrush (you do have one of those in your toolbox don’t you? If not, don’t use your wife/girlfriends). You can be pretty aggressive, the toner is stuck pretty solidly to the board. It is good to make sure you get the paper out from the middle of the pads, this will make it easier to drill.

When you scrub the paper off, you will have something which looks like this:

This board did not come out as well as usual, I think I got lazy with the amount of time I spent ironing it on. If you look carefully you might be able to see some gaps where the toner did not stick. No problems, borrow some nail polish (now you see why you didn’t use her toothbrush before) and touch them up:

Now you have a pcb ready for etching. Drop it in the ferric chloride, and wait. Make sure you read the instructions on this, it is pretty nasty stuff – just look what it does to your copper board & ask if you want it to do that to you. Once it comes out, use some fine sandpaper to sand off the toner, and you are ready to drill. It should look like this before and after sanding:

The drills you need are very small and as a result break really easily. You are best to use a drill press at the fastest speed it has and a vice. If you don’t have a drill press, use your dremel, if your drills are not the standard dremel diameter, you can pick up a chuck attachment like this, which will let you use most any size drills. As far as the pcb drills, anything you find at Home Depot is likely to be too big, and as they are very long, they break even more easily. Have a look around, you can buy surplus/refurbished drill bits relatively cheaply. You are likely to break them before they get blunt, especially if you don’t have a press, so I wouldn’t worry much about the quality. Always buy more than you need, because it is bloody annoying to get half way through drilling a board to break your last drill.

Voila, a finished pcb ready for assembly!

This method has a resolution of below 0.5 mm, so should be good enough for most projects.