Author Topic: Pi-stomp with a mic preamp  (Read 831 times)

ReneMadeira

  • Newbie
  • *
  • Posts: 24
    • View Profile
Pi-stomp with a mic preamp
« on: February 15, 2022, 08:07:20 AM »
Hello, everyone!

   Since I’ve been posting in other threads about what I’m trying to implement with pi-stomp, I decided to write a dedicated thread to talk about my idea.

   I intend to use the pi-stomp for vocals and guitar, but also want it to be flexible to fit into other scenarios that may come up in the long run.

   Below is the list of features that I plan to make different from the standard design:

1) A mic preamp inside the enclosure
   I chose the “famous $5 preamp” design and bought a PCB from a UK supplier on ebay. It's a balanced preamp, and it requires a dual (positive/negative) voltage power supply, which will be a challenge. If anyone is interested, there is a lot of information about this preamp on the web by searching “famous mic $5 preamp”, which is based on the typical applications section of the INA 217 datasheet.
   The preamp will be available on input #2 (Right channel), and there will be a pot for mic gain control. There will be a lever switch to choose the audiocard input from the output of the pi-stomp preamp or the mic preamp, and also turn off mic preamp when not in use.
   For ease of use, the preamp power shall come from the same PSU as the pi-stomp. For this I have two options:
   - An external PSU of ~18V with an internal board to step down to 5V/3A for the pi-stomp, and a divider to -15/0/+15V to the preamp.
   - An external 5V PSU to pi-stomp, and a board to step-up/divide to power the preamp at -15/0/+15V.
   I bought prebuilt boards for both options, but I’m still waiting deliver, then I’ll see which option is better. I prefer the second approach as there are fewer components and the conversion only takes place in the preamp, which requires very low current.

2) 5 footswitches with a led to each one
   The two extra leds will come from the unused 5-pin midi ports, as explained in another thread here on the forum.

3) 3 analog control knobs. I may put more, depending on what will fit inside the enclosure.

4) Expression pedal input
   The expression pedal input doesn’t really differ from the standard design but I’m thinking of hacking my cheap expression pedal to put a toe switch on it and a TRRS jack or another jack that provides 4 pins. The toe switch would be connected in parallel to footswitch #5 to enable a wah, for example.

5) Monitors out
   The pi-stomp outputs will be on separate mono jacks, so that they can be routed to different places as one should carry guitar signal, and the other the vocals.
   I plan to use the audio card's headphones as the monitor out, to connect to my personal monitor. It will have a stereo jack and a switch to select the output as stereo or to mix the signals into mono.
   I’m using resistors to connect the signals as seen in many audio applications forums, but I haven’t tested yet to see if it will work as intended.

6) 1590D enclosure
   It will take extra work to remove the central screws lugs, but I think it will worth it. Even though is a big enclosure, it will also be a challenge to fit everything inside it, and I’ll see how it fits once I have all the parts in my hands and test everything.
   For now, I've built a cardboard box the same size as the 1590D, and it looks like it will fit all I need. If it doesn’t fit, I may design and print an enclosure on my 3d printer and shield it with adhesive copper, like people do to shield the cavities of the guitars.

   It's a little difficult to get the necessary parts here in Brazil because most of them must be imported with long wait and taxes. Therefore, I may take a time to conclude it, but I’m already having fun with my guitar.
   To better organize the design, I made a schematic of it, and I provide attached in case anyone is interested.
   I’m also looking for the opinions and suggestions of the community, so please let me know if you have any questions or comments.
   Thanks for your interest and time if you've read this far.

ReneMadeira

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #1 on: May 09, 2022, 11:22:25 AM »
Hello!
A little update of this project.
I finally got all the components and assembled them in a bench to test.
I'm really impressed with the result of the preamp, very clean undistorted sound.
There is, unfortunately, a high pitch noise which I believe to be due to the switching psu.
I tried some boards for the simmetric power supply, and to my surprise, the one with the least noise is the smallest and cheapest.
The noise seems to come from the common 5V connection at the psu input, as it occurs even when the output of the simmetric psu is disconnected.
I'll test some filters for the circuit, but the noise is somewhat acceptable for live situations.
If someone has experience with filtering ripple noise and can give me directions, I'm all ears.
Regards,
Rene
PS: The psu I found to be the best is this one: aliexpress.com/item/1005002068396095.html

Randall (Admin)

  • Administrator
  • Full Member
  • *****
  • Posts: 211
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #2 on: May 09, 2022, 07:39:00 PM »
That's great news that you got it working.  Can't say I'm surprised about the noise.  Switching power supplies are just inherently noisy and I don't see much obvious filtering on that board (not a single electrolytic).

