Is That a Tuner in Your Pocket…?

As a musician, it’s rare to consistently recognize with the naked ear whether or not a single instrument is in tune. There are a number of electronic devices on the market to aid in this, however if you’re leading into an impromptu performance to impress your friends, using one feels about as suave as putting on your dental headgear before bed. When tuning is necessary, why not do so in a fashion that won’t cramp your style?

To help his music-major friends add an element of Bond-like flare to the chore, [dbtayl] designed a chromatic tuner that’s disguised as a pocket watch, pet-named the “pokey”. The form for the custom casing was designed in OpenSCAD and cut from aluminum stock on a home-built CNC mill. Under its bass-clef bedecked cover is the PCB which was laid out in KiCad to fit the watch’s circular cavity, then milled from a piece of copped-clad board. The board contains the NXP Cortex M3 which acts as the tuner’s brain and runs an FFT (Fast Fourier Transform) that uses a microphone to match the dominant pitch it hears to the closest note. Five blue surface-mount LEDs on the side indicate how sharp or flat the note is, with the center being true.

[dbtayl’s] juxtaposition of circuitry in something that is so heavily associated with mechanical function is a clever play on our familiarity. You can see a test video of the trinket in action below:

Continue reading “Is That a Tuner in Your Pocket…?”

Easy and Effective Way to Measure PWM… Without a Scope!

Sometimes when a project is coming together, you need to cobble a tool together to get it completed. Whether it’s something very involved, like building a 3D printer to fabricate custom parts, or something relatively simple, like wiring a lightbulb and a battery together to create a simple continuity checker, we’ve all had to come up with something on the fly. Despite having access to an oscilloscope, [Brian] aka [schoolie] has come up with his own method for measuring PWM period and duty cycle without a scope, just in case there’s ever a PWM emergency!

The system he has come up with is so simple it’s borderline genius. The PWM signal in question is fed through a piezo speaker in parallel with a resistor. The output from the speaker is then sent to an FFT (fast fourier transform) app for Android devices, which produces a picture of a waveform. [schoolie] then opens the picture in MS Paint and uses the coordinates of the cursor and a little arithmetic to compute the period and the duty cycle.

For not using a scope, this method is pretty accurate, and only uses two discrete circuit components (the resistor and the speaker). If you’re ever in a pinch with PWM, this is sure to help, and be a whole lot cheaper than finding an oscilloscope!

Sine Waves, Squares Waves, and the Occasional FFT

I became aware of harmonics and the sound of different shaped waveforms early in my electronics career (mid 1970’s) as I was an avid fan of [Emerson Lake and Palmer], [Pink Floyd], [Yes], and the list goes on. I knew every note of [Karn Evil 9] and could hear the sweeping filters and the fundamental wave shapes underneath it.


I remember coming to the understanding that a square wave, which is a collection of fundamental and (odd) harmonics frequencies, could then be used to give an indication of frequency response. If the high frequencies were missing the sharp edges of the square wave would round off. The opposite was then true, if the low frequencies were missing the square wave couldn’t “hold” its value and the top plateau would start to sag.

Continue reading “Sine Waves, Squares Waves, and the Occasional FFT”

The Teensy Audio Library

There are a few ways of playing .WAV files with a microcontroller, but other than that, doing any sort of serious audio processing has required a significantly beefier processor. This isn’t the case anymore: [Paul Stoffregen] has just released his Teensy Audio Library, a library for the ARM Cortex M4 found in the Teensy 3 that does WAV playback and recording, synthesis, analysis, effects, filtering, mixing, and internal signal routing in CD quality audio.

This is an impressive bit of code, made possible only because of the ARM Cortex M4 DSP instructions found in the Teensy 3.1. It won’t run on an 8-bit micro, or even the Cortex M3-based Arduino Due. This is a project meant for the Teensy, although [Paul] has open sourced everything and put it up on Github. There’s also a neat little audio adapter board for the Teensy 3 with a microSD card holder, a 1/8″ jack, and a connector for a microphone.

