ARISSAT-1 is off to a bumpy start…

August 3, 2011 | Amateur Radio, Amateur Satellite | By: Mark VandeWettering

First, the good news: ARISSAT-1 is floating free in space. I urge hams to listen for its 2m downlink on 145.950 to see if you can hear it. There is also a CW beacon on 145.919 and a special BPSK-1000 telemetry downlink on 145.920.

Now, the bad news. It appears that the UHF antenna was damaged or broken off at some time. The satellite was supposed to operate a 70cm->2m linear transponder, but without this antenna, it is unknown what the status of that capability will be (politely put, it’s almost certainly not going to work).

Okay, now the commentary:

It seemed rather obvious that the handling and deployment of the satellite was ill-conceived and poorly handled. You might imagine that some pre-EVA check of the satellite could have determined that the satellite was missing its antenna. You’d also imagine that the relative fragility of the solar cells (mentioned by one of the cosmonauts well into the EVA, after the satellite had been spun around and “contacted” all sorts of objects on the space shuttle) would have been part of a pre-mission briefing. Watching the video, it seemed that these cosmonauts were using all the care that a bunch of high school kids you hired to move your couch might have had. In the end, it appeared to me that they deployed the satellite simply because they couldn’t be bothered to stow it again as much as to achieve the goal of launching this amateur payload.

And lack of communication is one of the single most frustrating things I find about AMSAT. Surf on over to their website at arissat1.org and look for an update. It’s been two hours since deployment, and here is the only update in information that you can see:

Really? That’s all you have to say about the deployment? The culmination of four years of planning, building and testing, and it’s finally in space, and you can’t even file a report that contains any actual information?

I was curious about what the configuration of these antennas actually was. After finding a couple of broken links to the February 2010 design review, I found this page:

Design Review of ARISSAT-1

Lou McFadin, W5DID did a presentation on the antenna systems. It appears that the antennas were designed to be detachable and use a flange system similar to other antennas deployed on the ISS. There is a lot of detail missing from the presentation, but it seems to me that the obvious failure mode is simply forgetting to install the antennas rather than damage to them. The fact that the antenna situation was only detected once outside the ISS seemed very odd indeed. It should also be noted that one of the design goals was to be able to endure “rough handling”, which means that if the antenna were damaged, then one of its primary design goals was not adequately met.

Frustrating!

Oh well. I’ll be listening for telemetry on its first good pass, which appears to be a 38 degree pass after 1:00AM this morning. I’ll let you know what I find out. I’m monitoring a bunch of blogs to see if anyone is picking up telemetry, expect updates as addendums to this post later in the day.

A nice Flickr set of images from the NASA feed of the deployment

Addendum: It lives! Masa, JN1GKZ reported on the ARISSat-1 website that he heard the FM, CW and BPSK signals on 2m during its pass over Tokyo. It can run in “high power” mode when illuminated, the late night passes I will see tonight will be in eclipse: we’ll see how low power mode works.

Raymond Jimenez’s Amateur Nuclear Fusion

August 2, 2011 | Amateur Science | By: Mark VandeWettering

While looking up some references on amateur nuclear fusion (don’t ask!) I found that Raymond Jimenez had written a cute 40 page book on his own experiments with a Farnsworth Fusor. You can apparently order a dead tree version from Lulu for $12.50, but it’s also available as a free download.

Raymond Jimenez’s Storefront – Lulu.com

Best quote:

Deuterium is an easy gas to obtain. I submitted an order with Matheson Tri-Gas: a couple of phone calls and parental approval were all it took.

Decoding a quadrature encoder just isn’t that difficult

August 2, 2011 | Programming Languages | By: Mark VandeWettering

I was shown some truly horrifying code that reported to decode a quadrature shaft encoder. It was just mind bogglingly stupifying that someone would go to that much work to write something so utterly horrible. Here’s the way that I think of them.

A quadrature shaft encoder looks like a 2-bit Gray code counter. Instead of counting up in binary in the usual way, it goes up changing exactly one bit at a time. So, what are the four possibilities?

00
01
11
10
...repeats to 00