But you might first try to see if the noise is sneaking in via ground.  From your schematic, I see a ground loop.  Your preamp gets ground from both the power supply module and from the audio card, so it gets two references which could be a fraction of a volt different.  I had the same issue when designing the buffer circuit for pi-Stomp.  The solution was take the supply ground from the audio card, not from the main power supply input.  Looks like you could just eliminate that top ground wire (the one going from your supply board to your power LED and the pi-stomp), and see if the noise changes.  You could also tap the 5v not at the barrel, but from a 5v pin of the pi since at that point, it will have encountered some modest filtering (a capacitor or two to ground).  That would also be the correct side of the fuse.

Adding an RC or LC low-pass filter between your supply board and the preamp would probably be the next step.  Since you could probably afford some modest voltage drop and your current draw of the preamp is low, you could probably get the cutoff frequency super low.  Example: 100Ohm, 220uF => 7.23Hz.  Then you can get even better high freq cancellation if you add some smaller capacitors in parallel with the large electrolytic.  I'd try a 1 to 10uF (Oscon or other low ESR if you have one), and a 0.1uF ceramic.  But you could start by just strapping a large electrolytic across each power rail.

ReneMadeira

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #3 on: May 10, 2022, 08:39:17 AM »
Hello, Randall,

The ground trick really improved the noise levels.
It didn't work well to use the 5V from the GPIO, but worked with 5V from USB. I'll investigate it better since my bench is a mess at the moment, I may have done something wrong.
I'll try the RC filter, and come back with results afterwards.

By the way, comparing the noise levelsin the preamp with pi-stomp preamps, I can say you did an amazing job on the board!

Thank you!

ReneMadeira

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #4 on: May 16, 2022, 07:15:16 AM »
Hello,

I tested with the rc filters and it got the job done pretty well.
I also had to put an rc filter in the 5V inlet of the symmetrical power supply.
In the many tests I did, there was sometimes a very high pitch noise that I found to be from the pi-stomp preamp. It seems to be a very specific frequency.
Don't know exactly what triggered it, but to stop it I had to unplug the ac adapter and wait for a long time ~10min.
I believe that it was caused by connecting and disconnecting things on the fly, but one thing that surely caused it was when I tried to take the 5V for the symmetrical psu from the RPi GPIO. Have you ever faced it?

I'm very excited that my plans are going further.
Now there are minor things to solve:

- put the rc filters in a board.
- will the stereo/mono auxiliar output work as intended?
- will the toe switch on the expression pedal work?

After that, I'll start the work to get it into enclosure.
Thanks for the help up to now.

Regards,
-
« Last Edit: May 16, 2022, 07:28:28 AM by ReneMadeira »

ReneMadeira

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #5 on: May 16, 2022, 10:00:55 AM »
Ps: Do you have any tips for eliminating pop noise when switching input #2 from pi-stomp preamp to the mic preamp? It happens both ways, and at the moment the mic preamp is powered all the time.

Randall (Admin)

  • Administrator
  • Full Member
  • *****
  • Posts: 211
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #6 on: May 16, 2022, 08:10:16 PM »
Easiest thing to try would be pull-down resistors on both inputs to the switch.  The pi-Stomp buffer doesn't have one, call me lame.  Board area was tight so I eliminated it from the design.

This is by far the best (and most entertaining) explanation of switch pop I've ever seen.
https://www.mrblackpedals.com/blogs/straight-jive/6629778-what-really-causes-switch-pop
 

ReneMadeira

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #7 on: May 17, 2022, 06:50:30 AM »
I read this text yesterday when I was searching for this subject, very informative and fun, indeed.
I'll try it in the next iteration, but it is not a great deal. Even if it stay like this, all I have to do is mute the output prior to switching, or choose the right preamp before turning it on.
I'm providing attached a picture of the preamp.

ReneMadeira

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #8 on: May 30, 2022, 12:41:18 PM »
Hello,

I'm back with more news about the preamp.

