{"id":13,"date":"2017-02-13T05:44:29","date_gmt":"2017-02-13T05:44:29","guid":{"rendered":"http:\/\/eequalspi.com\/?p=13"},"modified":"2020-01-20T17:16:50","modified_gmt":"2020-01-21T01:16:50","slug":"in-13-stereo-vu-meter","status":"publish","type":"post","link":"http:\/\/eequalspi.com\/index.php\/2017\/02\/13\/in-13-stereo-vu-meter\/","title":{"rendered":"IN-13 Stereo VU-Meter"},"content":{"rendered":"<p><iframe loading=\"lazy\" title=\"Nixie VU-Meter\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/d148E-mFSx0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<h2>Introduction<\/h2>\n<p>The IN-13 VU Meter is a &#8216;Nixie&#8217; neon bargraph tube based VU-Meter. It takes stereo analog audio as an input (via a 3.5mm passthrough) and displays the audio amplitude on the tubes. It is not a true VU-meter, as it is not calibrated, but it does do proper log conversion to give a realistic representation of &#8216;perceived&#8217; loudness.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-18\" src=\"http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter1.png\" alt=\"\" width=\"543\" height=\"191\" srcset=\"http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter1.png 898w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter1-300x106.png 300w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter1-768x270.png 768w\" sizes=\"auto, (max-width: 543px) 85vw, 543px\" \/><\/p>\n<p>Figure 1: Final VU-Meter without enclosure.<\/p>\n<h2>Background<\/h2>\n<p>Several years ago, I discovered and subsequently became fascinated with <a href=\"https:\/\/en.wikipedia.org\/wiki\/Nixie_tube\">Nixie tubes<\/a>, whose warm neon glow stands in rather stark contrast to the sterile feel of modern LED displays. A few years later, I was speaking to my academic advisor about such things, and he introduced me to the IN-13 bar-graph tube. This three terminal tube works on the same principles as a Nixie, but instead of individual discrete segments, it has a continuously variable single column of neon light. His suggestion was an all-analog VU-Meter. I set to the task, and breadboarded a VU-Meter circuit with the log-converter using a diode in the feedback loop of an\u00a0 op-amp and a few buffers. It worked, but it wasn\u2019t as clean or adjustable as I would have liked, so while I had laid out a PCB I never went to the trouble of actually ordering it.\u00a0 The design did have a homebrewed <a href=\"http:\/\/www.ledsales.com.au\/kits\/nixie_supply.pdf\">555 based high voltage<\/a> power supply (HVPS) though, which was a fun build.<\/p>\n<p>I shelved the project and didn\u2019t touch it for years, although I did occasionally ruminate on the subject. When I finally came back to the topic last month, I had settled on a design that used an 8-pin microcontroller (MCU) in lieu of an op-amp based log converter. This had several advantages:<\/p>\n<ol>\n<li>I could adjust the gain and offset of the log conversion without changing any hardware.<\/li>\n<li>I could add simple moving averages or other low complexity signal processing algorithms if I so desired.<\/li>\n<li>I could use the GPIO of the MCU to shut down the HVPS (conserving the tubes and energy) when no sound was detected for a few seconds.<\/li>\n<\/ol>\n<p>I also opted to use a <a href=\"http:\/\/www.tayloredge.com\/storefront\/SmartNixie\/PSU\/index.html\">Taylor Edge HVPS<\/a> as they had come down in price to under $14 and supplied more current than the cruder and larger 555-based circuit that I had built could offer. Armed with these design decisions I set off to build my VU-Meter.<\/p>\n<h2>Design Process<\/h2>\n<p>With a microcontroller system in mind, the key elements to build an IN-13 driver \u2013 the key being signal specifications for all stages were in place. To maximize the performance of my MCU, it needed a 0-5V input signal and a 0-5V output from the controller\u2019s PWM pin. This allowed the use of a garden variety Arduino Uno for breadboard prototyping with a switch to an ATTiny85 (thanks to <a href=\"https:\/\/learn.sparkfun.com\/tutorials\/tiny-avr-programmer-hookup-guide\/attiny85-use-hints\">Sparkfun\u2019s convenient programmer<\/a>) for the final system.<\/p>\n<h2>Pre-Amplifier<\/h2>\n<p>The first stage calls for a pre-amplifier to drive a peak detector circuit before the MCU. By putting the peak detector before the MCU, the bandwidth that the MCU needs is lowered from ~20kHz to the desired time constant of the output bar graph (&lt;10Hz). Pre-amplifying the signal also guarantees that it is substantially larger than the 0.6V drop of the peak detector diode. This means that the system only requires a simple diode rectifier as opposed to a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Precision_rectifier\">more complex precision rectifier<\/a>. Figure 2 shows the input pre-amplifier and peak detector.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-19\" src=\"http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter2-767x1024.png\" alt=\"\" width=\"580\" height=\"774\" srcset=\"http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter2-767x1024.png 767w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter2-225x300.png 225w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter2-768x1025.png 768w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter2.png 997w\" sizes=\"auto, (max-width: 580px) 85vw, 580px\" \/><\/p>\n<p>Figure 2: Power supply, input amplifier, and peak detector.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-20\" src=\"http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter3-541x1024.png\" alt=\"\" width=\"541\" height=\"1024\" srcset=\"http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter3-541x1024.png 541w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter3-158x300.png 158w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter3.png 713w\" sizes=\"auto, (max-width: 541px) 85vw, 541px\" \/><\/p>\n<p>Figure 3: Input protection circuitry and ATTINY85 microcontroller<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-21\" src=\"http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter4-749x1024.png\" alt=\"\" width=\"580\" height=\"793\" srcset=\"http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter4-749x1024.png 749w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter4-219x300.png 219w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter4-768x1050.png 768w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/vumeter4.png 1045w\" sizes=\"auto, (max-width: 580px) 85vw, 580px\" \/><\/p>\n<p>Figure 4: Output drivers.<\/p>\n<h2>Microcontroller Signal Processor<\/h2>\n<p>This conditioned signal feeds into the ADC of the MCU, where the MCU count is converted to a floating point 0-5V range. That voltage is then passed through the equation:<\/p>\n<p>V<sub>out<\/sub> = 6.2log<sub>10<\/sub>(V<sub>in<\/sub>+1)<\/p>\n<p>This provides a 0-5V log converted output. That output is in turn converted to an 8-bit integer and used to generate a PWM signal on a GPIO pin of the MCU. Figure 3 shows the MCU circuitry.<\/p>\n<h2>Tube Drive<\/h2>\n<p>The next stage is a low pass filter to convert the PWM to a constant voltage to drive the tubes.<\/p>\n<p>The final stage of the system is a simple op-amp wrapped around a high voltage tolerant NPN transistor (MPSA42 or 44 do nicely).\u00a0 Figure 4 shows the PWM low pass and tube driver stages.<\/p>\n<p>Current drawn from the middle pin of the tube controls the IN-13\u2019s bar graph length. By setting the emitter resistor of the MPSA42, one can set the current pushed by the transistor. Placing that node inside the feedback loop of an op-amp goes one step further and removes the diode drop of the V<sub>be<\/sub> junction of the transistor.<\/p>\n<p>One surprising thing found with these tubes is that the specified striking (ignition) voltage is 140V \u2013 that is the voltage you need to apply to get the tubes to illuminate at all, but the high side voltage had to be raised to 146-150 volts to get the tubes to reliably strike on power up. Additionally, the datasheets for the IN-13 all specify a full scale control current on the order of 5mA, but I found that I had to drive them with 11-15mA to get them to reach full scale. There may a design error here, but it seems that age may have something to do with their behavior as well.<\/p>\n<h1>PCB Design<\/h1>\n<p>After finishing the breadboard prototype the board was laid out in eagle added a few simple safety features were added.\u00a0 Firstly, there is a high pass filter (AC coupling) with a pole around 10Hz to the input, before the pre-amplifier (Figure 3). This guarantees that any damaged parts cannot cause stray voltages and damage source device. Additionally, AC coupling guarantees that the input signal was centered on 0V, protecting the VU-Meter and preventing DC bias from causing clipping. The op-amp itself is used to clip the negative half wave and rectify the input signal. Again, this is for simplicity and increased dynamic range. A more conservative design would bias the input signal to half scale before pre-amplification.<\/p>\n<p>1n4001 protection diodes were added past the AC coupling to guarantee that large input voltages would not damage the quad op-amp used for all my signal stages (Figure 3 shows this protective circuitry as well as the high-pass).<\/p>\n<p>The design choice of a ground-centered input on a single supply system required that I use a rail-to-rail opamp. The schematic lists the TLV274, which I did not have on hand or test, but was conveniently in my eagle library. I grabbed the amplifier I had handy, an LMC660, which is also a rail-to-rail component.<\/p>\n<p>The MCU got some ADC input protection resistors as well. In the event of an overvoltage, the ADC has protection diodes tied to the power rails (much like the input stage of the system), adding a resistor in front of the ADC doesn\u2019t change the input impedance of the ADC much but protects these diodes from overcurrent (also shown in Figure 3).<\/p>\n<p>Finally, potentiometers allow for adjustment of control currents and the HVPS (Figure 2), as the PCB can\u2019t have resistors casually swapped out to tune the tubes the way the breadboard prototype could.<\/p>\n<h1>Manufacturing, Assembly, and Enclosure<\/h1>\n<p>After a quick search for the cheapest board manufacturer (<a href=\"http:\/\/pcbshopper.com\/\">pcbshopper<\/a>), ten boards cost $40 shipped from Accutrace (<a href=\"http:\/\/pcb4u.com\/\">PCB4U<\/a>) and the results were excellent. Compared to an advanced circuits prototype run (previously the benchmark for US made low cost boards), the Accutrace boards have a shinier solder mask and appreciably sharper silkscreen \u2013 one can clearly make out the smallest reference notes on the board, unlike the smaller, more expensive batch from Advanced Circuits.<\/p>\n<h2>Assembly<\/h2>\n<p>The only caveat with the boards as they came back was a footprint mistake, which was due to user error. The board had a modified Sparkfun footprint for the Panasonic dual gang potentiometer used to control gain for the preamp (Figure 2). Fortunately, after judicious use of a Swiss Army knife,\u00a0 the design was salvaged and the PCB layout was modified for future runs.<\/p>\n<h3>Calibration<\/h3>\n<p>Calibration was fairly painless. The MCU enabled another handy feature \u2013 the system tests the tubes at power up by linearly progressing from zero to full scale. For actual tube adjustment, it is simple to input a test tone, using a tool like <a href=\"http:\/\/onlinetonegenerator.com\/\">online tone generator<\/a> and sweep from zero to full scale, then use the sound card to pan the balance left to right.<\/p>\n<p>Additionally, testing revealed that despite using a 12V supply for breadboard testing (it was handy), the design has plenty of headroom with a 9V supply, and works just fine.<\/p>\n<h2>Enclosure<\/h2>\n<p>Using Inkscape for design and an Epilog laser cutter for fabrication, an enclosure was built. It consists of two sheets of smoked acrylic; these create a \u201csandwich\u201d with the board in the middle using standoffs. The smoked acrylic transmits the orange glow of the tubes nicely, while masking the circuitry from a distance. The result is a floating vu-meter effect (Figure 5). The back panel of the enclosure also has picture hooks cut into it to allow the meter to be mounted either vertically or horizontally on a wall.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-35\" src=\"http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/Picture1.png\" alt=\"\" width=\"534\" height=\"267\" srcset=\"http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/Picture1.png 882w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/Picture1-300x150.png 300w, http:\/\/eequalspi.com\/wp-content\/uploads\/2017\/02\/Picture1-768x384.png 768w\" sizes=\"auto, (max-width: 534px) 85vw, 534px\" \/><\/p>\n<p>Figure 5: Board in acrylic enclosure.<\/p>\n<h1>Conclusion<\/h1>\n<p>The final project works well and looks absolutely gorgeous sitting on top of my home stereo. It works great as a standalone device but I fully intend to include a few of these into larger projects as integrated VU-Meters.<\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=4ZSjf-Nh2hY&amp;feature=youtu.be\">Video of breadboard prototype, showing auto-shutdown.<\/a><\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=2At_rcggL9w&amp;feature=youtu.be\">Video of final board.<\/a><\/p>\n<p><a href=\"_wp_link_placeholder\" data-wplink-edit=\"true\">Follow up: Fixing a design bug.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction The IN-13 VU Meter is a &#8216;Nixie&#8217; neon bargraph tube based VU-Meter. It takes stereo analog audio as an input (via a 3.5mm passthrough) and displays the audio amplitude on the tubes. It is not a true VU-meter, as it is not calibrated, but it does do proper log conversion to give a realistic &hellip; <a href=\"http:\/\/eequalspi.com\/index.php\/2017\/02\/13\/in-13-stereo-vu-meter\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;IN-13 Stereo VU-Meter&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-in-13-vumeter","category-nixie"],"_links":{"self":[{"href":"http:\/\/eequalspi.com\/index.php\/wp-json\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/eequalspi.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/eequalspi.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/eequalspi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/eequalspi.com\/index.php\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":9,"href":"http:\/\/eequalspi.com\/index.php\/wp-json\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":233,"href":"http:\/\/eequalspi.com\/index.php\/wp-json\/wp\/v2\/posts\/13\/revisions\/233"}],"wp:attachment":[{"href":"http:\/\/eequalspi.com\/index.php\/wp-json\/wp\/v2\/media?parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/eequalspi.com\/index.php\/wp-json\/wp\/v2\/categories?post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/eequalspi.com\/index.php\/wp-json\/wp\/v2\/tags?post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}