Tons of noise while reading from SD card

brispo

Active member
Give a listen to the attached audio sample.

I'm trying to build a break music player with the teensy to fit inside of my guitar, I'm powering the Teensy off of the 9v battery in the guitar's preamp, going through a buck converter first before power goes to the Teensy. As soon as I start playing a .wav from the SD card, this noise begins. To be clear, at the beginning of the file when there is no song, but noise, the volume of the song is all the way down. Pushing a button fades the music up, but the noise can be heard even over the music.

When I disconnect the teensy from the 9v power supply, and power it with a usb cable from my laptop, there is no noise. So that indicates to me that it's a grounding issue with my circuitry, but I've been working on this device for weeks and I'm pretty confident I have it grounded properly.

Can anyone help point me in the right direction for troubleshooting?
 

Attachments

  • My recording 21.zip
    216 KB · Views: 7
Could the noise come from the buck converter? Have you tried a 5V powerbank for the Teensy just for comparison?
 
I don't have something like that on hand, though I might be able to rig something up with AAs.

If it were the buck converter though, wouldn't the noise be consistent? The noise is only present while the SD card is active...
 
I understood your post and was reading:
1) powering the Teensy from the buck converter -> noise during SD playback
2) powering the Teensy from Laptop-USB -> no problmes with noise during SD playback
which brings up the question if the buck converter (or maybe the wiring / grounding with it) could be the cause of the problem.

At the same time it will be a good question why the noise is only present during SD access.
 
I don't have something like that on hand, though I might be able to rig something up with AAs.

If it were the buck converter though, wouldn't the noise be consistent? The noise is only present while the SD card is active...
Noise being modulated by bus activity is quite common - when I build things on my work laptop, I can tell by the sound when the build is finished.
 
I think @TomChiron is right ,it could be the buck converter can't stand all the power when the sd card is writing,
try to evaluate the power and the voltage down (with the buck converter) used by your system,using an USB meter,
or a multimeter.
 
Noise being modulated by bus activity is quite common - when I build things on my work laptop, I can tell by the sound when the build is finished.
Hmm any way to mitigate this noise? It's clearly bus activity. The pattern of the noise changes as one song ends and the next song is started, then returns to the normal noise pattern.
 
This is the buck converter I'm using:


They have a little pot to manually adjust the out voltage, or you can cut a trace on the bottom and solder together a pad for a fixed 5v voltage, which is what I did.

Perhaps if I try the pot with another buck converter and give the Teensy a bit more voltage than 5v? Maybe like 5.5? Would that possibly help?
 
I think @TomChiron is right ,it could be the buck converter can't stand all the power when the sd card is writing,
try to evaluate the power and the voltage down (with the buck converter) used by your system,using an USB meter,
or a multimeter.
Meaning I should measure the voltage at the output of the buck converter with a multimeter while the Sd card is reading?

Update: I just tried this measurement. Before turning on the SD card, the voltage measured on the output pins of the buck converter goes between 4.97 and 4.96v. Once the SD card begins reading, the voltage reads exactly the same, 4.96-4.97v.

Eh, I just tried a different model buck converter, hooked up farther away from the teensy circuitry, and it made no difference. Increasing the output voltage to 5.5v didn't change the noise at all either.
 
Last edited:
I think buck converters use frequency oscillators to divide or multiply the voltage ,if i'm not all wrong and need to be filtered more,
it's more critic if it seed the preamp and teensy together,maybe the buck feeding the teensy,vamp the power that your preamp needs
and disturbate the process.
 
The preamp get 9v directly from the battery, and the battery also is connected to the buck, which supplies power to the Teensy, so the buck doesn't power the preamp directly.
 
i was thinking the inverse,the buck is feeded by the battery yes,,but could vampirise the power dedicate to the preamp,
the buck can also emitting frequencies all around and the preamp can listen to that,why not placing a buck near, while you are
wired to your laptop,to determinate if there is aerial noise from the buck.
 
Hmm that's good thought to troubleshoot, unfortunately my vacation is nearing it's end and I need to return the guitar to a functional configuration for now.

Since I've been having this noise issue, which I'm fairly convinced stems from the fact that I'm powering both the Teensy and the preamp from the same power supply, some sort of ground loop issue is inherent in my circuitry design. Now I'm thinking that maybe the best way to avoid these issues is to remove the preamp altogether, and figure out a way that the Teensy can handle the signal conditioning for the guitar's pickups and act as the preamp. That way, I'd only be powering a single device (the Teensy) from the battery, and not both the Teensy and the preamp. That's going to take a LOT of thought and planning though, and I probably won't be able to devote any serious thought to that idea until later this year...
 
