Man, what a long day! Work is so tedious sometimes. This week I’ve been proofing scientific literature (revising scientific manuscripts in an attempt to improve them as much as possible to increase their probability of acceptance and timely publication). I’ve been using Office 2003 (with “track changes”) to do this. I make changes, my boss makes changes, I make more changes, and it goes back and forth a few times. I wonder why office 2007 is so bad. Does anybody truly like it, and find it to be a significant improvement upon 2003? … or Vista over XP? [sigh] Maybe I’m just getting old, inflexible, and grumpy.

Here, take a look at what I’m working on [snapps screenshot]. I had to blur the content for intellectual property protection and to avoid possible future copyright violations. The light bubbles on the right are deletions. The dark bubbles on the right are comments. The red text is insertions/modifications I made. Pretty intense, huh? Pages and pages of this. And, upon successful completion of a manuscript, my reward is to begin working on another one! Luckily we’re almost caught-up on manuscripts… but that means we get to start writing grants… I’m starting to grasp the daunting amount of time a scientist must spend writing in the laboratory as opposed to performing actual experiments or even doing literature research.

Last night I assembled a Pixie II circuit similar to the one pictured here. I must say that I’m a little disappointed with the information available on the internet regarding simple RF theory in relation to transceiver circuits. I’m probably just not looking in the right places though. (Yes, I know about the ARRL handbook.) The thing is that I’m just now starting to get into RF circuitry and the concept looking at solid-state circuits and imagining a combination of AC and DC flowing through it is warping my brain. I have everything I need to build an ultra-simple Pixie II transceiver (which is supposedly capable of morse code transmissions over 300 miles, and QRSS applications over 3,000 miles) but I refuse to use it. No, it’s not because of moral obligations preventing me from powering it up before I get a general class radio license (shhhh). It’s because building something is useless unless you understand what you’re building.

I’m trying to break this circuit down into its primary components. I understand the role of the lowpass pi filter (before antenna). I understand the role of the 1st transistor and related circuitry in amplifying the output of the oscillator (left side). I totally get the audio amplifier circuitry (bottom). It’s that center transistor (which supposedly handles signal amplification, receiving, and mixing) that I can’t get my mind around. Every time I think figure it out for one mode (sending or receiving), I lose the other one, and visa versa. It has me very frustrated (and a little depressed about the whole thing) because this should be much easier than I’m making it. There’s no thourough documentation on this circuit! I selected it because it was extremely simple and I assumed I’d be smart enough to figure it out. I guess I was wrong. I wish I had an oscilloscope so I could probe the RF passing through various stages of this circuit [sigh]. Back to the ARRL handbook. Maybe if I read chapters 5-11 a couple more times I’ll magically understand it.





Additional Resources

Over the last couple weeks whenever I had the time I’d work on creating a little DIY morse code keyer. After 6 designs (whoa!) I came up with the winner. The youtube video describes it all I guess. Basically it just uses a bar of aluminum which rocks on a metal pin. Thumb-screws on each side of the balance point (fulcrum?) can be adjusted to modulate the distance the paddle has to go down to be activated, and how high the paddle goes up when released. A couple springs (one pull-type and one push-type) help give it a good bounce between keys. Two potentiometers (knobs) control volume and frequency. I especially like the ability to control the frequency! A capacitor inline with the speaker helps smooth the output a bit too. It’s not professional, but hey – for a couple bucks of parts I made a functional keyer and had a blast doing it. Now I guess I should learn Morse code…

And some photos…





Additional Resources

Two hours after getting home from work I’m already basking in the newfound carefreeness thanks to the successful completion of my thesis defense (and graduation requirements). Yesterday I went to skycract, early this morning I posted a schematic diagram of a basic circuit concept for a radio/microphone interface box with tone generating functions, and this afternoon I finished its assembly. It’s hacked together, I know, but it’s a PROTOTYPE and is for functional use only. What does it do? It’s complicated, and I described it in the previous entry. It’s basically just an exercise in microchip programming! Here are some photos…

Here’s that internal photo I promised I’d get posted yesterday…

Here’s the little setup with the main control unit and a DC to DC regulated power supply / serial microchip programmer I made.

Here’s the main control box. Notice the “2-way lighted switches” which I described in the previous entry (I posted the schematic). I found that proper grounding (floating pin prevention) was critical to their proper function. I’m still new to these chips, so I’m learning, but I’m making progress!

Getting a little artsy with my photographs now… this is the core of the device. It’s a picaxe 14m!

This is a ~? to 5v regulated power supply I built. The headphone adapter is for easy connection to the serial port. It has a power switch and a program/run switch (allowing use of pin 13, serial out) while still “connected” to the PC.

I wanted to toss this picture out there. I’ve slightly improved the connection between my radio’s coax cable to the ghettorigged jpole antenna I made.

I’m able to get relatively AMAZING results from this very unimpressive hack job, but it’s probably not likely to do much to my assembly skills (and lack of tuning), and more likely due to the fact that I have a beautiful unobstructed view of middle/southern Orlando from the 3rd story of my apartment balcony! I could probably wire up a rubber duck on a stick and get impressive results with that view! I’ll miss my reception when I move.

I just realized I didn’t post an image of the inside (complex wiring) of the device. Maybe later.





Additional Resources

UPDATE: An improved ECG design was posted in August, 2016.
Check out: http://www.swharden.com/wp/2016-08-08-diy-ecg-with-1-op-amp/

