Rachmaninoff's Bookmarklets

What a hodgepodge of topics my life has become. In blatant violation of the ideals of literary organization I’ll attempt to document what I’ve been thinking. Yeah, dental school’s been rough lately (finals week was last week), but I’m hanging in there and trying to be creative nonetheless. I’ve been dabbling in video motion tracking last week, and am contemplating attacking a project involving a lot of video shooting/editing and possibly some 3d work. It must have been almost 10 years since I last used 3d modeling software! I think it was 3D Studio Max back in the day they required a parallel port dongle and I had to spoof the hardware interface with a script so I could use a hacked version [rolls eyes]. I don’t want to give anything away, so I’ll leave it at that.

Also, I know it’s random, but check out that picture. That was me about 6 years ago, *AFTER* I stopped using 3dsmax. Yeah, I’m definitely running Linux there. Funny how pictures help you put things in perspective. See the clock on my rightmost monitor? I still use that thing.

I unknowingly stumbled into a new realm of web scripting when I searched for a way to skimp on my teacher evaluations. At the end of each course, many of our professors provide a point of extra credit for completing course evaluations. These things are lengthy, as you have to bubble choices (1-5) on about 30 topics per teacher, and some courses have 15+ teachers. It can take half an hour to click every bubble even for a single course, so I wrote a script to do it for me. Tom Hayward mentioned to me after-the-fact that such a script is called a Bookmarklet. It’s basically some fancy JavaScript with all the line breaks removed so it’s a single line, and with all spaces replaced by %20 such that it’s formatted as a URL. This javascript can be bookmarked as a URL, and when it’s clicked the script is run. While it seems to me like a blatantly obvious security risk and a terrible idea, it seems to work on most browsers on most OSes. So, in the hope that this script inspires someone else to be creative, I’ll post the source:

javascript:var auto ={
fillerup: function() {
var all_inputs = document.getElementsByTagName('input');
var all_selects = document.getElementsByTagName('select');
var all_textareas = document.getElementsByTagName('textarea');

for (var i = 0, max = all_selects.length; i < max; i++) {
	var sel = all_selects[i];
	if (sel.selectedIndex != -1&& sel.options[sel.selectedIndex].value)
		{continue;}
	var howmany = 1;
	if (sel.type == 'select-multiple') {
		var howmany = 1 + this.getRand(sel.options.length - 1);
		}
	for (var j = 0; j < howmany; j++) {
		var index = this.getRand(sel.options.length - 1);
		sel.options[index].selected = 'selected';
		}
	}

for (var i = 0, max = all_inputs.length; i < max; i++) {
	var inp = all_inputs[i];
	var type = inp.getAttribute('type');
	if (!type) {type = 'text';}
	if (type == 'radio') {
		var to_update = true;
		var name = inp.name;
		var input_array = inp.form.elements[inp.name];
		for (var j = 0; j < input_array.length; j++) {
			if (input_array[j].checked) {
			to_update = false;continue;}
			}
		if (to_update) {
			var index = this.getRand(input_array.length - 1);
			input_array[index].setAttribute('checked', 'checked');}
			}
	}
}
,getRand: function (count) {return count * Math.random());}
}
; auto.fillerup()

A project which caught my eye a few days ago was the spinning ball of LED awesomeness, and before I sound totally like a Hack-A-Day sellout, let me assure you that the project is super-cool, and that I read Hack-A-Day daily so it's a big part of my life. (I'm happy that I was featured on Hack-A-Day the week before dental school started!) Looking at projects like this make me wish that I were more creative, and definitely more mechanically inclined. I'm still trying to lean my weight into the engineering mindset from the perspective of programming, micro-controllers, AC circuitry, radio frequency, and other small facets of the massive field. I'll post the video to make it easy.

And while we're at posting videos, a recent re-discovery of some of my long-lost MP3s on a nearly-destroyed backup CD from when I was an early teenager has re-inspired me to keep my digital music collection in proper shape. (wow, I used 4 hyphens on that sentence) One of my favorites, of course, is Sergei Rachmaninoff's Rhapsody on a Theme by Paganini, which I guess I'd describe as a late romantic classical piano concerto. While we're at posting videos, I'll post the third part (arbitrarily separated due to YouTube's length limitation) of this song for my future enjoyment. My favorite region of the song is at 5 minutes and 40 seconds. Someone's probably going to ruin it for me by emailing me something smart like "It's just a bunch of fast overlapping arpeggios". It's been that kind of week.

