Approximately two weeks ago I decided to purchase a ticket to the 2026 Open Sauce convention in San Mateo, CA. I recently moved to the bay area so I figured it would be a great opportunity to check out some cool projects and get to see some of my favorite makers in action!
In order to make things more challenging, a week before the event, I decided to design my own convention badge...
The ConceptAdmittedly, going into the badge design I had an initial plan based on a cool application note I stumbled upon recently from Microchip Technologies: "Low-BOM Microphone Interface Using the Analog Signal Conditioning (OPAMP) Peripheral". I have recently been getting back into using PICs for some of my more basic projects and I hadn't used an op amp peripheral integrated into a microcontroller before so I figured it would be a great learning opportunity!
After checking out a few datasheets, I decided on the PIC16F17576 microcontroller for this project in a DIP40 package. For viewing the amplified microphone signal, I also decided to implement a basic VU (Volume Unit) meter with some 5mm LEDs.
After planning out what the technical concept of the badge would be, I started thinking about the far more important aspect: the ~ aesthetics ~.
I wanted the badge to somehow tie in with the event overall so I decided to lay everything out around the head of the mascot: Bolt! I think this actually worked out really well with the overall design since I was able to utilize the DIP40 package of the PIC as a mouth, the gain pot and mode switch as the eyes, and the VU meter LEDs as the forehead/eyebrows.
PCB DesignI'm gonna gloss over this section since I lifted the microphone input circuit directly from the application note and the rest of the board is just LEDs connected to GPIO pins. However, there was one "gotcha" moment when I was reviewing the connections for the (2) op amps and ADC that I would like to share with the class.
Initially I had thought no connections external to the MCU would be necessary as I figured there would be some sort of MUX internal to the device to route the output of one op amp to the input of another and the output of that op amp to the ADC...WRONG. The PIC16F17576 does not have any internal method to provide these connections so they must be made externally on the application PCB. This was pretty surprising to be as I found other devices such as the PIC18-Q71 series which has the same OPA peripheral with the internal mux.
Thankfully I somehow avoided stepping on that rake based on my last minute spot check by configuring the peripheral in MPLAB and noticing no OPA output connection options to the ADC. This was definitely a good reminder to never assume peripherals are implemented in the same manner, even in the same device line!
Mechanical DesignIn order to further build on the aesthetic, I decided to enhance the badge by adding some 3d printed accents to the mode switch / gain pot and the DIP-40 mouth.
After a little 3D printing and hot glue engineering later, our mechanical upgrades were ready!
PCB AssemblyOnce my boards arrived from PCBWay, I quickly assembled everything so I could get cracking on software. I designed this board to use 100% through-hole components to make assembly quick and easy. Plus I figured there might be a possibility others would like to attempt this project in the future...
After getting everything assembled and powered up for the first time without releasing the magic smoke, I was ready to start putting together the software side of things!
Software DesignAgain, I'm going to skip through most of this since the majority of my time was spent configuring the OPA and ADC peripherals in MCC and playing around with sleep settings / disabling peripherals to reduce current consumption from our coin cell. I used the Nordic PPK2 for measuring the current consumption along with this neat coin cell emulator breakout I found on Tindie to plug directly into the Keystone 3035 holder I added to the board while I tried different sleep configurations.
Unfortunately I found through this testing that the quiescent current is dominated by the microphone leakage through the bias resistor as I unfortunately didn't think of adding a FET to disable it when the badge is in sleep (doh!). Thankfully this thing only needs to stay alive for the few hours I will be at the convention but I would definitely recommend others to fix this if you implement the circuit on your own device! Save the coin cells!!!
After figuring out the power management side of things, the OPA and ADC stuff was pretty straight forward. Once you configure the necessary registers in MCC and generate the initializers, the op amps are basically isolated devices that can function independently without any intervention from your application code. After I setup the inverting configuration and gain I was able to confirm the functionality by viewing the output with an oscilloscope!
Once I had all my basic pin/peripheral configuration complete in MCC, I just needed to prepare some application code with a hardware timer to periodically sample the ADC input connected to the op amp output and map the 12-bit digital output to our 7 VU meter LEDs. I also implemented some basic sampling logic to collect 10 samples and calculate the P2P from min/max value as this is an audio signal.
Honestly, I don't really have any plans to put in more work on this specific board since I am pretty satisfied with the end result as it stands. Though, I did add (3) additional LEDs to the "nose" of Bolt that I'm currently not using so I might add a 3-bit binary up counter or a cool fading sequence or something just because...
I currently plan to also attend Open Sauce again next year so be sure to watch out for another project like this in 2027!!




Comments