Let’s imagine that you had a previous reading for the shaft encoder, and now you notice that some new value can be read. The new value is another two bits. That makes the total of 16 possibilities. There are four 16 bit combinations that indicate a clockwise rotation, and four that indicate a counter clockwise rotation. The rest are “impossible” states, or states where the input didn’t change. You can
just write out the table.

OLD NEW CW  CCW
00  00  0   0 
00  01  1   0 
00  11  0   0 
00  10  0   1
01  00  0   1 
01  01  0   0
01  11  1   0 
01  10  0   0
11  00  0   0
11  01  0   1
11  11  0   0
11  10  1   0
10  00  1   0
10  01  0   0
10  11  0   1
10  10  0   0

You can convert this into code any of a number of ways: switch statements, table lookup, you could minimize the logical instructions using a Karnaugh map… whatever floats your boat. I’d probably just go with a switch statement, something that looks like this (assume OLD and NEW are integers holding the two 8 bit values):

[sourcecode lang=”c”]

int
cw(int o, int n)
{
switch (o) {
case 0:
return n == 1 ;
case 1:
return n == 3 ;
case 3:
return n == 2 ;
case 2:
return n == 0 ;
}
}

[/sourcecode]

And similarly for ccw.

It ain’t rocket science.

Addendum: It’s pretty easy to create the delta too (-1 if ccw, +1 if cw, else 0)

[sourcecode lang=”c”]

int
delta(int o, int n)
{
switch (o) {
case 0:
return (n == 1) – (n == 2) ;
case 1:
return (n == 3) – (n == 0) ;
case 3:
return (n == 2) – (n == 1) ;
case 2:
return (n == 0) – (n == 3) ;
}
}

[/sourcecode]

Clouds in a Glass of Beer Guinness

August 1, 2011 | Amateur Science | By: Mark VandeWettering

I subscribe to the Sixty Symbols YouTube channel which is produced by the University of Nottingham, and today, I noticed they had a new video on a subject near and dear to many a physicists heart: Guinness.



If you think that beer is beneath the interest of physics, you should surf on over to Amazon.com and check out Craig Bohren’s Clouds in a Glass of Beer. It is an excellent accessible book on atmospheric physics that examines (among other topics) the way that bubbles form in beer. It’s a creative, informative book that presumes no great knowledge of physics, but can help remove some of the many misconceptions we have surrounding atmospheric physics and weather.

Amazon.com: Clouds in a Glass of Beer: Simple Experiments in Atmospheric Physics

If that doesn’t satisfy your need for equations, you can try this rather beefier exposition, entitled Waves in Guinness.

Raspberry Pi $25 PC goes into alpha production

August 1, 2011 | Link of the Day | By: Mark VandeWettering

I’m interested in low cost computing. Like the kind of computing that costs what a Blu Ray disk costs. For a while, that’s been something like the Arduino, which has a 16Mhz 8 bit processor. But the Raspberry Pi is something else: a proposed computer which plugs into an HDMI port for display, uses USB for peripherals, and runs Linux. Best of all, the target price is $25. I hadn’t heard much about this project lately, but apparently some of the first alpha prototypes are being produced. I’m sure to get some of these when they finally go into production: I’ve got a couple of projects that could make good use of such an inexpensive computing platform. I’m keeping my eyes open on this one.

Raspberry Pi $25 PC goes into alpha production – Computer Chips & Hardware Technology | Geek.com.

On the Ham Nation podcast, or the perils of perpetual promotion.

July 29, 2011 | Amateur Radio | By: Mark VandeWettering

Ham Nation is a relatively new weekly podcast that is brought to us through the power of the TWIT network, Leo Laporte’s mighty podcast empire. Fellow blogger KE9V had some comments on it, some of which I agree with, and some of which I do not.

Of Dits and Bits | KE9V’s Ham Radio Blog.

First, the positives. Hosts Bob Heil and Gordon West are practically legends in the world of ham radio. Both are charming gentlemen, deeply concerned with promoting ham radio.

