Close

Designing for the Beginning Engineer

A project log for MicroKits: Theremin Electronic Kit

Let's inspire the next generation with exciting and educational kits that anyone can build. Want to create your own theremin?

david-leviDavid Levi 04/15/2017 at 16:170 Comments

I've explained how the microprocessor and timer work together to create a theremin. Now, I wanted to explain some of the decisions I made to make sure that anyone would be able to complete the kit.

The single most important design choice: breaking up circuit construction into stage. Instead of expecting the circuit to be built all at once, the instructions break down the circuit into three stages: powering up the chip on its own, adding the pitch antenna, and adding the volume antenna. By breaking things up into three stages, the builder has a change to check their work. If something goes wrong, they will only have a few parts to check over, instead of an entire circuit.

When I first learned to code, I would compile and test what I was building about once every four lines. That rapid feedback let me learn what each part of the code did, and correct my mistakes quickly. But when I was first learning hardware, things were different. I had to solder together an entire kit over a few hours, and just hope it would work when I powered it up. Now, with this kit, I'm bringing immediate feedback to hardware. The builder has "checkpoints" to encourage them to complete their kit. And the kit reinforces the healthy engineering habit of troubleshooting and checking your work as you go.

The microprocessor has a bit of code on it, that lets it decide what stage of completion it is in. If it receives no signal from either the pitch or volume antenna, it just plays a fixed note. This shows that it is powered and connected to the speaker. With no volume signal, it plays pitch but keeps volume at max. And with the signal from both, I processes both pitch and volume in an infinite loop. "freq_delta" and "vol_delta" are variables from the counter block, proportional to input oscillator frequency. If the numbers are too low, that shows there is no input signal.

	/*If no signal on freq input, play fixed note and volume*/
	/*If no signal on vol input, process freq and fix volume*/
	/*Otherwise, process freq and vol*/
	if (freq_delta<100){
		PWM16_1_WritePeriod(C3);
		PWM16_1_WritePulseWidth(((C3)>>1));
		DAC6_1_WriteBlind(0);
		while (1){
		}
	} else if( vol_delta<100){
		DAC6_1_WriteBlind(0);		
		while (1){
			Freq_Process();
		}	
	}else {	
		while(1){	
			Freq_Process();	
			Vol_Process();
		}	
	}

The layout of the actual circuit is designed to reduce the chance of mistakes. First, most the wires that connect to the side power rails are the shorter, orange variety. With these shorter wires, it's almost impossible to, say, connect a ground pin to 5V power. When I first designed this circuit, most parts connected to power using longer wires. But by flipping the breadboard around and moving around parts, I prevented many short circuits.

Something else you've noticed by now: the chips have eyes. Partially, I added these stickers because, well, anthropomorphized electrical parts are cute. But there's an important reason they're there. These eyes show the builder what direction to put in the chips. It takes trained eyes to see the tiny direction indent on a chip. These stickers make things friendly and accessible.

Up next I'll probably start posting about preparing for and building the first big batch of 100 kits. I've already posted images of my microprocessor programming and test fixture. More photos will be on the way soon!

Discussions