P13323: Optoelectric Guitar Pickup

Build, Test, Document

Table of Contents

Build, Test, and Integrate

Subsystem testing results are shown below

Power Management Results and Specs

II Power Management Results and Specs.pdf

Analog Path Design

public/Build,Test,Documents/LPF Calculation.PNG

public/Build,Test,Documents/HPF Calculation.PNG

Comparison between the theoretical values and the real values

Low pass filter


'Simulation results for Low E String'

public/Build,Test,Documents/Low E.PNG

'Simulation results for A String'

public/Build,Test,Documents/A Sting.PNG

'Simulation results for D String'

public/Build,Test,Documents/D String.PNG

'Simulation results for G String'

public/Build,Test,Documents/G String.PNG

'Simulation results for B String'

public/Build,Test,Documents/B String.PNG

'Simulation results for High E String'

public/Build,Test,Documents/High E.PNG

High pass filter


'Simulation results for Low E String'

public/Build,Test,Documents/Low E High.PNG

'Simulation results for A String'

public/Build,Test,Documents/A High.PNG

'Simulation results for D String'

public/Build,Test,Documents/D High.PNG

'Simulation results for G String'

public/Build,Test,Documents/G High.PNG

'Simulation results for B String'

public/Build,Test,Documents/B High.PNG

'Simulation results for High E String'

public/Build,Test,Documents/High E High.PNG



'Simulation results for HPF + LPF'

public/Build,Test,Documents/LPFHPF Sim.PNG

Low E String

public/Build,Test,Documents/Low E String.PNG

'Simulation results for Low E string'

public/Build,Test,Documents/Low E string sim.PNG

Digital Path Design

Digital Schematic


This is the current schematic for the digital path in the system. A couple of items to note. The 3 header pins (2 20 pin headers and one 2 pin header) correspond to the header pins on the microcontroller evaluation board. The 20 pin female headers access the microcontroller pins. The 2 pin male header is the power input for the evaluation board. The voltage divider at the ADC inputs to the microcontroller are meant to cut the amplitude of the incoming signal down by a factor of 3. This is because the ADC inputs of the microcontroller cannot withstand more than 1.98V in. Any higher voltage applied to the ADC inputs will cause the GPIO interface in the microcontroller to shutdown.

A recommendation is to add capacitors and a pull down resistor to the ADC inputs. Additionally, it is recommended to use clamping diodes in place of the voltage divider resistors at the inputs. This way, the input voltage can be more effectively kept in check within the required specifications of the microcontroller's ADC.

The DAC used in this first iteration has a 10 bit resolution and receives/sends data via SPI. Since higher clock frequencies (5 MHz) are being used to clock data into the DAC, shielded (or at least twisted) cable is a necessity to be added.

At the output of the DAC is a fourth order Butterworth approximated lowpass filter with a cutoff frequency at 22 kHz. This filter eliminates unwanted high frequency noise components in the signal coming from the DAC.

Further information on the results of the circuit functionality can be found under Test Results.

Software Flowchart


Source code for the digital path is in the Digital_Path_Files directory under Build,Test,Documents in the public directory. Or right click and save the .zip file here: Digital Source Code

Typically, high end audio has a sampling frequency of 48 kHz. The software is designed to sample a given signal at the 48 kHz (or 0.021 ms) frequency. Sampling is handled by an timer/counter-triggered interrupt.

Inside the interrupt service routine (ISR), the 6 ADC channels are read, filtered through FIR implemented bandpass filters, summed together, and finally sent via SPI to the DAC. It is worth noting here that a previous DAC was used that received data via I2C. The I2C clock is not fast enough to handle the required sampling frequency for this project. Therefore, the DAC currently being used was chosen since the SPI clock can run at much faster clock frequencies (up to 14 MHz).

The use of one of the microcontroller's features, known as a Direct Memory Access (DMA) controller, is to reduce overhead in the software and simplify the process of reading 6 ADC signals. A consideration for a software improvement would be to re-write the SPI code to be handled by the DMA.

Evaluation Board Schematics and Block Diagrams

The following files are all relevant information pertaining to the evaluation board. Note these are current as of 12/2013. Be sure to check that the most current data sheets are being used to ensure correct functionality of the microcontroller.

Block Diagrams

Evaluation Board Block Diagrams PDF

Schematics and Board Layouts

Evaluation Board Schematic PDF

Evaluation Board Top Layer PDF

Evaluation Board Bottom Layer PDF

Microcontroller Documentation