And in a strange sort of way, that’s what I find to be most disconcerting about the show. It tries really, really hard to convince you that ham radio is exciting and relevant. I do firmly believe it’s a great hobby. Or more precisely, it’s a bunch of great hobbies, all united under the need to get a license to operate. Some aspects of the hobby I like better than others. I can appreciate that other people might like aspects of the hobby that I do not. I can also appreciate that some people might want to promote the hobby.

But I can’t help but think that we overstep our promotion of ham radio sometimes. In trying to understand why I feel that way, I see two primary causes.

First, in our haste to bring new people into the hobby, we try to talk about ham radio in a way that the uninitiated can understand. That’s okay, but unless we are careful, we end up never talking about anything else. And frankly, I see that a lot in the first ten episodes of Ham Nation. Like KE9V, I haven’t seen that there is anything being presented in Ham Nation that anyone whose been in the hobby for more than a year will care about. In an effort to make the hobby understandable to the layman, we are stripping out everything interesting from our hobby. We are providing no inspiration to deeper achievement in ham radio. We perpetually talk about what equipment to buy, but never talk about the equipment we build. We promote simple wire antennas, without working to provide information on more complex and therefore higher performing antenna systems. And Ham Nation has this in spades. It’s not too surprising: Gordon West has made a career out of selling study aids for ham radio and getting new people into the hobby. But I can’t help but wish that there was a podcast that actually talked about ham radio in a way that at least periodically reached beyond how to solder and your first wire antenna.

Second, there is the idea that ham radio is unique among hobby in promoting virtue and intellectual development. Most hams are great people, but I believe that most people are great people. There are some really amazingly intelligent people in ham radio, but there are intelligent people in all walks of life, with all sorts of hobbies. I suspect that if your hobby was windsurfing, most of your fellow windsurfers would be good, intelligent people too. The difference is that windsurfers don’t spend a lot of time trying to convince you that windsurfers are really great people. They just accept that if you want to be a windsurfer, you’ll learn what you need to, and you’ll join a great group doing something they love. Hams want to convince you that they are a bunch of great guys, doing great stuff, but they seem to spend all their time talking about how great they are, and relatively little time showing you how great they are.

Ham Nation suffers from both of these ills.

It’s not enough to have celebrity hams. It’s not enough to tell everyone how great ham radio is and how much they will love it and how easy it is. You have to get on with doing ham radio, to demonstrate how cool you think it is, and let other people make up their own minds. When people like Kevin Rose express skepticism about the hobby, we shouldn’t tell him he is wrong: we should show him he is wrong. And we should accept that perhaps he isn’t wrong, at least for him.

It’s just a hobby after all.

On RC Filters…

July 29, 2011 | Amateur Radio, electronics | By: Mark VandeWettering

Over on the #savagecircuits IRC channel on irc.afternet.org, Atdiy was trying to decipher the mysteries of a mainstay of analog circuit design: the RC filter such as the one pictured on the right (diagram cribbed from Wikipedia) It dawned on me that (newbie as I am) I didn’t really have a clear understanding of them either, so I thought it would be worth the exercise to go through the mathematics of them as well, and try to derive the simple formulas from (more or less) first principles.

First of all, it’s interesting to just try to understand what happens at DC voltages. No current flows through the capacitor at DC, so the output voltage is just the input voltage (when measured as an open circuit, more on this later). If you are a total newbie like me, you can look at the capacitor symbol, and note that one side is not connected to the other (it’s an open circuit), so no current can flow across it (at least, at DC) frequencies. But at higher frequencies, we need to consider the behavior of the capacitor, which means that we need to consider impedance.

If you don’t grok complex numbers, the road ahead will be a tiny bit bumpy. I didn’t have enough brain power to write an intro to complex arithmetic, but if it’s new to you, consider reading up on it. For now, just remember that complex numbers can be manipulated like regular numbers (adding, multiplying,dividing and the like) but have different rules.

Rather than derive anything at this point, we’ll just cheat a tiny bit and introduce a formula to find the reactance of the capacitor. (You should not feel too uneasy at this point by introducing what seems like magic at this point. The following equation just describes how capacitors work. You probably accepted that resistors could be described by a single number (expressed in ohms). Because capacitors have more complicated behavior in AC circuits, they need a bit more complicated description, but not too much).