In addition to audio recording and playback, there’s also a great FFT object that will split your audio spectrum into 512 bins, updated at 86Hz. If you want a sound reactive LED project, there ‘ya go. There’s also a fair bit of synthesis functions for sine, saw, triangle, square, pulse, and arbitrary waveforms, a few effects functions for chorus, flanging, envelope filters, and a GUI audio system design tool that will output code directly to the Arduino IDE for uploading to the Teensy.

It’s really an incredible amount of work, and with the number of features that went into this, we can easily see the quality of homebrew musical instruments increasing drastically over the next few months. This thing has DIY Akai MPC/Monome, psuedo-analog synth, or portable effects box written all over it.

Measuring Car Engine RPM via the Cigarette Lighter


Sometimes we forget how many things we can do with a simple oscilloscope. In this video [Ben] uses one that Tektronix lent him to measure his DeLorean engine RPM. By checking the car main ~12V voltage one may notice that the voltage spikes occurring are directly related to the engine speed, as they are created by the inductive kicks from the ignition coils. Obviously the multiplication you have to do to get the RPMs from the number of spikes per second depends on your engine configuration (flat 4, v6…).

The method that [Ben] used was to search for high amplitude spikes on the (AC coupled) car 12V Fast Fourier Transform (FFT) to get a reliable measurement given the many electrical noise sources present in his car. At the end of his video, he however mentioned that it could still be possible to get a good measurement with a simple voltage comparator and a high enough voltage reference.

Continue reading “Measuring Car Engine RPM via the Cigarette Lighter”

Analog Shield and PCB Quadcopter


We spent a little bit of time at the TI booth at Maker Faire to film a pair of interviews. The first is with [Bill Esposito] who is grinding away on his PhD. at Stanford. He’s showing off an Analog Shield for Arduino. He describes it as “an attempt to bring the analog bench to an Arduino shield”. We think this is a fantastic idea as most who are learning digital electronics through Arduino have little or no experience with analog circuitry. This is a nice gateway drug for the concepts.

The analog shield has a supply good for +/- 7.5 volts, 4-channel ADC, 4-channel DAC, and gets 100k samples at 16-bits. He showed us a spectrum analyzer using Fast Fourier Transform on the incoming signal from a microphone. He also built a function generator around the shield. And finally a synthesizer which plays MIDI files.

In the second half of the video we take a look at [Trey German’s] work on a PCB-based quadcopter. His goal is to reduce the power consumption which will equate to longer flying times. To this end he chose the DRV8312 and a Piccolo to control each sensorless, brushless DC motor. The result should be 10% lower power consumption that his previous version.


Thumbs-Down Songs on Pandora with Your Mind

[Steven] likes music. Like many of us, he uses Pandora to enjoy the familiar and to discover new music. Now, Pandora means well, but she gets it wrong sometimes. [Steven] has had a Mindwave Mobile EEG headset lying around for a while and decided to put it to good use. With the aid of a Raspberry Pi and a bluetooth module, he built a brainwave-controlled Pandora track advancing system.

The idea is to recognize that you dislike a song based on your brainwaves. The Mindwave gives data for many different brainwaves as well as approximating your attention and meditation levels. Since [Steven] isn’t well-versed in brainwavery, he used Bayesian estimation to generate two multivariate Gaussian models. One represents good music, and the other represents bad music. The resulting algorithm is about 70% accurate, so [Steven]’s Python script waits for four “bad music” estimations in a row before advancing the track.

[Steven] streams Pandora through pianobar and has a modified version of the control-pianobar script in his GitHub repo His script will also alert you if the headset isn’t getting good skin contact, a variable that the Mindwave reports on a scale of 0 to 200.

Stick around for a demo of [Steven] controlling Pandora with his mind. If you don’t have an EEG headset, you can still control Pandora with a Pi, pianobar, and some nice clicky buttons.

Continue reading “Thumbs-Down Songs on Pandora with Your Mind”