HOWTO


small.jpg

I have been playing around with some wifi networking lately, mostly with the La Fonera, and finally decided to build a directional wifi antenna. Although the cantenna, however, I don’t really like Pringles chips and wanted to make something more interesting. I decided to try and make a simple Yagi antenna with a magnetic dipole as the driving element.

From a construction standpoint, the Yagi antenna is made by spacing conducting rods along the directionality axis with a driving element near one end. It is assumed that the incoming radiation is a TEM plane wave, so the direction of the electric field component should be parallel to the conducting rod orientation. The magnetic component is then perpendicular to the rods and to the directionality of the antenna. The rods spacing is then configured so that the coupled EM field generates a magnetic field component (and a curling electric field component) along the directionality axis of the antenna which has constructive interference at the driving loop. Proper spacing then determines the antenna’s gain and directionality in the band of interest (2.4-2.5GHz).

As a first step, I decided to reproduce the Yagi design made available by Andrew Hakman who reproduced the dimensions of a commercial antenna. This first implementation will test the basic operation and is still missing fine tuning and optimization. I am pretty happy with the initial results which demonstrate a 10dBi gain, which is pretty nice given that it took roughly half an hour to assemble. I will use a more precise construction technique (EGX-300 to mill the main beam) and will work out the optimal metal rod length to magnetic dipole ratio. The main idea is that the loop length needs to support one of the resonant transmission modes for the given frequency while the rods should be as long as possible to increase gain, but shorter than the length of the loop. If anyone wants more info on Yagi theory of operation, please post a comment and I will try to write up a post about it.

To construct this, I used a 0.5×0.5 inch piece of wood for the main beam, and 0.125 inch zinc rods for the conductors. I cut the rods to match the lengths in the above design and sanded the ends to remove any pointy spots. I measured out the positions for the rods on a piece of tape and used a small drill press to make the holes. I then gently tapped the rods into place and removed the tape. I cut the loop out of a sheet of bronze, mainly because that is what I had around. It is better to use a strip (versus a round wire) here to make the loop more sensitive to magnetic field components along the directionality axis. Finally, I decided to minimize transmission losses and mounted a USB 802.11g adapter directly onto the loop. I hot-glued everything into place and went to a large set of windows to test out the contraption.

To benchmark the devices performance, I compared signal strengths to the internal wifi adapter on my Lenovo T60. The signal strengths for the same APs were comparable between the internal adapter and the intact USB adapter so any improvement that I saw here was likely due to the Yagi. Although it was sometimes challenging to find the right direction to point the Yagi, I noted a substantial increase in signal power when I switched Netstumbler between the internal and external wifi adapters.  Over all, I consider this to be a success since I got better performance from the USB adapter by investing a few dollars and a hour of my time. The next version will be forthcoming in the next weeks and will hopefully display even better performance.

0531081229a.jpg 0531081319a.jpg 0531081302.jpg

0531081329.jpg 0531081335a.jpg 0531081341.jpg

0531081350.jpg 0531081351a.jpg 0531081406a.jpg

0531081411.jpg 0531081430.jpg 0531081431.jpg

netstumbler-comparison1.jpg

del.icio.us | digg

ic_on_three_pennies.jpg

With tax-day approaching for those living in the U.S.A., my thoughts sometimes wander and I think about all of the paperwork that I have to file. I have been reading about the stimulus package and wondering exactly what kind of hoops I would have to jump through to get my $600. Luckily the only thing that I need to do is to file my 2007 taxes to receive this small cash allowance.

Now for some more complicated tax preparation. Throughout my tax-paying career, I have always found that an itemized deduction (versus standard deduction) increased my tax return at the expense of an hour or two extra preparation time. This works especially well for students as they generally near the low end of the income spectrum. Another benefit for tax-paying students is the Hope and Lifetime Learning Credit which can sometimes reduce your adjusted gross income (what is taxable) quite favorably. Unlike the stimulus package, the required forms will include a 1040A (slightly longer than 1040EZ), a schedule A itemized deduction form, and a form 8863 for the Hope/Lifetime Credit. Now it is true that you don’t need to include proof of deductible spending with these forms, however, it is a good idea to have this paperwork on hand or easily accessible should the IRS contact you for clarification (something that has happened to me).

As a final crazy and illegal method to maximize your tax return, you could cash your check and obtain vast quantities of pennies. As of August 2006, the estimated production cost for a U.S. penny was actually 0.014USD. Since then, the prices of both copper and zinc have increased so the potential to make money has increased. This is not to say that the U.S. Mint has ignored these factors, a press release which followed by the above NY Times article states that there are already regulations in place to make melting of coins and export (certain quantities) illegal. I wonder if they also included a restriction on electrochemical stripping?

( Image is from Sci-Toys. )

del.icio.us | digg

translate.jpg

I have found a FireFox addon that essentially allows one to highlight the text to be translated, right-click,  and see a preview of the translated text. One more click opens a tab with the full Google translation of the text. Thank you, Pau Tomàs, for making my life a little bit easier!

( gTranslate addon )

del.icio.us | digg

fonera.jpg