The capacitive reactance of the capacitor is given by:

[latex]X_C = \frac{1}{2 \pi f C}[/latex]

where [latex]f[/latex] is the frequency of operation, and [latex]C[/latex] is the capacitance in farads (be careful, not microfarads). For instance, a 1 nanofarad capacitor has a reactance of about 160 Ohms at 1Mhz.

I glossed over something a bit there. The reactance we computed is measured in ohms, which makes it seem like it’s a resistance. But in reality, it’s an impedance (usually written as the symbol [latex]Z[/latex]). Impedance is a measure of the opposition of a circuit to current, but it generalizes resistance by taking into account the frequency dependent behavior of capacitors and inductors. In particular, impedance varies with frequency.

You can split the impedance into the sum of two parts, the pure resistance (usually written as [latex]R[/latex]) and the reactance (usually written as [latex]X[/latex], as we did above when we were computing the reactance of the capacitor). The total reactance of a circuit is the inductive reactance minus the capacitive reactance. If the overall reactance is negative, the circuit looks like a capacitor. If the sum is positive, it looks like an inductor. If they precisely cancel, then the reactance disappears, and the circuit presents no opposition to current at all.

But how do we handle resistance? Here’s where the complex numbers come in.

[latex]Z = \sqrt{R^2 + X^2}[/latex]

[latex]X = X_L – X_C[/latex]

The nifty bit is that you can treat impedances exactly as if they were resistances (e.g. we can use Ohm’s law) just so long as we remember that we are dealing with complex quantities. I decided to write a small Python program which could be used to compute the filter responses of RC filters:

[sourcecode lang=”python”]
#!/usr/bin/env python
#
# Here is a program that works out how RC filters
# work. Here is a diagram of the prototypical
# RC low pass filter, sampled across a resistive
# load Rload.
#
# R
# Vin -> —/\/\/\/\—-+——–+ Vout
# | |
# | /
# | \
# C —– / Rload
# —– \
# | /
# | \
# | |
# —– —–
# — —
# – –

import math
import cmath

RLoad = 1e9
R = 600 #
C = 0.0000001 # .1uF

for f in range(10, 100000, 10):
XC = complex(0., -1/(2.0*math.pi*f*C))
Z = cmath.sqrt(XC*XC)
t = RLoad * Z / (RLoad + Z)
Vout = t / (R + t)
print f, 20.0 * math.log10(cmath.sqrt(Vout*Vout.conjugate()).real)
[/sourcecode]

If you take the data that gets printed out here and graph it, you get the following:

I built the same circuit in LTSpice just to check my understanding, and the graph appears identical. If you search through the data to find the place where the response drops to -3db, you find it occurs around 2650 Hz. The traditional formula for filter bandwidth is

[latex]F = \frac{1}{2 \pi R C}[/latex]

which when you plug in the values I chose, you end up with 2653.9 (which is pretty good agreement).

Addendum: This filter works best when the input impedance is very low (compared to the 600 ohms that we chose for the input resistor [latex]R[/latex]) and where the load impedance [latex]Rload[/latex] (here purely resistive, but it could also be complex) is high. If the load were low (Rload was comparable or less than than R) then the losses would be higher. (Ignore the capacitor. If Rload is small compared to R, then the voltage, even at DC, is already divided down to a lower value, this shifts the entire curve downward).

Addendum2: I wrote this hastily. If it doesn’t make sense, or people have suggestions, don’t hesitate to add them in the comments below.

Addendum3: Atdiy asked me to run some simulations showing how the load [latex]Rload[/latex] changes the output to demonstrate loss. Here, I kept [latex]R = 100[/latex], but varied [latex]Rload[/latex] from 1M ohms, to 1Kohms, and then down to just 100ohms. You can see the entire curve moves down, with only 100 ohms of load resistance, the voltage is -6db (multiplied by 0.25) even at DC).

Addendum4: Atidy has started her series on filter design, which includes a qualitative description of how these filters work that you might find easier to understand. Check it out here.
.