After several tests, I believe I have defined the final version of the power supply circuit.
In order to have a noise reference, I supplied power to the preamp with 9V batteries like the original design (4 batteries to get +18/0/-18V), and it is really very quiet. Then I powered the symmetric psu with the 9v battery, and got impressed as the preamp presented the same behavior of when it was powered directly by the batteries. The DD1718PA does a really good job, as it's switching frequency is very high.
Given that, I concluded that the noise I was getting was from the wall wart, and had the idea to use LDO regulators, as the DD1718PA accepts inputs as low as 3V. I bought a little module with the AMS1117-3.3V already soldered and some filtering circuit, all smd, therefore very small footprint.
The noise got better than before with the power (filtered) from the wall wart, but there was still a not acceptable noise.
The next thing I accidentally discovered was that grounding is very tricky. Running another wire from the preamp ground to the audio card ground reduced drastically the noise. I believe that there was some problem with the cable I soldered to the board, as those jumper wires are very thin.
There were still a little noise, and I was playing with RC filters on the AMS1117 inlet, then I got minimal noise with an RC filter with a large capacitor ( I believe it was 2200uF) and an 8 ohms resistor (couldn't be a large resistor because the AMS1117 has minimum required input tension of ~4.75V).
The strange thing is that I removed the capacitor and the noise didn't change, then I removed the resistor and realized that it was really it that was improving the noise, checked many times to confirm. Is it something normal/reasonable?

Anyway, I'm attached the updated schematics.

Regards,
Rene

Randall (Admin)

  • Administrator
  • Full Member
  • *****
  • Posts: 211
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #9 on: May 30, 2022, 01:31:38 PM »
Sounds like you've done some great experiments and at least you're learning a lot.  Noise with switching power supplies and potential ground loops is tricky business.

Regarding the noise not changing, are you referring to the AMS1117 on the pi-Stomp board?  I also found that including a large electrolytic on the input of the regulator didn't improve noise.  Almost seemed to make it worse.  That's why I included a spot for C5 but don't recommend populating it.

Regarding why your resistor helps, it does create a low-pass filter with whatever capacitance is hanging off the regulator input, 0.1uF for the pi-Stomp board plus whatever internal or parasitic capacitance the regulator has, but still, that likely leaves the cut-off frequency well above 20k, so I can't really explain it.  If the resistor had some serial inductance, that would bring down the frequency.  1mH brings it down to about 5kHz.  If you did want to try an explicit inductor, that might give you the best results because it won't drop your voltage like a resistor.

ReneMadeira

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #10 on: May 30, 2022, 01:41:08 PM »
You are right, I'm learning a lot. :)

I tried using the pi-stomp's AMS1117, but I didn't want to solder a new wire to it, therefore ended up buying a little module with AMS1117.


Randall (Admin)

  • Administrator
  • Full Member
  • *****
  • Posts: 211
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #11 on: May 30, 2022, 09:50:07 PM »
Ah, well, if that module includes any capacitor across the input, then your 8 ohm resistor will make it a low pass filter.  So maybe that makes sense that the resistor helped but not the extra cap. 

ReneMadeira

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #12 on: June 20, 2022, 11:35:09 AM »
Hello,

Okay, I have the final result of my tests.
I bought some inductors to check if it would help, and it turns out that using a 10mH inductor in series with the 5V line eliminated the need for any other component for filtering, the noise is pretty low now.
Thank you for the guidance.

Now I have another issue.
There is a high pitched noise, apparently at a specific frequency whenever I turn the pistomp on.
It seems to come from the pistomp's preamp, as I could find by removing its connections from the audio card's input.
I've already tried some things:
- completely remove the mic preamp circuitry
- use different power supplies (included the one supplied with the kit)
- change cables and connectors

The only things that works are:
- short the 5V input to gnd briefly, then it reboots with no noise
- power it into the raspberry pi input, then disconnect and power into pistomp input (works some times)

It already presented this problem backwards, as I described here:

...Connected to the raspberry pi 4B power input, it behaves normally, without any noise, until a random moment when a whining starts.
The noise doesn't stop even if I reboot or unplug power and wait to turn it back on....
... the only solution was to power it from the pi-stomp power input....

I believe I may have broken something in the assembly or in the many tests I did, but I have no idea how to troubleshoot it. Do you have any clue?
I'll try to get an oscilloscope to find the noise frequency and I also can provide more information if needed.

Thank you,

Randall (Admin)

  • Administrator
  • Full Member
  • *****
  • Posts: 211
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #13 on: June 20, 2022, 12:12:05 PM »
Happy to try to help.  Since you have a customized build and I've not tracked what all you've done, could you summarize what your current configuration looks like now?  Include physical info as that matters too.  For any pedal, I don't assume I know the final noise profile until it's enclosed in grounded metal.

The fact that the noise will be absent with certain "modes" of the pi suggests the analog circuity is not the cause of the noise, it is simply susceptible to the noise.

I would never recommend shorting power to ground.  I've done that accidentally before with the end result being a dead pi.  If you have done that with the pi making the noise then that could be contributing.  There is a polyfuse and some power supply protection circuitry onboard the pi which I could imagine might not operate the same after one or more shortings.

Because there are sooooo many types of noise possible, it would be good if you could record the noise and share it.  Yes, finding the frequency content with a scope or frequency analyzer plugin in a DAW might help as well.

ReneMadeira

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Pi-stomp with a mic preamp
« Reply #14 on: July 28, 2022, 06:36:20 AM »
Hello pi-stompers!

I'm back after finishing my project and I have to tell that I am VERY satisfied with the results. It works exactly as I intended.

I'm providing a diagram of the final version to anyone interested.
The preamp pcb that I used can be found here: ebay.com/itm/114326622246, and the bipolar converter can be easily found by the name DD1718PA (yes, is that cheap, but works really well with the INA217).

About the noise issue, I discovered that it was some problem in my Raspberry pi that was injecting noise in the system, and everything worked flawlessly with a new pi.
As shown in the diagram, I installed an inductor in the 5V line from the power barrel to the DD1718PA. It helped reduce noise in the former situation with the defective pi, but I believe it should be no more required.
« Last Edit: July 28, 2022, 12:31:10 PM by ReneMadeira »