I wonder if I will ever do anything as profound?

My microchips arrived in the mail! I'm so excited. attiny44a It's just in time too, I'm about to build my first [hopefully] functional non-bread-boarded single-chip transmitter (with a single-chip preamplifier) QRSS radio beacon -err, manned experimental propagation transmitter. These chips are smaller than the ATTiny2313's I'm used to working with, and will be SO FREAKING AWESOME to work with surface-mount size. I wonder if I trust myself to hand-drill a circuit board for such a SMT microchip using copper-plated PC board? Perhaps with a dental drill! Ah ha!!! Finally a use for that blasted thing.

In other news, work on my single-chip radio transmitter, with a single-chip preamplifier has stalled. On one hand I have almost all the equipment I need at my apartment (boxes of components, a dremel, a drill press, an excellent soldering station, copious amounts of workspace, boxes of tools, and many different types of wire), but I have no high-quality radio to receive any transmissions my device makes at the target frequency (10.140mhz). However, a radio shack filled with many gorgeous radios exists on the other side of town at the top of Shands hospital! Yeah, I could work on the project using a frequency I could measure with my Century 21 direct-conversion radio (14mhz or 7mhz), but it doesn't seem as exciting doing it this way. I fear I'll build a beautiful 7mhz transmitter which doesn't perform at 10mhz. Tonight I realized I left my prototype transmitter bread-boarded at the station, and here I sit with nothing to work on (hence my writing). I've been dabbling in non-productive projects over the last few weeks - I think it's time for me to wake up, shape up, and get back to working on something significant! With that, I'm outta here. Time to read some datasheets.


     

Microcontroller Clocking a Transmitter?

UPDATE I shouldn’t claim this idea as novel. After googling around, I found another guy who’s doing the same thing, and now that I read his page I remember reading his page before, which is likely where I got the idea in the first place. Anyhow, I want to give him credit ASAP and hope that my project can turn out successfully like his! His project page is at http://clayton.isnotcrazy.com/mept_v1.

Random idea: I only have a moment to write but I have to get this on paper. The core of any transmitter is usually an oscillator circuit, and in simple transmitters (i.e., QRSS devices), it’s often a crystal. Frequency adjustment is accomplished by adjusting capacitance to ground on one of the crystal legs. Simple oscillators such as the Colpitts design (based on an NPN transistor) are often used. (pictured)
NPN_Colpitts_oscillator_collector_coil However in my quest to design a minimal-case long-distance transmitter, I’m trying to think outside the box. Although it’s relatively simple, that’s still several parts just to make an oscillating sine wave from a crystal. The result still has to be preamplified before sending the signal to an antenna. I’m starting to wonder about the oscillator circuitry inside a microcontroller which has the ability to be clocked by an external crystal. For example, take the pinout diagram from an Atmel ATTiny2313 AVR: :attiny-2313

See how pins 4 and 5 allow for a crystal, and pin 6 has a “CKOUT” feature?” I’m still not sure exactly what the waveform of its output looks like. The datasheet is almost intentionally cryptic. About the only thing I’ve been able to discover from the Internet is that it’s sufficient to clock another microcontroller. However, if it’s an amplified sine wave output, how cool is it that it might be able to produce RF at the same frequency at which it’s clocked?

Taking it a step further, I wonder if I could write code for the microcontroller to allow it to adjust its own clock speed / frequency output by adjusting capacitance on one of the legs of the crystal. A reverse-biased LED with variable voltage pressed against it from an output pin of the microcontroller might accomplish this. How cool would this be – a single chip transmitter and frequency-shifting keyer all in one? Just drop in a crystal of your choice and BAM, ready to go. Believe it or not I’ve tested this mildly and it’s producing enough RF to be able to be picked up easily by a receiver in the same room, but I’m still unsure of the power output or the waveform. If the waveform is an amplified sine wave I’m going to pass out. More likely it’s a weak sine wave needing a preamplifier still, or perhaps even amplified square waves in need of lowpass filtering…

My wife snapped a photo of me working! It’s a funny pic – I’m in my own little world somtimes…IMG_3206

Here’s the power supply I’m using:IMG_3250

Here’s my transmitter breadboarded-out:IMG_3245

Alltogether:IMG_3257

And close to the oscilliscope…IMG_3241

Anyway, it’s just my thoughts tonight. I had to get it out. 73!