PDP-10/X on an FPGA

July 29, 2011 | Link of the Day | By: Mark VandeWettering

I think I saw this a couple of years ago, but Doug Conroy seems to have made some progress on his implementation of a PDP-10 on an FPGA. It now can apparently boot ITS. I’m more interested in the prospect of running TOPS-10 so I can relive my early days, but booting ITS is pretty awesome. Bookmarked for later retro-geek-hacking-envy:

PDP-10/X.

Hackaday Comment Policy: We’re cleaning up

July 27, 2011 | Blogging, Rants and Raves | By: Mark VandeWettering

I am a long time reader of Hack A Day. It’s a great website, and often details projects that I find interesting well before they are picked up on other sites. It also tends to drive significant amounts of traffic to sites mentioned, so it’s good publicity for many interesting objects.

But lately, their comment section has become a complete and utter cesspool. I’ve read hundreds of comments over the last few months which fall into predictable categories…

  • You’re stupid.
  • Your project is stupid.
  • Why didn’t you do X?
  • That isn’t a hack.
  • Your grammar/spelling is wrong.
  • That video is fake, nobody could do X.
  • Any of a number of racist, sexist, and idiotic comments which decorum prevents me from reproducing.

I don’t see any of these kinds of comments as helpful, useful, informative, or inspiring.

To their credit, it appears that the Hack A Day crew are beginning to realize that this kind of stuff does nothing to enhance their brand and are taking steps to correct this.

Hackaday Comment Policy; We’re cleaning up. – Hack a Day

My own blog policy is simple (and given the relatively low number of non-spam comments, pretty easy to implement): be nice. If your postings aren’t nice, then they aren’t going to stay. I can handle disagreements and dissent, but if you can’t do it in a civil way, you can post your comments on your own blog and link back to me. I won’t mind. My blog is like my virtual living room. I wouldn’t allow anyone to come in and act like a complete buffoon in my house, and I’m not going to pay for the web services that lets them do so in my virtual living room either.

And arguing that some kind of “free speech” should be the rule is not going to fly either. You are entitled to your own free speech, but I don’t have to pay for it or promote it. You are free to pursue your own free speech using your own resources, but you don’t get to volunteer mine.

Some people have asked that come kind of comment voting system (like that employed on Slashdot) could be employed. I’ll merely say that I don’t read Slashdot anymore precisely because gaming of their comment system has reduced its utility considerably. It’s never been clear to me that such systems can be engineered to even reduce, much less eliminate, the kinds of negative comment trolling that I’ve been seeing.

Here’s my advice: if you think that a particular project on Hack A Day (or brainwagon or any other site) is deficient in some way, then get off your duff, make a better project, and publish it. Lend your own expertise to the discussion, and help elevate everyone’s game. That’s what the web should be about.

Oh, and keep up the good work, Hack A Day.

How to mistake correlation and causality, from Scientific American

July 27, 2011 | Rants and Raves | By: Mark VandeWettering

My tweets this morning included a link to a story by Scientific American editor Anna Kuchment, entitled “How to raise a science fair champ”.

How to raise a science fair champ | Scientific American Blog Network

On the one hand, it’s a mildly interesting look at some talented kids who have risen to the top of the increasingly prestigious world of science fairs. But the thing that struck me was how it totally failed to deliver on the promise of the title. The story repeatedly mistakes correlation with causality.

Here’s the basic problem: Kuchment is looking at 15 finalists for the first Google science fair, and trying to determine what they have in common, and then implies that if you can do the same thing with your children, they could join the same kind of elite company as these 15. But that’s a serious mistake, and an incredibly persistent one.

Take for instance this:

Leaving stats aside, the top things finalists named as the foundation of their interest in science was having a family member who was interested in science and making trips to the local science museum.

That seems like an interesting fact, but it is actually not a fact, but just a story. There are plenty of people who aren’t science fair champs (or even interested in science at all) whose family members are interested in science and who take them to science museums. Kuchment is reasoning from the result back to the cause. If one is to actually learn something about what makes science fair champs, one needs to look not just at champions, but all the non-champions as well. And when you do that, I suspect that you’ll find thousands of candidates who have many or all of the distinguishing characteristics of the golden fifteen that Kuchment interviewed, save that they didn’t win science fairs.