Much like the evaluation board documents, the microcontroller data sheet is current as of 12/2013. Always check Atmel's website to ensure the most updated versions of documentation are being used.

AT32UC3L064 Data Sheet PDF

Development Environment for Software

The IDE used for this project is Atmel's AVR Studio. The IDE is based off of Microsoft Visual Studio, so if you have familiarity with using that environment, AVR Studio will look very familiar to you. If you have not used AVR Studio before, here is a brief overview to get you started with continuing development of the code.

New Project and Writing Code

When you launch AVR Studio, the left side of the screen will show 3 options:

To continue working on the code for this project, you'll need to create a new project. To create a new project, select 'New Project'. From there, you can choose your relevant project type (i.e. C/C++, Assembler, Atmel Studio Solution) or choose one of the options under C/C++. For working with the evaluation board, choose Atmel-Boards and then UC3L-EK-AT32UC3L064.

Next, you'll need to add the files to your project. In the solution explorer, right click on the name of your project under 'Solution 'ProjectName' (1 project)' and select Add and Existing Item from the menu. You can then add all source files. Note that the source files for this project should be in the working directory of your AVR Studio project.

Some things to watch out for include when you update the existing header files. AVR Studio does not update the files in your project directory and the project directory's src file. In your project directory (in the file one level above the src file) any changes you make to files will be saved. Copy and paste these into the src file in that directory to overwrite the older versions of the files.


The debugger used for this project is the Atmel AVR Dragon. To write to flash memory on the microcontroller, you'll need to connect the JTAG port on the evaluation board to the JTAG port on the AVR Dragon.

Once connected, go to Tools -> Device Programming. Then ensure that under Tool it says AVR Dragon, Device should say AT32UC3L064, and Interface should say JTAG. To program, go to Memories. Make sure under the Flash section the directory links to your .elf file to write to flash. Then hit Program.

After the device has been written to, you can enter debug mode either by going to the Debug menu and selecting Start Debugging and Break, or by clicking the blue arrow in the tool interface below the menus. The green arrow allows you to keep moving from breakpoint to breakpoint.

To set a breakpoint, simply right click on the line you'd like to set the breakpoint on and go to Breakpoint -> Insert Breakpoint. Deleting breakpoints is done similarly except you'd click Breakpoint -> Remove Breakpoint.

Additionally, make sure you look over AVR Studio's tutorials if you'd like more detail in working with AVR Studio.

Test Plans & Test Results

Analog Processing Path

High Pass Filter and Low Pass Filter Test

At 100 Hz


At 185 Hz


At 400 Hz


At 700 Hz


At 1000 Hz


Table Results

public/Build,Test,Documents/Table Results.PNG

Results from Analog path

Low E String



A String



D String



G String



B String



High E String



Digital Processing Path

DAC Output

The following 3 images show both the unfiltered (yellow) and filtered (blue) output from the DAC. Note the effect of the filter on the high frequencies in the unfiltered signals. By using lowpass filters with a cutoff frequency at 22 kHz, some of the high frequency noise is removed. Note that these tests were done with lab bench frequency generators for one frequency at a time.

DAC Output at 1.4 kHz


DAC Output at 600 Hz


DAC Output at 100 Hz


These next 5 captures show the results of the digital path when two frequencies are generated with the frequency generators.

Both Signals at 600 Hz



Signals at 600 Hz and 100 Hz


Signals at 600 Hz and 400 Hz


Signals at 600 Hz and 900 Hz


The sound produced from the two frequency generators was captured on the PC speakers. The various sounds are produced by simultaneously adjusting the frequencies of the signal generators:

Digital Path Sound

Although two frequencies produced a sound, the amplitudes of the signals were between 200 - 400 mVp-p. When tested with the guitar amplifier, clipping was present. This is due to too high of voltage being sent out of the DAC, time skews in the ADC signals when they are read in, some gain being produced when the signals are summed together, incompatible ADC and DAC reference voltages, and the low resolution of the DAC. To eliminate the time skewing and resolution issue, consider getting 6 ADCs in the same package. Additionally, it is also possible to ADCs and DACs in the same package. That way, it can be assured that the ADC and DAC are operating at the same reference voltage.

In the software, the processing of ADC data will need to be changed to handle signed bits with respect to the offset of the ADC. For instance, if the ADC reads in a signal where the signal is centered at 0.5 V, the sign of the signal samples will need to be taken with respect to 0.5 V as the 0 reference.

Mechanical Systems Test Results