For what it is worth, the La Fonera is still one of the better deals on basic embedded systems on the internet. I have looked at it before and shelved it for quite some time until I needed it again for a prank (open wifi, http redirection, etc). The available documentation, at the time of writing, is a bit spotty but one can gather enough information to build and test firmware based on the OpenWRT project. This guide will hopefully illustrate the complete process from the very start to actually running the custom firmware.

(more…)

del.icio.us | digg

psp-tv.jpg

NOTE: This is essentially a modification of this setup except I am using a Sixaxis controller and displaying the PSP on a LCD TV.

I have previously mentioned my intention to add an external controller to a PSP, however, I have become quite fond of it and do not want to make it any less portable by adding extra wires and a PS2 controller decoder. If only there was a way that I could control the PSP with an external controller, all through software, without the need for hardware tampering. Furthermore, it would be nice if this method was wireless. Unfortunately, the only method that I have found involves illegal modification of the PSP firmware. I am against software piracy and typically uphold license agreements, however, I also would like to be able to occasionally play my PSP on the living room TV using a standard controller. Sony, if you are reading this, please add this feature to the firm ware, I mean, you already patented it.

As I mentioned, these steps involve putting modified firmware on the PSP which is probably against one or more sections of the license agreement, may be illegal, kills puppies, and may render your PSP useless. You will have to figure out how to load custom firmware on your own. You will also need ir shell.

At this point, the computer that will be connected to the PSP (over USB or Wifi) will need a joystick controller. Anything that the OS recognizes will probably do, however, I used a PS3 Sixaxis with Windows XP. The instructions to get the Sixaxis to work with XP are found here. One addition I would make is that it seems that the ps3sixaxis_en.exe file needs to be run once, and the PS button pressed once, every time the Sixaxis is connected to the PCs USB port.

The usbhostfs and nethostfs packages must now be downloaded to the target PC to facilitate the keypad redirection. The two packages are in the form of zip archives and can be extracted to the same directory. First, you can run joytest.exe to make sure that the PC can see that you are pressing buttons on the Sixaxis. If it does not, you can try pressing the PS button (all while the controller is connected to the USB port). Once the controller is identified, you can run the joymap.exe command to create a key map file for the Sixaxis controller. The syntax I used was ‘joymap 0 ps3.map’ where 0 denoted that I want to use joystick 0 and ps3.map was the output filename. Both analog and digital direction pads must be mapped to joysticks. Be careful where EXIT is mapped as it will end the game you are playing and return you to the shell. Finally, nethostfs must be run to listen for a connection from the PSP and control the keypad. The syntax I used was ‘nethostfs -s -l pass123 -1 ps3.map’ where the -s told it to redirect the keypad, the -l pass123 set the authentication password to pass123, and the -1 ps3.map mapped the first joystick using the previously created map.

Finally, we can configure the PSP. Once ir shell is booted on the PSP, we run the configuration/setup on the bottom row. The important things to change are to enable keypad redirection to nethostfs, to set the nethostfs AP to the ip address of the machine with the Sixaxis, and to set the nethostfs password. This is assuming that the default ports are used. We can now test the setup by initiating nethostfs on the main ir shell screen and verifying that we can move the cursor around using the Sixaxis. The last steps is to enable the TV output on the PSP by holding down the left trigger and the right directional pad and then to start up the game UMD from the ir shell screen.

At this point, one of the limitations is that the TV-out, through ir shell, does not scale to the whole screen properly and that I am using the wifi connection in infrastructure mode. The result of the first limitation is that the video screen does not take up the whole LCD screen on the TV while the result of the second limitation is a little bit of latency in the controls. The second issue may be lightened by using Ad Hoc mode between the PC and PSP or using a USB cable and usbhostfs (instead of nethostfs) all together.

At this point, I doubt that I will ever complete the PS2 controller to PSP interface that I previously mentioned since this works well enough and I am finding that playing the games on the PSP is not so bad. I have some of the basic interface codes worked out under LabView and may eventually end up putting a PS2 controller on some other device. Enjoy!

( YouTube video )

del.icio.us | digg

bar-lock_view_as_seen_when_writing_om.jpg

After reading reviews of some technical documents which I have written, I could not help but feel as though my undergraduate curriculum in computer engineering had been a bit light on skills related to technical writing. I don’t think that I am alone here given that many of what are considered top engineering textbooks are so poorly written. The purpose of technical writing is to convey information in a clear, accurate and concise manner, however, basic errors still tend to make it into final book revisions. If we look at the following two sentences, the difference is just a single comma, but the meaning is totally different.

The data register is sent to the cross-bar before it is cleared. (Cross-bar is cleared.)

The data register is sent to the cross bar, before it is cleared. (Data register is cleared.)

I have started to remedy this situation by looking at a couple of books on grammar and English usage and trying to apply all of my mental utility to grasp the concepts. (As usual, here are a few PDFs to help with grammar and usage.) Hopefully we can all improve our writing a small amount and try to avoid mistakes such as the one that follows.

[Professor] Nelson admitted to smoking marijuana cigarettes soon after police arrived there, the complaint says. Police reported that they confiscated a number of items, including bags with marijuana and rolling papers. (reference)