As human beings, we are all interested in achievement. Mark Zuckerberg becomes Time Magazine’s Man of the Year because he was the brains behind Facebook. We idolize Steve Jobs because of the meteoric rise of Apple over the last decade. We like to read the stories of the rich and famous, because we hope that if we can just do what they did, that we could attain some small portion of the success that they have. But it is devilishly difficult to learn anything truly useful from the stories of the few, because we naturally don’t hear the stories of the many who did all the same things, but didn’t end up rich and famous.

No doubt that a lot of my current sensitivity to this kind of thinking is coming from the fact I’m currently reading Duncan Watt’s Everything is Obvious: *Once You Know the Answer. It’s an excellent book, and tries to shake our confidence in the common-sense reasoning that we all seem to rely on when we look at the world around us.

Unboxing the Digikey Monday Mash Prizes!

July 26, 2011 | Video | By: Mark VandeWettering

Digikey runs a Monday Mash puzzle every week on Monday. Last week, I entered and won! Huzzah! Here’s the video of me unboxing my prizes.



Thanks to Roy Eltham from the #savagecircuits IRC channel for urging me to enter, and condolences for him not winning.

Dave Richards, AA7EE constructs The WBR by N1BYT

July 26, 2011 | Amateur Radio | By: Mark VandeWettering

Thanks to Bill at the SolderSmoke blog for posting a link to Dave Richards’ construction project. He made a slick version of the Wheatstone Bridge Receiver, a regenerative variant created by N1BYT and published in More QRP Power. I’ve looked at this receiver before, and found the design to be pretty interesting, but Dave goes above and beyond by showing all the things my projects lack in great abundance: like neatness, care, and planning. Check it out:

The WBR – A Simple High Performance Regen Receiver for 40M by N1BYT « Dave Richards AA7EE.

The Kansas City Standard

July 22, 2011 | Amateur Radio, diy, electronics | By: Mark VandeWettering

I was pondering my laser transmitter the other day, and began to think of how I might transmit digital information from the Arduino to the remote receiver. Since I am old, I remember the old days where programs used to be stored on an obsolete audio storage medium called cassette tape. Indeed, the first storage device I ever used was the Atari 410 tape drive pictured on the right.

The Atari stored data at 600 baud, using FSK (data is stored as short bursts of two different tones, in the case of the Atari 3995 and 5327 hz), using a variant of the so-called Kansas City Standard. KCS was a standard for storing data on cassettes that was developed at a Byte magazine sponsored symposium in 1975.

Data is converted to short bursts of 1200Hz and 2400hz tones to represent zeroes and ones, respectively. Each burst is 1/300 of a second long, meaning that it sends 300 bits per second. Each 8 bit character is framed by a 0 start bit, and a pair of 1 stop bits so that character frames can be identified. It was designed to be a reliable if slow format, and succeeded on both counts. It transmits about 27 characters per second. An 8K download would take about five minutes.

It’s amazing we ever lived through the stone age.

Anyway, I thought it would be fun to make an Arduino library to send this information over my laser link, but first I decided that it would be good to test to make sure I understood how the format worked. So, I coded up a small program to generate some test .WAV files from an input data file. I made the problem simpler by generating the output at the somewhat non-standard sample rate of 9600 samples per second. This considerably simplifies the generation of samples, since they only would have amplitudes of zero, plus or minus one, and plus or minus sqrt(2)/2. I coded up the following C code, and generated this WAV file.

A WAV file that contains an ASCII test message, encoded in Kansas City Standard

The encoder is simple, the decoder, somewhat less so. So, to test that I was generating the proper bits, I used Martin Ward’s decoder written in Perl which did a good job of decoding the sample WAV files. I haven’t tested the robustness of this format with respect to noise yet, but it does appear to work reasonably well.

It wouldn’t be that hard to modify the simple sound generation code I used before to send data in this format. I think I will try to get to that next week.

[sourcecode lang=”c”]
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <sndfile.h>

