Introduction: Sonic Bow Tie, by David Boldevin Engen

About: I am an Electronics Student at NTNU, I'm an active participant of my local Hackerspace and MAKE workshop

A compact bow tie, capable of continuously displaying the surrounding sound in four different frequencies on its two mirrored 4x5 LED arrays.

This tutorial will go through how to make a bow tie that will make you stand out in any crowd.

What you'll need for this project:

1 Arduino Pro Micro or a similarly sized Arduino that runs at 16MHz

40 3mm LEDs

1 simple button

1 Electret Microphone

1 Rechargeable 3.7V 800mAh 25C 1-Cell LiPo Battery

10 100Ω resistors

1 10kΩ resistor

1 220Ω resistor

Access to a PCB machine (Printed Circuit Board)

A cheap adjustable hooked/clip-on bow tie or just the adjustable hooking/clip-on neckband

Step 1: Print the PCB

When printing a circuit board you may have to adapt the .cmp file to fit the manufacturer's requirements. However, the board in the original was made using a fairly inaccurate method so most manufacturers will most likely be able to produce the PCB without alterations. In the pictures, you can see the front and back of the PCB. The design assumes soldering holes don't include vias and that vias only can be placed separately(in PCBs with more than one side vias are connections between layers).

Each light is addressed to individually using a technic called Charlieplexing allowing for much fewer input nodes than a normal LED matrix, the drawback is that only on light can be turned on at a time, which sets a limit of how large the array can be and without noticeable flashing. Charliplexing workes by instead of having two signals 1 and 0, it has three 1, 0 and Z. Where Z workes like an open circuit, by having very high impedance. So each light is turned on by having the node be in a combination of 1, 0, Z, Z, Z, meaning the current can only go from one node to one other at a time.

Step 2: Soldering It All Together

When soldering the lights on the PCB it's very important to consistently solder positive side of the LED to the squares and the negative to the circle. Doing it opposite will cause the address in the code to turn on the wrong lights, and inconsistency will cause multiple lights to be turned on by the same stimuli.

Then solder on the 10 100Ω resistors to the front of the bow tie.

Then connect the other pieces in the way shown in the circuit diagram, its okay to solder the battery directly to the Arduino as it will recharge when the arduino is connected via USB. Before gluing all the pieces to the back of the PCB you should test for mistakes in the array.

Step 3: Uploading Code and Debugging

Upload the code above. When it's been uploaded press the button to activate it, now a triangle shape pointing inward should be scrolling up or down on the bow tie.

If you don't, use the Blink(LED) function, which takes an input of a number 1-20, for each light individually in the while(mode=0) loop in the void loop while commenting out the rest of that while loop.

void loop() {

while (mode == 0) {

Blink(1); //One by one test to see if the lights are working as they should and which ones don't

//Blink(2); //next step all the way to 20

/* if (digitalRead(Button) == 0) {

mode = 1;

Off();

turnOn(1);

delay(200);

break;

}

Off(); */ // this section is commented out while debugging

}

.....

Debugging:

If you have different lights on each side there is something wrong with the soldering and you should desolder the affected lights and do step 2 again.

If pairs of 2 lights are turned off there may be missing vias.

If two lights always turn on together and are less bright than others, one has been soldered on the wrong way.

If each light turns on individually, but don't follow the pattern described in the instructions at the top of the code you've messed up step 2.

other problems may arise from bad connections or a short-circuit on the PCB.

Warning: This segment is very technical and unnecessary for making the bow tie

I've written the spectrum analysis code specifically for an Arduino with a 16MHz clock frequency. So I'm not entirely sure how well it will work on other systems, it might cause all the bands to react very differently however it may not change much.

It works by taking 60 samples in about 6,7ms which is a sampling frequency of roughly 8,9kHz. Then analyzing them in 4 different ways giving 4 different frequencies.

The highest frequency analysis works by comparing every other sample with the next one, squaring the value and summing it for every s pair of samples. This gives the highest effect around half the sampling frequency so its a bandpass filter around 4,4kHz.

A rough mathematical formula for analysis:

Σ(sq(x[2n-1]-x[2n]))

The next one works very similarly, but it first adds two samples at a time. This effectively gives half the sampling frequency of the last system while filtering out the highest frequencies creating a bandpass filter around 2,2kHz.

The next system does the same but instead of adding 2 samples at a time it adds 10 which becomes a bandpass filter for 440Hz.

The last analysis sums the first 30 samples and compares it to the sum of the last 30. This effectively becomes a bandpass filter for 150Hz.

Step 4: Glue It All Together

It is important to keep the Arduino separated from the PCB as it may cause short-circuiting if they come in contact. This can be done by gluing them together with electrical tape between. it is also advantageous to have the battery on one wing of the bow tie and the microcontroller to the other for balance. You should try to keep the center of the bow tie fairly empty as this is where you connect the neckband, with the possible exception of the mic as it should stick out a few millimeters and point towards your esophagus, this will mean that when you talk everyone will see that the clearest.

Remember: on the backside of the bow tie functionality is far more important than esthetics as no-one will see this.

Audio Contest 2017

Participated in the
Audio Contest 2017