( sp7084.pdf ) ( breviary_of_english_usage.pdf )

The image above is from the Early Office Museum.

del.icio.us | digg

hotplate-small.jpg

What to do when you need to mount a ball-grid array (BGA) package on a circuit board without sophisticated equipment? One popular option is to create something called a “reflow oven” which is able to control your circuit boards temperature with respect to time. The idea behind reflow soldering is that we may want to apply a thin layer of solder paste (solder with flux) over the exposed pads on a printed circuit board, then place all of the surface-mount components on that side, and then heat the board so the solder melts and the components become electrically attached. This is pretty much the only method for attaching components whose pads are completely on the underside making them inaccessible to soldering irons. The temperature profile is fairly standardized (here, here and here) and consists of first removing any excess moisture from the packages, then ramping up to the temperature required to melt the solder, then to cool off in a safe manner that prevents component or joint damage. It should be noted that these temperature profiles aim to limit the time components spend at elevated temperatures (>250C) to minimize the risk of damage due to heat.

What I am proposing is something much simpler: lets use a hot  plate to heat the PCB and achieve the same sort of reflow process. The main disadvantage is that the process is much less controlled and the dimensions of the board must be small enough to fit on the hotplate. The primary benefits are its simplicity. I am fortunate enough to have a hotplate which has a thermocouple to the surface and can measure the surface temperature with some degree of proficiency, so an alternate method will be required for other types. Some kind of infra-red measurement method would probably work well.

The idea is that we first apply solder paste to the board, when necessary. In this example, I am mounting a MICROSMD8 package where there is ample solder on the board and the chip to achieve connection. It is often a good idea to put some clean-free flux on the board in any case. Everything is first pre-heated for ten minutes at 50-80C to get rid of some of the moisture. The assembly is then heated to about 230C. At this point, the chips should already be aligned over the target pads. The reason for this temperature is that unlike the oven, the top surface of the PCB is exposed to air and thereby creates a thermal gradient. We need to control the heat on the top surface so that the solder just barely melts. This can be noted when watching the PCB under a microscope or with a magnifying glass as the solder will become very shiny when it melts.  As the solder melts on the chips and PCB, the surface tension will pull the chip into alignment. The whole assembly can then be slowly cooled and tested electrically. When populating larger projects, it is best to put on the larger chips first and then place something to act as a heat-sink on top. I have had success with larger DSP chips where I placed inverted bolts on top to radiate away some of their heat while adjusting other components. Finally, don’t forget that a cold PCB looks the same as a hot one, so be sure to avoid burning yourself.

hotplate1.jpg hotplate2.jpg hotplate3.jpg

hotplate4.jpg hotplate5.jpg hotplate6.jpg

( an081.pdf ) ( an353.pdf ) ( xapp427.pdf )

del.icio.us | digg

pspice-model.jpg

Last week, I wrote an entry where I  pointed out some methods to aid with getting your SPICE simulation to converge and made a promise that I would write a guide that would go through all the necessary steps to create a simulation with a non-standard device. Luckily, the fine folks at Texas Instruments have already written such a guide. The guide is designed to work with the Orcad/Cadence suite and guides the user through all the steps, starting with downloading a SPICE model from ti.com to changing the appearance of the schematic symbol to creating a simulation profile and running the simulation. Although this is geared towards Texas Instruments, the ideas are generic enough to apply to practically any vendor’s models.

del.icio.us | digg

manhattan.jpg

For me, speed of construction is the ultimate goal for prototyping circuits. This often involves perforated prototyping boards with components and wires flowing everywhere giving an impression of a clump of hair. It got the job done, however, it was increasingly difficult to troubleshoot with each additional kludge and even harder to have somebody else understand the board. Even if they had the schematics. Some time ago I was pointed to an excellent article by K7Q0 describing Manhattan Building Techniques. The style involves taking a copper clad board and gluing smaller pieces of copper clad board to it to mount components on. Techniques are discussed to make this mounts for single point connectors to more complicated dual in-line connectors. The overall result is that the circuit looks much cleaner and is easier to diagnose. A secondary benefit is that the circuit typically includes a ground plane and the possibility of power planes for reduced noise. The chief downside is that the prototype board takes longer to produce, however, this may well be justified.

( manart.pdf )

del.icio.us | digg

broken-keyboard.jpg

For one reason or another, both of the shift keys suddenly stopped working on June’s VAIO notebook. After some troubleshooting it seemed to be a hardware problem. With work needing to be done, I didn’t want to open the machine up and risk breaking more things so I thought that it would be easiest to remap the shift key to the caps lock key, one that shouldn’t be used too often. While it is straightforward to change this on a Unix/Linux system (xmodmap, loadkeys, etc), it turns out that there is also a straightforward method to do this on Windows. This requires editing the registry, however, the Windows Resource Kit has a nice graphical front-end to do this.  The installed tool is called remapkey.exe and has a drag and drop configuration screen. Long story short, the caps lock key is now the shift key, and everything is fine until tomorrow.

del.icio.us | digg

Next Page »