/*
* kc.c
* A program which takes a file as input, and encodes it via the old
* Kansas City Standard – a 300 baud format that was used by old
* microcomputers to store data onto cassette tape.
*
* http://en.wikipedia.org/wiki/Kansas_City_standard
*
* We are going to produce a 9600 sample per second output file…
*
* Each "baud" is 32 samples long.
*
* A ‘0’ is 4 cycles @ 1200 Hz.
* A ‘1’ is 8 cycles @ 2400 Hz.
*
* 0 – 0 R2 1 R2 0 -R2 -1 -R2
* 1 – 0 1 0 -1
*
*/

#define R2 (.70710678118654752440f)

SNDFILE *sf ;
SF_INFO sfinfo ;

void
output(float f)
{
sf_write_float(sf, &f, 1) ;
}

void
send(int bit)
{
int c ;

switch (bit) {
case 0:
for (c=0; c<4; c++) {
output(0.f) ;
output(R2) ;
output(1.f) ;
output(R2) ;
output(0.f) ;
output(-R2) ;
output(-1.f) ;
output(-R2) ;
}
break ;
case 1:
for (c=0; c<8; c++) {
output(0.f) ;
output(1.f) ;
output(0.f) ;
output(-1.f) ;
}
break ;
default:
abort() ;
}
}

void
encode(int ch)
{
int i ;
send(0) ; /* start bit… */
for (i=0; i<8; i++) {
send(ch & 1) ;
ch = ch >> 1 ;
}
send(1) ; /* two stop bits */
send(1) ;
}

main()
{
int i, ch ;

sfinfo.channels = 1 ;
sfinfo.samplerate = 9600 ;
sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16 ;

sf = sf_open("test.wav", SFM_WRITE, &sfinfo) ;

for (i=0; i<9600/4; i++)
output(0.) ;
while ((ch = getchar()) != EOF)
encode(ch) ;
for (i=0; i<9600/4; i++)
output(0.) ;

sf_close(sf) ;
}
[/sourcecode]

Nine years of blogging…

July 21, 2011 | Blogging | By: Mark VandeWettering

Glancing to the side bar, it appears that today in 2002 was the first post on my blog.

This should be post number 3,690. I’ve had 2,286 comments. I’ve used 110 category tags. Over the 12 months, Akismet has removed 193,915 spam comments, and there have been 798 pieces of “ham”. The peak month for spam was November, 2010, where I received 35,764. As the result of that pain, I installed a RECAPTCHA plugin, and spam levels decreased to around eight thousand pieces per month.

Those are the statistics.

So, what’s the state of brainwagon? I’m posting somewhat less than in past years, but usually with less recycled links. When I do post links to the blog, I’ve been better at adding some value by presenting links to similar projects or other information that might prove interesting. I’ve begun to try to do more of my own original projects, and trying to use YouTube video more effectively. I’m also using Twitter more effectively. I’m meeting more people online, and trying to engage more completely.

Overall, I think brainwagon is going rather well. At times, it seems like shouting in a dark, empty room, but there are at least signs that some of my neighbors are listening.

Happy birthday, BrainWagon.

Addendum: The WP Post Words plugin allowed me to count the words written in all my posts:

Hallway Test of the Arduino PWM Laser Transmitter

July 21, 2011 | Arduino, electronics, My Projects | By: Mark VandeWettering

The other day, I showed how the Arduino could be used to generate PWM audio and send it over a very short distance using an LED. In my ever increasing pile of parts, I had some small 5mw red laser diode modules. These modules are supposed to be driven by direct connection to three 1.5 volt batteries, and draw a maximum of 50ma or so. In a fit of “what the heck”, I just soldered some better clip leads to one of them, and hooked it (without any other current limiting) to the PWM output of the Arduino. I measured the current draw as being about 13.7ma, which seemed fine, and the laser didn’t explode. So, the next day, I brought it into work and tested it out in a long hallway:


(Forgive the somewhat lower quality video, I sent them from my iPhone, and the quality leaves much to be desired). But it obviously works extremely well: the signal is easily discernable at even low settings of the amp.