I'm powering the Teensy off of the 9v battery in the guitar's preamp
That is unlikely to be powerful enough and could be dropping out, SDcards pull a _lot_ of current(*), more than is sensible for a low current battery like a PP3 7V alkaline... Separate digital and analog power is strongly advised for the reasons you are experiencing too.

(*) That's why they are hot after use.
 
That is unlikely to be powerful enough and could be dropping out, SDcards pull a _lot_ of current(*), more than is sensible for a low current battery like a PP3 7V alkaline... Separate digital and analog power is strongly advised for the reasons you are experiencing too.

(*) That's why they are hot after use.
I don't remember if I mentioned earlier, but I'm using the SD card on the Audio Adaptor board, which is plugged directly on top of the Teensy. How would I even go about powering the SD card separately if all the pins between the Teensy and the Audio Adaptor are connected?
 
I think you can wire and use your guitar directly into the teensy and use an amp object from the audio editor,
i did this with a cardioid mic,and had enough sound level at the output,but a little humming,surely because a leak
of impedance adaptation.
 
I think you can wire and use your guitar directly into the teensy and use an amp object from the audio editor,
i did this with a cardioid mic,and had enough sound level at the output,but a little humming,surely because a leak
of impedance adaptation.
Yeah I think it's definitely doable, though my stock preamp has additional features aside from preamplification that I'd probably want to recreate, such as a tuner, Bass/Mid/Treb adjustments, sweepable notch eq filter, phase inverter, and volume control.

Would probably turn out to be a pretty big project, but one I'd be interested in working on next time I get a big chunk of free time.
 
General comment: the additional features that you mention should all be fairly easy to implement using the Teensy, where most of these items are available directly in the stock audio library objects. And while you're at it, you may find additional capabilities that will also be easy to add/implement.

Good luck & have fun !!

Mark J Culross
KD5RXT
 
Hmm that's good thought to troubleshoot, unfortunately my vacation is nearing it's end and I need to return the guitar to a functional configuration for now.

Since I've been having this noise issue, which I'm fairly convinced stems from the fact that I'm powering both the Teensy and the preamp from the same power supply, some sort of ground loop issue is inherent in my circuitry design. Now I'm thinking that maybe the best way to avoid these issues is to remove the preamp altogether, and figure out a way that the Teensy can handle the signal conditioning for the guitar's pickups and act as the preamp. That way, I'd only be powering a single device (the Teensy) from the battery, and not both the Teensy and the preamp. That's going to take a LOT of thought and planning though, and I probably won't be able to devote any serious thought to that idea until later this year...
Ground loops usually create a constant low frequency hum, not a high pitched clicks, which also are synced to the SD card reads. It sounds like a poor power decoupling. One potential weak point for the grounding might be the Jack Ring + battery minus connection used to power off the circuit when there is no cable plugged in. Temporarily connecting the battery minus directly to the GND will tell if this is the spot causing the issues.

A battery like the 9V block (alkaline?) has a higher output impedance than a power adapter output. With current draw spikes produced by the switching voltage regulator it will sag down a bit, repeating the current draw "waveform/noise" on the whole 9V bus, which is powering the preamp and polluting all the audio path.
On top of that, this is a 3A step down regulator. These controller chips usually have a low power mode (load under ~100mA or so), called pulse skipping mode. Could be that reading a file from an SD card + Teensy's normal power draw causes the switching controller to jump between the normal PWM and low power mode and this is creating the audible noise.

I'd try adding more decoupling capacitance, 100uF-470uF/16V right after the 9V battery and also 100uF on the 5V bus after the DC-DC converter. See if helps or at least has any impact on the noise sound. Capacitors should preferably be a low ESR ones. Good idea woild be to decouple the preamp with an LC filter. Something like this:

gpwr.gif

Is the audio output of the Teensy mixed with the preamp and send via one jack?
Another test would be to have the Teensy output left unconnected, while being powered from the 9v+DC-DC, then to play something from the SD card and observe if there is noise on the guitar output (preamp). If the output is noisy, it's coupled via the 9V bus, more capacitance should help.

