Addendum: Of course any mention of building your own transistors would be remiss if it didn’t mention hacker-savant Jeri Ellsworth. She did an amazing job fabricating her own semiconductor devices, and in this video from Metalab, explains some of the basics.
November 17, 2009 | Amateur Radio | By: Mark VandeWettering
While listening to the “This Week In Amateur Radio” podcast this morning, I heard reference to a new record setting non-line-of-sight one way contact that took place over optical wavelengths. A sucessful transmission over a distance of 288 kilometers was achieved by using an LED based transmitter. The report (PDF) provides many interesting details, such as their use of a GPS locked sound card to permit received signals to be resolved to just a milliHertz or so. Nice!
Here is some video of the transmitter in action. The floodlight that you see is generated by an array of 60 Luxeon LEDs, collimated by Fresnel lenses. Each LED is about 3.3 watts. Pretty cool.
November 14, 2009 | Amateur Radio | By: Mark VandeWettering
Back in 2008, I blogged about a stupid program I wrote to implement a Morse Beacon on the Arduino. I couldn’t find that code, and it was stupid anyway, so I went ahead and implemented a new version, with an added improvement: it doesn’t hardcode dots and dashes, it has a built in table. Right now, the message is hardcoded into the program, but in the future, I’ll probably work up a trivial command language so you can change the message and speed, and store the message in the on-chip eprom. On the other hand, doing it by modifying the program source code isn’t really very much harder than getting a terminal to talk to your Arduino (it might even be easier) so this still might be the best way.
Basically, this just puts a logic high state on output pin #13 whenever the keydown should occur, and low when it is released. My Arduino is one of the older ones, so I needed to put an LED in myself, but I understand more modern ones have a built in LED. You could use whatever output pin you like though, with the obvious modification. To turn it into a full fledged keyer, you just need a transistor to handle the switching. On this model of Arduino, pin 13 has a 1K resistor in series to current limit, so you should just be able to put in any NPN transistor (base in pin 13, emitter to ground) and then use the collector/emitter to key the transmitter (I might also think about using an optoisolator, just to be safe).
This is overkill in a lot of ways: the program, sloppily as it is written only takes about 1/7 of the memory on my Arduino, and modern ones have double the space. We could do the same with a very small Atmel. But Arduinos are available and versatile, and have considerable potential. Worth playing with.
//
// Simple Arduino Morse Beacon
// Written by Mark VandeWettering K6HX
// Email: k6hx@arrl.net
//
// This code is so trivial that I'm releasing it completely without
// restrictions. If you find it useful, it would be nice if you dropped
// me an email, maybe plugged my blog @ https://brainwagon.org or included
// a brief acknowledgement in whatever derivative you create, but that's
// just a courtesy. Feel free to do whatever.
//
struct t_mtab { char c, pat; } ;
struct t_mtab morsetab[] = {
{'.', 106},
{',', 115},
{'?', 76},
{'/', 41},
{'A', 6},
{'B', 17},
{'C', 21},
{'D', 9},
{'E', 2},
{'F', 20},
{'G', 11},
{'H', 16},
{'I', 4},
{'J', 30},
{'K', 13},
{'L', 18},
{'M', 7},
{'N', 5},
{'O', 15},
{'P', 22},
{'Q', 27},
{'R', 10},
{'S', 8},
{'T', 3},
{'U', 12},
{'V', 24},
{'W', 14},
{'X', 25},
{'Y', 29},
{'Z', 19},
{'1', 62},
{'2', 60},
{'3', 56},
{'4', 48},
{'5', 32},
{'6', 33},
{'7', 35},
{'8', 39},
{'9', 47},
{'0', 63}
} ;
#define N_MORSE (sizeof(morsetab)/sizeof(morsetab[0]))
#define SPEED (12)
#define DOTLEN (1200/SPEED)
#define DASHLEN (3*(1200/SPEED))
int LEDpin = 13 ;
void
dash()
{
digitalWrite(LEDpin, HIGH) ;
delay(DASHLEN);
digitalWrite(LEDpin, LOW) ;
delay(DOTLEN) ;
}
void
dit()
{
digitalWrite(LEDpin, HIGH) ;
delay(DOTLEN);
digitalWrite(LEDpin, LOW) ;
delay(DOTLEN);
}
void
send(char c)
{
int i ;
if (c == ' ') {
Serial.print(c) ;
delay(7*DOTLEN) ;
return ;
}
for (i=0; i<N_MORSE; i++) {
if (morsetab[i].c == c) {
unsigned char p = morsetab[i].pat ;
Serial.print(morsetab[i].c) ;
while (p != 1) {
if (p & 1)
dash() ;
else
dit() ;
p = p / 2 ;
}
delay(2*DOTLEN) ;
return ;
}
}
/* if we drop off the end, then we send a space */
Serial.print("?") ;
}
void
sendmsg(char *str)
{
while (*str)
send(*str++) ;
Serial.println("");
}
void setup() {
pinMode(LEDpin, OUTPUT) ;
Serial.begin(9600) ;
Serial.println("Simple Arduino Morse Beacon v0.0") ;
Serial.println("Written by Mark VandeWettering <k6hx@arrl.net>") ;
Serial.println("Check out my blog @ https://brainwagon.org") ;
Serial.println("") ;
}
void loop() {
sendmsg("K6HX/B CM87") ;
delay(3000) ;
}
Addendum:
Addendum2:
Josh asked me how the morse code table works. It’s a little bit clever (a very little bit) but I guess it does require some explanation. Morse code characters are all length six or less, and each element is either a dot or a dash, so it would seem that we can store the pattern in six bits. Let’s say that dits are zero and dahs are one. Lets store them so the first element gets stored in the least significant bit, and the next in the second most, and so on. The only trick is knowing when there are no elements left, because otherwise we can’t tell (for example) K (-.-) from C (-.-.) To do that, we store a single extra one after all the other elements are taken care of. Then, when we are looping, we do the following. If the pattern is equal to one, we are done (that’s our guard bit). If not, we look at the least significant digit. If it is a zero, we have a dit, if we have a one, it’s a dah. We then get rid of that element (by dividing by two, or shifting right if that floats your boat) and repeat. Voila. Each character takes only a single byte to store its pattern, and decoding is just done in a few instructions.
Hope that helps.
Addendum3: Well, I couldn’t leave that alone, witness this…
There are many examples that people use to output sound, most of which seem to bang an output pin high or low, call delay to wait a given number of microseconds, then change its state. This seems odd to me, because the Arduino has some pretty good pulse width modulation. This can be used to make higher quality sound, but for me, it also proved to be easier. I just configured pin 9 to be an output pin, and then used analogWrite(9, 128) to turn on the sound, and analogWrite(9, 0) to turn the sound off. That’s it! You get about a 500hz tone, and it works really well.
November 12, 2009 | Amateur Radio | By: Mark VandeWettering
Just flipping around the web tonight, found another interesting MEPT (Manned Experimental Propagation Transmitter) project that uses solar power an a small Atmel AVR processor. Very neat.
November 10, 2009 | General | By: Mark VandeWettering
I was wandering the net at random, following various links, and ended up researching a rather interesting integrated circuit that I’ve used before: an LM3909 LED flasher chip. It’s an interesting chip which can flash a regular LED with a 2v voltage drop using only a single 1.5v battery. I used to have this breadboarded up on my bookshelf ages ago, and it would flash for months using a single AA cell, and probably for years using a D cell. The problem is that this chip is kind of hard to find these days, and when you can find them, you end up paying $5 each. What’s cool is that someone actually worked out the circuit from the databook and drew up a completely discrete version.
November 9, 2009 | Link of the Day | By: Mark VandeWettering
Just saving this link after someone reminded me that I could use a decent cheap stereo microscope for some of my electronics assembly work. These seem very reasonably priced.
Well, I’ve tinkered around a bit more, and discovered a few things: the camera doesn’t actually do very much to align images. In fact, there is a fairly significant vertical misalignment between the two camera (I’m guessing around the order of a dozen pixels) which doesn’t really hurt things too bad, but which annoy me as the perfectionist stereo practitioner I’m being paid to be. 🙂
In yesterday’s article, I used exiftool to extract left and right images, which works just fine. I just composited the two images directly together, which resulted in a substantial amount of parallax over most of the image (the image was entirely behind the screen, and there was significant disparity). We can shift the images’ relative position by hand to reduce this overall disparity, and move the objects closer to the real screen, which makes the images easier to view and fuse. I decided to give this a try using GIMP, and basically constructed the anaglyph below using the following steps.
Extract left images and right images from the MPO file as yesterday.
run “gimp l.jpg r.jpg”
I like the traditional anaglyphs, so I converted each image to BW, then back to color to produce gray scales of both images.
I then added a new layer atop each image. For the left image, I filled that layer with a solid red. For the right image, I filled it with a cyan layer.
Select the “Screen” layer mode for both of the new layers. This should let you see both a red colored and cyan colored image.
Use “Merge down” to convert each layer into a single layer.
I then copied the red layer, and used “Paste into” to put it on top of the blue layer.
Change the new layer mode to “Multiply”. Voila! You have an anaglyph. You can use the shift tool (while wearing anaglyph glasses if you like) to adjust and align the layers as you see fit.
Crop and export!
In the photo below, Luigi’s eyes should be roughly at screen depth, so his front bumper will appear modestly in front of screen. I probably could still be a bit better on the vertical alignment, but it’s not bad.
Today we got an interesting new toy in the lab, a Fujifilm Finepix Real 3D W1. It’s a very cute little camera which you can think of as being the modern day equivalent of the old Nimslo 3D cameras. It has two lenses, and can acquire both 3D and regular 2D images, which it displays on a built in 3D lenticular display on the back of the camera.
But that’s not that much fun, you’d have to pass the camera around, and let’s face it, the display is pretty small. Fuji is supposed to have a digital picture frame which can display these images in 3D, and is also supposedly going to have a service bureau so you can get lenticular prints made, but again, that’s not much fun, at least not today. So, instead, I decided to see what I could learn about the image formats that it uses.
For still imagery, it writes both a .JPG and a .MPO. The JPGs are just standard JPG images, and can be read by pretty much anything. The MPO files are Multi Picture Objects, which are a format that I hadn’t seen before. Digging around a bit, I found out that (with some complications) they are mostly just two concatenated JPG images. Most JPEG readers seem to open and read the first image (which I believe to be the right lens image) without any difficulty, so if you weren’t interested in the stereo image, you could pretty much just treat them like JPGS (although iPhoto doesn’t even try to notice them, and refuses to try to open them).
A little more digging revealed that there is a tool called exiftool which can be used to extract the images. After you install exiftool, you can run:
to extract the left and right image. If you have ImageMagick installed, you can create a red/blue anaglyph with a command like:
composite -stereo L.jpg R.jpg stereo.jpg
Here’s an example that is just an image that I shot as a test:
I also did a bit of experimentation with video. It appears that it records an AVI file with two different video streams and one audio stream. I did some quick tests using mplayer to dump frames of each video stream into separate directories, combining them with composite, and then making a video back out of the resulting frames. It worked, but the example footage was terrible, and I could work on improving the results, so I’ll hold off on that example for now.
Overall, it’s a pretty neat little gadget, but I must admit you can buy a much better camera for the $600 price tag that it costs. It’s neat not just for what it can do, but because it demonstrates some of the capabilities that I think cameras of the future will have.
November 2, 2009 | Amateur Radio | By: Mark VandeWettering
I was trying to remember where I had seen this excellent online book, and finally found the link that lead me to it. Archived here for posterity. Frank tries to never buy radios, but literally build his entire station. This isn’t to save money, it’s to foster an understanding of how things work in a way that a single individual can master. It’s a great way to think about amateur radio. Check it out, lots good inside.
November 1, 2009 | Amateur Radio | By: Mark VandeWettering
I’m interested in short vertical antennas, so I keep collecting links to interesting article. K6MM has a nice description of his work with a 25 foot tall HWV antenna for 160M, built from three segments of PVC pipe, a capacitance “top hat” and 8 ground radials.
October 30, 2009 | Movie Review | By: Mark VandeWettering
Tonight’s movie screening at work was Michael Jackson’s This is It, essentially a concert movie starring the recently deceased King of Pop, Michael Jackson as he prepared for his first tour in a decade. Unfortunately the preparations for this tour were for naught when he died (under somewhat mysterious circumstances) on June 25th, 2009.
Jackson was controversial figure: his odd obsessions, fascination with plastic surgery, allegations of sexual abuse, his family, his marriage, his children, and even his death were all played out in the media. But whatever you think of these controversies, he definitely was an enormous talent who had a profound effect on the world of popular music, video, and dance.
This is It is basically a collection of footage from rehearsals in preparation for Jackson’s final tour. There is no attempt to vilify him, nor especially to venerate him, except perhaps in recognition of his extraordinary (even unique) talent. And there is plenty of talent evident in this footage. It’s very well done, and very well edited, and gives us a glimpse into the tour that wasn’t.
October 30, 2009 | Link of the Day | By: Mark VandeWettering
I’m mostly resistant to nostalgia when it comes to computing. Let’s face it, the iPhone has way more impressive capabilities than the desktop machines I was using just a few years ago. But occasionally I do want to take a step back and revisit those heady days of yesteryear, when I would sit in a half cube in front of a TVI912 or an ADM3a and write programs for the VAX 11/750 we had at Oregon.
When I feel that way, I fire up an old PDP-10 simulator that I have, and try to remember what it was like to run TOPS-10 on the DEC 1091 that we had at the University of Oregon. And it just doesn’t seem right to be typing on a modern terminal: you short of want that crude look of those ancient terminals with the glowing green phosphor. Luckily, you can get a font which emulates that look. Check out:
It seems like complete overkill to me to use a $30 microcontroller to do this task though. A couple of different groups have created PICs and the like which can be used to do the same, with a total cost of well under $10 (the chips are probably around $2 or so a piece). I keep thinking that what I should do is code up a simple version of this kind of application in ATMEL AVR assembly code and make it available. I can envision a simple web based application that would enable you to enter a list of beacon messages you want, and then hit a button and download the necessary firmware, all assembled and ready to go. Just burn and go…
I think the idea of calling this “computerless” is a teensy bit misleading: he does use a PIC microcontroller to generate the necessary modulations. A PIC is still a computer, at least in my book.
I’m Mark VandeWettering, former senior technical director for Pixar Animation Studios, and (for the moment I’m a husband and father and grandfather. I like telescope making, radio, and all sorts of other things.
Latest Comments
I recall burning three or four weeks of a sabbatical getting Saccade.com on the air with Wordpress. So much tweaking…
I move my pretty useless blog to Hugo about 7 years ago, since I got frustrated at too many security…
Something I used to good effect for a while was a "Pocketmod". You take a single page, fold it a…
Bloat is a serious problem, to be sure, but I'm not aware of many modern programming languages that avoid it.…
I'm running static pages (Notepad++) and a couple instances of Wordpress, and an instance of dokuwiki, all on ubuntu on…
I recall burning three or four weeks of a sabbatical getting Saccade.com on the air with Wordpress. So much tweaking…