No 3-day weekend would be complete without a project that’s, well, virtually useless. I present to you my new and improved ECG machine! Instead of using a single op-amp circuit like the previous entries which gave me decent but staticky traces, I decided to build a more advanced ECG circuit documented by Jason Nguyen which boasted 6 op amps! (I’d only been using one) Luckily I picked up a couple LM 324 quad op amp chips at radioshack for about $1.40 each, so I had everything I needed. I’ll skip to the results. In short, they’re gorgeous. Noise is almost nothing, so true details of the trace are visible. I can now clearly see the P-Q-R-S-T features in the wave (before the P was invisible). I’ll detail how I did this in a later entry. For now, here are some photos of the little device and a video I uploaded to YouTube. It’s not fancy.

UPDATE: Upon analyzing ~20 minutes of heartbeat data I found a peculiarity. Technically this could be some kind of noise (a ‘pop’ in the microphone signal due to the shuffling of wires or a momentary disconnect from the electrodes or perhaps even a static shock to my body from something), but because this peculiarity happened only once in 20 minutes I’m not ruling out the possibility that this is the first irregular heartbeat I captured with my DIY ECG. Note that single-beat irregularities are common, and that this does not alarm me so much as fascinates me. Below is the section of the data which contains this irregular beat.





Additional Resources

UPDATE: An improved ECG design was posted in August, 2016.
Check out: http://www.swharden.com/wp/2016-08-08-diy-ecg-with-1-op-amp/

Last night I finished building my DIY ECG as a prototype (I finally got the circuit off the breadboard and onto a plastic sheet). This is a similar circuit to the one used to record data from the last entry (resister values are now identical to the crude circuit described several posts ago). I left-in the crude band-pass filter (made by grounding my primary electrode sensor through a 0.1µF capacitor) because it seemed to help a great deal, and wasn’t hard to implement. I picked up all of my parts (including the LF324 quad-op-amp microchip) at RadioShack. Of note, the quad-op-amp is overkill because I’m only using one of the 4 op-amps. Theoretically I could add 3 more electrodes to this circuit (which would allow for multi-sensor recording, similar to the electrodes placed at http://en.wikipedia.org/wiki/File:Limb_leads.svg) but this would require multiple microphone jacks, which isn’t very common. I guess I could use 2 microphone jacks, and differentiate right/left channels. Anyway, here are some photos.


I made the prototype by drilling holes in a small rectangular piece of a non-conductive plastic-fiberish material. (I picked up a stack of these rectangular sections for a quarter at a local electrical surplus store and they’re perfect for prototyping). The two green wires coming out the left side attach to a ~5v power supply (either a plugged in AC->DC transformer, 3 or 4 AA batteries, or even a 9V should work). The blue wires on the right attach to the electrodes I put on my chest. The black wires go to a headphone-jack which I plug into the microphone hole of my PC to record the signal.


This is the back of the device which shows my crummy soldering technique. Let it slide folks, I’m a molecular biology not an electrical engineer. Anyhow, basic point-to-point contacts, nothing special. The white/yellow wires correspond to the left/right channels of the microphone connector. I only use the left one (white), but attached the right channel (yellow) to the op-amp just in case I decide to add another sensor later – this is not required.


Here’s the full shabang! You can clearly see the circuit (note its small size – easy to mount inside of a tictac box or something) with the green wires leading to a power supply, black cable being the microphone connector, and the blue wires leading to electrodes made… from… fanta… cans…? Yes, in the spirit of ghetto-rigging electronics (my specialty) I found that surprisingly nice chest electrodes can be made from aluminum soda cans! If you go this route, cut them delicately so you don’t get metal shards in your skin like I did at first. Also, note that you have to firmly scrape each side of the aluminum to get the insulating waxy-plastic stuff off or it just won’t work. (I guess it’s coated with something to prevent the soda from tasting like metal.) Aluminum rapidly transfers heat, so it’s nearly impossible to solder leads onto these pads, so I wrapped a wire (tipped with a bead of solder) with the edge of the aluminum several times and crushed the heck out of it with pliers and it seems to stay on well and make a good connection. Also, before taping these onto your skin, you have to put a highly-conductive goo on it to make the connection better. I chose to use a copious squirt of my wife’s skin moisturizer on each electrode (shh, don’t tell her!) and taped the gooey electrode directly onto my chest.

I recorded ~20 minutes of data last night with this rig and it looked pretty good. I went to analyze it with Python and it kept crashing! The python script I gave you previously loads the entire wave file into an array of numbers, but with a 20 minute wave file (at over 40,000 samples a second) this is just too big for memory. I wrote an updated wave loader function which loads large wave files in parts which is much more efficient. It also performs the condensation method at load time. Basically, it loads 100 data points (or whatever deg is set to), averages them, and adds this value to a list. The result is a smoothed trace with a resolution of ~400Hz instead of ~40,000Hz. I’d apply it to my wave file I recorded last night but it’s on my laptop which is in the car and I’ve got to get back to work. Here’s that function:

 def loadWav(fname,deg=100):
     global hz
     w=wave.open(fname)
     nchannel, width, rate, length, comptype, compname = w.getparams()
     print "[%s]
 rate: %d Hz
 frames: %d
 length: %.02f sec" %
           (fname, rate, length, float(length)/rate)
     hz=rate/deg
     chunks=int(length/deg)
     data=[]
     for i in range(chunks):
         if i%7777==0:
             print "processing chunk %d of %d (%0.02f%%)" %
                   (i,chunks,100.0*i/chunks)
         vals = struct.unpack("%sh" %deg,w.readframes(deg))
         data.append(sum(vals)/float(deg))
     print "complete!"
     return data