Monday, December 22, 2008

eeePC 901 Antenna Mod

Well, after the treachery of exams and then the confusing transition into vacation I finally think it's time to update! Well, I've done quite a lot: everything seems ready for the final version of the 3D whiteboard along with the construction of the 3D display. Furthermore everything is in motion to begin the fusion device first semester of the next academic year (damn you Darryl for leaving to Singapore!). But, in the realm of the actual rather than the theoretical, I have modded my eeePC 901 to support external antennas (for only $20).


I love my eeePC, it has changed the way I work. I carry it around with me everywhere scarcely ever noticing its weight allowing me to do work almost anywhere! It's powerful enough for testing, enough hard drive space for my tools, runs of my simulation and even some music. The only downside when I first got it: the antennas weren't powerful enough to pick up those elusive wifi signals. Although, after cracking the magic device open I found that the internal antennas were hooked up using U.FL connection. And so the hacking began!

[picture of wireless module to come in very near future]

Above you can see the actual wifi module from the expansion bay (this is the removable region in the center of the bottom of the laptop). This led me to buy a U.FL to RP-SMA cabel from hyperlinktech (http://www.hyperlinktech.com/item.aspx?id=1123) as seen below:





I chose RP-SMA for the outside connection because I already had an RP SMA antenna from an old router and it seems to be the most popular kind (so getting new antennas shouldn't be too much of a problem). I also bought a 9dB 2.4GHz antenna from the same store. 2.4GHz is the frequency of wireless internet (802.11a/b/n). In order to make everything fit into the eee, I had to sand the stopper almost all the way down until it looks like:



In order to make this hack a nice clean one, I decided to completely gut out the computer so I could put everything back where I wanted to. There are MANY screws so make sure to keep everything organized. I normally take a sheet of paper and put the screws on different parts of it while marking in marker where those screws should be (and how many of them I took out!). I also took out the screen because I was going to machine the hole, but I later realized it was easy enough to do at home. Here's a beauty shot of everything dismantled:



I decided to have the RP SMA connection come out of the "lock" region of the case (right behind the eth0 port). So, I had to make sure that the wire didn't block or bend the motherboard (scary thought! one crack and you have transformed your eeepc into a nice paper weight!). So, I drilled the hole for the connection making sure that it's center was .5mm below the stand of the motherboard (circled in red). To make the hole i used a standard dremel tool outfitted with a 1/8" drill bit.




With that completed I snaked the wire underneath where the motherboard sits. I now plugged the cable to the wifi module, unplugging one of the internal antennas (I recommend doing this before remounting everything as it takes a good amount of force. I even detached the wifi module to make sure there'd be no damage to the motherboard). Once everything is hooked up, it should look like this:





This has been a tremendous gain! The 3dB antenna fits nicely in the carrying case (and so does the eee even with the added width) and the 9dB fits nicely in my backpack. Below is a comparison between only internal antennas, external mod without any antenna and finally external mod with 3dB antenna using `iwlist wifi0 scanning`


#before
fiber@mercury:~$ cat wireless.before
Cell 01 - Address: 00:1E:58:40:6D:8F
ESSID:"telepathy"
Mode:Managed
Channel:11
Quality:100/100 Signal level:-31 dBm Noise level:-81 dBm
#after without antenna
fiber@mercury:~$ cat wireless.afternoext
Cell 01 - Address: 00:1E:58:40:6D:8F
ESSID:"telepathy"
Mode:Managed
Channel:11
Quality:65/100 Signal level:-64 dBm Noise level:-81 dBm
#after with 3dB antenna
fiber@mercury:~$ cat wireless.after3db
Cell 01 - Address: 00:1E:58:40:6D:8F
ESSID:"telepathy"
Mode:Managed
Channel:11
Quality:100/100 Signal level:-29 dBm Noise level:-81 dBm


30% gain with a cheap antenna I just had lying around. I'll post some stats on the 9dB antenna once I am in a controllable enough area (ie: home). Remember, dBm work on the log base 10 scale, so every unit change in dB is a factor of 10 change in strength.

So tell me how this mod works for you or if there are any points that I didn't clearly explain! Happy Hacking!

Tuesday, November 18, 2008

new project

Well, it's taking longer than I expected for the parts for my most recent project to come in. I'm waiting for some wireless pigtails (U.FL to RP-SMA) so that my EEE PC has an external antenna (an easy hack, but one I haven't seen any documentation online for).

In the meantime, here's an old video I made a while ago playing with non-Newtonian fluids. This is really easy to make (just saturate water with corn starch) and very fun! Non-Newtonian fluids are fluids whose viscosity is dependant on the applied strain. So, the strain from the speaker constantly hitting the fluid causes it to become much more viscous to the point of appearing solid. This causes all sorts of fun! In this video I played a 100hz sin wave through the speaker. I did this later as a demonstration at the Dragon Academy and I have to say it was a great success, I recommend it for any teachers or demonstrators. Hope everyone enjoys!


Tuesday, November 4, 2008

obama fever

OBAMA WON! Truly a day to remember. So, in the spirit of science funding not being slashed to death I am going to release one of my first python scripts that downloads all images off of the NASA Astronomy Picture of the Day (apod).

I tried keeping the code commented so that it could also serve as a good learning tool. One thing I'd like to include is some way of saving the description of the image. This could be done by saving it into a text file with the same filename as the image, but I suspect there is a better way (using ImageMagick to embed the information?). If you have an idea or preference, post a comment! So, here it goes:


#!/bin/env python
#
# Copyright 2008 Michael Gorelick
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see:
# http://www.gnu.org/licenses/gpl.html.

import re, urllib, sys, os

### Check/Do Help
help = """NASA Image Getter - Michael G. (GPL 2008)
./%s [-h] [imagepath]
imagepath - path to save images
-h, --help - this help"""%sys.argv[0]

if "-h" in sys.argv or "--help" in sys.argv:
exit(help)
elif len(sys.argv) == 1:
print "Not enough program arguments"
exit(help)

### CONFIG
allowedChars = '[-a-zA-Z0-9*:\'.,&!?\(\)//\n"+;_ ]'
allowedFiles = '[jpg|jpeg|png|gif|mov|avi|mpeg|mpg]'
url = "http://antwrp.gsfc.nasa.gov/apod/archivepix.html"
pbarwidth = 80
try:
imagePath = sys.argv[1]
os.makedirs(imagePath)
except Exception, e:
#errno == 17 means the directory already exists.
if e.errno != 17:
exit(e)
print "Saving images to %s"%imagePath

##############################################
## This section looks for links to image pages
print "Searching for image pages in", url
html = urllib.urlopen(url).read()
pagePattern = re.compile('([0-9]{6}).html">(' + allowedChars + '*)')
pages = pagePattern.findall(html)
totalpages = len(pages)
print "Found", totalpages, "image pages."

#############################################
## Now we go to the pages and extract a list
## of images and download
try:
alreadyHave = open(imagePath + "/tracker.log").readlines()
except IOError, e:
alreadyHave = ""
totalhave = len(alreadyHave)
try:
tracker = open(imagePath + "/tracker.log", 'a+')
except IOError, e:
exit(e)

base = url[0:url.rfind('/')]
imagePattern = re.compile('<a href="image/(' + allowedChars + '*.' + \
allowedFiles + ')"', re.IGNORECASE)
sanitizePattern = re.compile('[//\n\r\t]')
imageGet = urllib.URLopener()

for i, page in enumerate(pages):
try:
if page[0]+"\n" not in alreadyHave:
#Extract information from image page
title = sanitizePattern.sub("", page[1])
currentpage = base + "/ap" + page[0] + ".html"
print "Getting " + title
content = urllib.urlopen(currentpage).read()
image = imagePattern.findall(content)

#Parse data
filename = imagePath + "/" + (title + \
image[0][image[0].rfind('.'):]).replace(" ","_")
print "\tFilename: " + filename
url = base + "/image/" + image[0]
print "\tURL: " + url

print "\n[" + "="*(pbarwidth*(i-totalhave)/(totalpages-totalhave)) \
+"@"+"="*(pbarwidth*(i-totalpages)/(totalhave-totalpages)-1)+"]",
sys.stdout.flush()

#Download
imageGet.retrieve(url, filename)
tracker.write(page[0] + "\n")

print "\r" + " "*(pbarwidth+2),"\r",
sys.stdout.flush()
except IndexError, e:
print "\tImage not found\n"
except IOError, e:
print "\t404 Error\n"

tracker.close()
print "Done"

Monday, November 3, 2008

Distractions

Well, exams are finally done but I am still contending with all the work I had to put off. In the works is a post on the topic of conscience and the release of my mac remote code. For now, I will distract everyone with an old youtube video of mine: exploding flint (well, actually ferrocium)



The video pretty much explains itself. It is a nice little demo on the properties of ferrocium. In the end, this stability (or lack thereof) is why it proves to be so useful in lighters. Enjoy!

Sunday, October 26, 2008

failed telescope night

So, after a while spent getting my telescope aligned (and, of course, staring at M41 and M42 for a while), the clouds came in before I could get the camera ready. When I was done cursing the clouds and the cold I had been sitting in, I decided to take pictures of Toronto to gauge the camera.

I was using my 8" Celestron (f#=10, focal length=2032 mm). It's a great telescope although it takes a magical touch to get aligned.

This is the main picture of interest: the symbol of BMO on top of First Canadian Place (which is 2580m away from my balcony). From my calculations, the symbol is 6m tall which means I'm capturing about .1332° or 2.32e-3rad of the sky! (I got this number by doing [; 2\cdot tan^{-1}(\frac{6/2}{2580}) ;])



By the way, the picture of the moon I took before was with my astroscan (f#=4.1, focal length=445cm). It's a great telescope to bring around and it's really quick to get set up and start observing, although the optics aren't that great which leads to a lot of artifacts. Also, I like the tactility that comes with manually aiming the beast.

While I was first testing the camera I took the following picture from 37m away:
Since my camera is 9.5cm tall and it takes up 46.1% of the height and 34.6% of the width of the image we can get... (5.563e-3, 7.413e-3)radians = (.318,.424)degrees=(height,width) degrees!

So, if we take the differences in f# into account, both measurements agree! *phew*, well at least now I can say tonight wasn't a waste.

Saturday, October 25, 2008

oscilloscope!

So, I was at active surplus (with trusted, albeit slightly slow, sidekick Darryl) looking for parts for the fusor or the 3D display when I ran into this amazing old school oscilloscope. After quickly brainstorming some reason I could justify buying this beautiful piece of science equipment (or history depending on your view) I got it! The justification is actually quite good: instead of buying a Geiger counter, we can use activated aluminum and a charged plate (neutron hits the aluminum, shoots of an electron which gets captured by the plate which turns into a signal that the oscilloscope can see) to verify fusion is happening.

Anyways, here's a little video of the piece in action: hooked up to my speakers playing Roads by Portishead. Sorry about the video quality... also the cameras refresh rate doesn't do justice to the display.



As for the fusor route, we are going to get florescent transformers (~20,000V at a couple miliamps) for power, and hopefully e-bay will have the correct vacuum pump (it's hard to find ones that go down to 5microns). As for the vacuum container... we might just have to get one custom made. This is one piece that I don't really want to try building myself since it's the only part of the project that could seriously maim us.

Oh, and stay tuned... tomorrow I'm going to post a video I did a while ago about getting a cool explosion using ferrocium which you can get out of a common lighter!

Friday, October 24, 2008

panoramas

So, a little bit ago I got a new camera (well, I guess it's no longer new) so I thought, since I couldn't afford any great lenses, I'd get acquainted with good post-processing. First thing to attend to was mending a mosaic of pictures together into one seamless picture. So, bellow is my evolution in trying to get a good panorama:

Balcony View:
This one didn't look too bad. I was lucky that lighting conditions didn't change too much as I took all the photos.


Night Panorama:
I was rushed. As a result I didn't get enough pictures to get good perspective. Also, you can see the lighting conditions changed drastically as I took the pictures.


Dawn Panorama:
That's not change, that's more of the same! I took these pictures fast enough to have some resemblance to homogeneous lighting, even though it's homogeneously dark.


Toronto Through a fishbowl:
This one turned out great! I took more than enough pictures and did it quickly. You can see a few artifacts from mending (check the train tracks), but all in all it turned out great. In fact, there are parts of the image that were cut out of all the photos that I had to reconstruct completely using photoshop (special prize to whoever can guess where). If you want to see a full resolution (17mb, 5989x4058) version, go here.


Sunset:
So, I was doing work and I look out the window and I see a rainbow AND the moon. So, I quickly try to get as many pictures as I can for a panorama. Didn't turn out exactly how I wanted, but it is still quite cool!


For all these images, I loaded them into photoshop and used the automated function "photomerge". Once the images were merged I blended the edges and applied any sort of photoshop magic I could to make the image seem smooth. This was hard in some cases (ie: in the last image, sunrise, you can see a drastic color change in the sky).

These skills are actually quite useful for many things, especially the telescope camera. I used basically the same technique to make the moon picture from the telescope camera (although I probably should have used a more stack oriented program... that's what the future is for!).

So, feel free to download all these images, just remember they are all licenced under the Creative Commons (Attribution-Noncommercial-Share Alike 2.5 Canada).