Stripping torque test to develop the correct installation torque for the M2x0.4 set screws that are used to assemble the sensor system. The resulting torque spec from this test should be followed for all screws in the system so as to promote correct holding force without damaging any components.

Guide bed positional freedom test results that show the small amount of rock that is attributed to an imperfect interface between the aluminum guide bed and the wooden bridge. This does not suggest that the guide bed needs to be machined to match the bridge. Rather, an adjustment system may be developed later that only uses two points of contact with the bridge to maintain its position instead of a whole surface.

Assembly Instructions

Assembling the Sensor system: 1) Clean the surface of the guitar (particularly the soundboard), making sure it is free from debris in front of the bridge, so that installation will not mar the finish of the guitar.

2) Assemble a lower sensor pod to each sensor post, taking care not to break any wires on the lower pods if IR LEDs are already mounted.

3) Push a IR photo transistor into the upper sensor pod from the top down, taking care to leave room between the rim of the transistor can and the aluminum surface of the sensor pod.

4) Assemble an upper sensor pod to each sensor post. Torque the pods to the post with only enough torque to hold them in place, they may need to rotate for the following steps.

5) Slide the bare guide bed under the strings of the guitar, but do not slide it all the way back to the bridge just yet.

6) Attach each sensor post to the guide bed by guiding the sub-assembly down between each string.

NOTE: If the IR LEDs are still linked by wires, the lower pod mount and sensor post can be installed to the guide bed previous to sliding it under the guitar strings. Once they are installed, slide the guide bed partially under the strings, rotate it 90 degrees to allow the sensor posts to go under, and then rotate it back 90 degrees, guiding each string around the tops of the appropriate sensor post.

7) Position the IR LEDs and photo transistors so that the mounts are visually parallel with each other and tighten to appropriate torque.

8) Slide the sensor posts along the guide bed so that each string is visually in between the closest points on the IR LEDs and photo transistors and tighten the sensor posts to the guide bed, along with tightening the sensor pods to the post. The correct torque spec is listed in the mechanical testing section, or click here. As of 11/14/13, it is 120 mN-m.

9) Connect each jumper to the appropriate header on the end of the wire attached to the guide bed.

10) Slide the guide bed firmly against the bridge and feed one end of the short strap through the side of the guide bed, then mesh the Velcro pieces together.

11) Wrap the Velcro around the under side of the guitar body and feed it though the other end of the guide bed. Pull the strap taught and mesh the Velcro.

12) Place the center of the long strap at the heel of the guitar so the soft foam piece is positioned there and draw the straps down around the sides of the guitar.

13) With gentle tension, pull the straps tight mesh the two pieces of Velcro on either end of the strap together at the bottom of the guitar, just right of the end pin.

14) Slide your fingers through the interfaces of the short and long straps to free the Velcro joints.

15) Pull back on the short strap, drawing tension on it that will hold the guide bed against the bridge.

16) Mesh the Velcro on the short and long straps, and retention the long strap's Velcro joint. This is an iterative process between short and long strap tension to get the straps right.

Wiring the system correctly:

1) The 9 pin connector coming from the sensor system will need to be plugged into the bottom of the processing unit, and is directional so that it can only be plugged in one way.

2) Plug the 1/4" connector into the jack on the bottom of the processing unit. Then plug the other end into the amplifier, making sure that the amplifier is off before doing so.

3) With the top cover removed from the processing unit, plug in the rechargeable 9v and mesh the Velcro to affix it in the unit. Replace the cover.

4) Clasp the processing unit onto your belt, or affix it to another sturdy location that will always be close to the guitar, as the signal wire is of a short length.

5) Check that the connections are still firmly in place before continuing.

Operating Instructions

Using the Opto-electric Pickup system:

The front of the processing unit has seven switches. The top three (from left to right) are Digital/Analog selectors for strings 1, 2 and 3, while the middle three (left to right) are for strings 4, 5 and 6. The lower switch controls the output mode (D/A). The switch on the top of the guitar is for power, and when turned on, should also illuminate an LED. If the LED is not on, check to make sure the battery is properly charged.

Switching Analog or Digital mode:

With the unit on, analog and digital modes can be changed on the fly. Analog mode is activated by sliding a switch up towards the power switch, while digital mode is activated when the switch is down. This holds true for all six string switches and the jack switch.

Caution should be taken when switching modes while the amplifier is on. Momentary noise on the lines can cause speakers to 'pop' when a changeover occurs. This noise is quite loud when the volume is up near maximum.

Home | Planning & Execution | Systems Design | Detailed Design | Photo Gallery