I'm afraid a 9V block battery will not live long in this application. If putting a Teensy into a guitar, i think i'd go another route: use a recharchable LiPo with a buck/boost converter to create 3.3V (powering Teensy via 3.3V needs some precaution), as there is no point to boost it to 5V just to be regulated down back to 3.3V on the Teensy board. Then use a small boost (charge pump) to create 9V for the, presumably low power, onboard preamp. And finally, do not forget to recharge your guitar before starting to play it ;)
 
Is the audio output of the Teensy mixed with the preamp and send via one jack?
Yes, the under saddle piezo pickup in the guitar goes into the guitar's preamp, then the output of the preamp, instead of going to the output jack on the guitar, goes into circuitry I designed that contains the Teensy. So the guitar output is fed into the Teensy via Line In, is mixed in the software with the SD card music, and the combined signal is send from the Line Out on the Teensy Audio Adaptor shield to the actual output jack on the guitar.

Yeah I'm aware that a 9v isn't the best option for this application, but I did some tests and a 9v powering both the Teensy and the Preamp only drew something like 60mah, which is low enough for a battery to last for a few shows, and I usually use rechargeable 9vs, so it's serviceable.

The more I think about it, the more I'm thinking that the most sure-fire way to eliminate a lot of these noise issues would be to have the Teensy also serve is the guitar preamp, and do away with the original preamp altogether. I could then devise a more appropriate power solution (though I'd still want to stick with some kind of swappable battery(s), so I can have a fully-charge backup available, and just swap it when one battery starts to drain.) Having all the audio processing done with just the Teensy would eliminate a second circuit, and SHOULD resolve a lot of these noise issues, right?
 
Maybe your piezo mic is perturbated by the emission of the frequency coming from the buck,if it's near,
one solution also doable is to make a little 9v>5v regulator 7805 like this:
7805 regulator.jpg


But you have to be over 7v at the input to make it decently work!
 
Having all the audio processing done with just the Teensy would eliminate a second circuit, and SHOULD resolve a lot of these noise issues, right?
I tend to think it won't. It can be tested, though, assuming Teensy is powered from the 9V battery + DC-DC:
1. Unplug the piezo preamp output from the Teensy Line in. Connect the Teensy audio Line outputs to the amp/audio interface to hear the output,
2. Play something from the SD card
If the noise is present on the output it means the Teensy is producing it, piezo + preamp are disconnected.
If there is no noise without the piezo preamp plugged into the Teensy Line In, but it shows up as soon as you connect it, it means it comes from the piezo preamp. Most likely due to 9V rail being polluted with the switching noise.

Replacing the piezo preamp with the Teensy is certainly possible and opens a lot more new possibilities, like more FX, compressors, reverb, chorus etc. The piezo pickup require a special preamp to get the best sound. The line input of the SGTL5000 codec is not well suited for that task - way too low input impedance.
 
I tend to think it won't. It can be tested, though, assuming Teensy is powered from the 9V battery + DC-DC:
1. Unplug the piezo preamp output from the Teensy Line in. Connect the Teensy audio Line outputs to the amp/audio interface to hear the output,
2. Play something from the SD card
If the noise is present on the output it means the Teensy is producing it, piezo + preamp are disconnected.
If there is no noise without the piezo preamp plugged into the Teensy Line In, but it shows up as soon as you connect it, it means it comes from the piezo preamp. Most likely due to 9V rail being polluted with the switching noise.

Replacing the piezo preamp with the Teensy is certainly possible and opens a lot more new possibilities, like more FX, compressors, reverb, chorus etc. The piezo pickup require a special preamp to get the best sound. The line input of the SGTL5000 codec is not well suited for that task - way too low input impedance.
Good idea about removing the preamp from the circuit to determine if the buck converter is the culprit, or is the nose due to unwanted interaction between the preamp and the Teensy. I'll look into it.

I was thinking that connecting the Piezo under saddle pickup to the mic input on the audio shield instead of line in, might work without additional components? I need to do more research on what is required to condition the high-impedance input of the Piezo through.
 
Mic input will be even worse in that regard.
This might work as a crude and lo-fi solution (piezo is used as sensor there, not a mic) if plugged into the mic input.
I'd increase R1 to 470k.
That's a great article! It seems like the conditioning circuit required for the Piezo pickup is simple enough. Would the circuit be any different for this Piezo vs a disk Piezo:

1000004586.jpg


This is the exact pickup I'm currently using, which connects to my LR Baggs preamp. I'm weary to cut that cable, but I could solder up a small perfboard with a jack to plug it into, which would condition the signal with the jfet and resistor, then output to the Teensy Audio Shield Line In.

Would that be on the right track?
 
Back
Top