Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 46

Thread: Clean up power supply noise Teensy 4

  1. #1
    Senior Member
    Join Date
    Jan 2020
    Posts
    216

    Clean up power supply noise Teensy 4

    Hello!

    Iím wondering what I can do to clean up the power supply noise/ripple. Iím using some piezo sensors with a virtual ground circuit. I buffer the sensors and virtual ground with op amps and Iím getting pretty clean signals after digital filtering but Iím wondering what I can do to clean stuff up electrically to get the best possible signals as I didnít use any capacitors anywhere in the circuit.

    Iím thinking to put a 0,1uF and 10uF on the op amps power input to ground.

    Also maybe a 220uF between 3.3v and ground on the teensy.

    The virtual ground is a voltage divider with two resistors to create a halfway point between 0-3.3v. I also put this through an op amp before going to the sensors.

    Should I put a capacitor there as well?

    Is there any point to put a ferrite bead on the power supply to make sure any digital switching stuff on the teensy doesnít find itís way to the analog circuit?

    Also since the PCB will be submit to vibrations, Iím thinking I should avoid ceramic capacitors because of piezoelectric effects. What other choises besides ceramic capacitors do I have.

    Any advice?

  2. #2
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    999
    Add bandpass analog filtering before ADCs.
    For a virtual ground, use an op amp or "rail splitter" that allows lots of output capacitance
    Low impedance sources
    Keep loops small
    Use balanced/differential signals all the way into the ADC

  3. #3
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    Quote Originally Posted by jonr View Post
    Add bandpass analog filtering before ADCs.
    For a virtual ground, use an op amp or "rail splitter" that allows lots of output capacitance
    Low impedance sources
    Keep loops small
    Use balanced/differential signals all the way into the ADC
    Any advice for a specific op amp for the rail splitter? Iím not splitting exactly at half the voltage, I want the negative part to have a bit more resolution. I can allow the positive part to clip a little.

    What do you mean by balanced/differential signals to the adc? I need to read up on that. Iím using a ground plane and trying to keep power traces away from signal traces.

    By low impedance sources, do you mean to buffer the signals from the piezos with op amps? Iím already doing that.

    The thing I really want to get rid of is the small lower frequency variations which I think are happening at the virtual ground. It seems if I use higher resistors for the rail splitter I get more low frequency ripple. However this is on a breadboard. Itís an much less on the pcb prototype.
    Last edited by frankzappa; 05-29-2021 at 01:37 PM.

  4. #4
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    999
    > any advice for a specific op amp for the rail splitter?
    Just check the op amp specs for what you want, especially how much output capacitance it can tolerate.

    I've attached a LTSpice circuit that demonstrates noise. Note that a properly done differential signal can reject massive amounts of common mode noise and ground shift. And a low pass filter helps with high frequency noise.

    differentialADC.zip

  5. #5
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    This is like ten levels above my electronics knowledge which is basic at best. I downloaded spice and I figured out how to run a simulation and probe the different parts of the schematic but I don't really know how to use this information. I'm using all available 10 inputs for 10 sensors. If you mean to connect the ADC in pairs and use them as differential ADC's then this is not really possible because I'm using all 10 analog inputs.

    I will have to dig deeper into this spice simulation thing, I've only heard about it but never thought about simulating my circuit.

  6. #6
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    BTW, I have a ground plane on my circuit. I noticed I have the ground plane of the circuit running under the teensy. Is that a bad idea? The teensy is raised off the board because it's soldered with the included header on to my PCB. I didn't think about that when drawing the PCB.

  7. #7
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    999
    Agreed, the need for many analog inputs precludes the ADC differential mode. But when you don't need more than 1 or 2 inputs, differential mode should be the standard method if noise is a concern.

  8. #8
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,110
    I can't see the circuit being discussed... Different opamps have different decoupling requirements, so
    which opamp?

  9. #9
    I learned a long time ago that electrons are notional little things that will go where they want to rather than where I think they should go. Details matter and schematics rarely show enough of it. Ground planes provide a low impedance path but it isn't always the path you need.

    Every opamp should have a capacitor on its power pins. They are happier that way.

    The voltage regulator has a low output impedance. (Varies between device types and rolls off with increasing frequency.) So star distribution schemes (power and ground) tend to have the lowest noise because the regulator shorts out the noise that it sees.

    For best results, every ADC input should have a presample filter that removes all content below the Nyquist frequency. Brick wall filters don't exist so I like to use filters with a corner frequency 1/10th the sample rate. Filter order depends on how paranoid I feel at the time. Second order minimum. Bessel response if you value phase response.

  10. #10
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    Here is a screenshot of the schematic for my prototype board which does not have any bypass capacitors and the virtual ground is not buffered. I used two 150ohm resistors which I realise is very low but it gave me a much cleaner virtual ground. Maybe this won't matter if I buffer it. Also I added a 10uF capacitor on the virtual ground but it doesn't seem to do anything.

    https://www.dropbox.com/s/6ukuf108fyqnu2q/sch.jpg?dl=0

    A0 - A9 are connectors/inputs for the piezos.

    RP0-RP9 are potentiometers that adjust the amplitude of the piezo signals that go into the op amps.

    Nevermind the potentiometers, they are not wired properly on this picture. The other end will go to the virtual ground and the wiper will go to the output so I can adjust the amplitude without affecting the low cutoff frequency of the piezos.

    The OP amps I used are TLC2264 https://www.ti.com/lit/ds/symlink/tl...ct%252FTLC2264 but I discovered they are not rated for 3.3v so will use something else (they seem to work fine though).

    I noticed the TLC2264 don't go rail to rail on the positive signals, only negative. so will try something else. TI suggests the OPA4990 https://www.ti.com/lit/ds/symlink/op...ct%252FOPA4990

    I will try some MCP6004 in the meantime because I have them in my local store.

  11. #11
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    Quote Originally Posted by UhClem View Post
    I learned a long time ago that electrons are notional little things that will go where they want to rather than where I think they should go. Details matter and schematics rarely show enough of it. Ground planes provide a low impedance path but it isn't always the path you need.

    Every opamp should have a capacitor on its power pins. They are happier that way.

    The voltage regulator has a low output impedance. (Varies between device types and rolls off with increasing frequency.) So star distribution schemes (power and ground) tend to have the lowest noise because the regulator shorts out the noise that it sees.

    For best results, every ADC input should have a presample filter that removes all content below the Nyquist frequency. Brick wall filters don't exist so I like to use filters with a corner frequency 1/10th the sample rate. Filter order depends on how paranoid I feel at the time. Second order minimum. Bessel response if you value phase response.
    Any guidelines for the capacitor values on the op amps? I was thinking a 0.1uF and a 10uF?

    I'm using digital filtering which seems to work well and gives me great signal to noise ratio. I ditched all analog filters in the circuit it was not needed.

    What I need to get rid of is what I think is a 60Hz ripple. Don't know where it's coming from. Adding bigger resistors on the virtual ground seems to amplify it a lot.

    Star pattern for the return ground seems tricky to pull off. I will see if it's possible.

  12. #12
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    999
    Here is a LTSpice circuit to show what happens to 60Hz supply noise if you change from .1u to 500u on the virtual ground capacitor:
    Attached Files Attached Files

  13. #13
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    I can't see the attachment/link. Although I can imagine what happens. It should disappear. I guess bulk capacitors is what I need.

  14. #14
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    999
    You will have to try it. Spoiler: it might make you lean towards using a series voltage reference (eg, LT6656) for your virtual ground.

  15. #15
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    Quote Originally Posted by jonr View Post
    You will have to try it. Spoiler: it might make you lean towards using a voltage reference for your virtual ground.
    Can you send the attached file again? I can't click on it.

    I've been looking at those voltage reference IC's, I'm looking for a suitable one. I saw that one was rated as below the precision of a 12 bit adc so that's promising but it was for 5v circuits. I need to find one that is powered by 3.3V.

  16. #16
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    999
    Added voltage reference:

    VGND-noise.zip

  17. #17
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    Ok, I've realised that the problem is probably the teensy4s internal reference voltage. If I use small resistors for the voltage divider, say 150ohm or so, the ripple disappears but there is still some kind of ripple left which is less periodic. Using a voltage reference for the virtual ground will probably help but will not get rid of it.

    There is a voltage reference from Texas instruments which outputs both 3.3v and 1.65v. I will try it to power the op amps from the 3.3v and virtual ground from the 1.65v.

  18. #18
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    This is really disappointing. Iíve spent like a year working on this project. Learning how to program from scratch and now I have to find another microcontroller.

    What other options are there that have the same speed?

  19. #19
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    The only other solution I see is to make a logarithmic amplifier since I already have to convert the piezo signal to logarithmic in software.

    This adds a lot of complexity to the circuit but should solve this problem as long as a stable voltage reference is used for the virtual ground and the rest of the circuit.

  20. #20
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    Can anyone suggest how to modify this circuit to give me only a log response?

    http://www.audiodesignguide.com/doc/..._amplifier.jpg

    Do I need 4 diodes if I donít need to switch from exponential to logarithmic? Maybe half of it will suffice?

  21. #21
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    999
    Perhaps something like this, which can handle a wide range of positive and negative voltages while producing a 0-2V output.

    LogAmp.zip

  22. #22
    Senior Member
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    301
    Quote Originally Posted by frankzappa View Post
    Can anyone suggest how to modify this circuit to give me only a log response?

    http://www.audiodesignguide.com/doc/..._amplifier.jpg

    Do I need 4 diodes if I donít need to switch from exponential to logarithmic? Maybe half of it will suffice?
    Did a google search and found this.

  23. #23
    Quote Originally Posted by frankzappa View Post
    The only other solution I see is to make a logarithmic amplifier since I already have to convert the piezo signal to logarithmic in software.
    A charge amplifier is the usual thing to use with a piezo sensor.

  24. #24
    Senior Member
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    301
    There is some information in this document illustrating different circuits, amongst other things, dealing with piezo sensors.

  25. #25
    Senior Member
    Join Date
    Jan 2020
    Posts
    216
    Quote Originally Posted by UhClem View Post
    A charge amplifier is the usual thing to use with a piezo sensor.
    The difference as far as I can tell is that the capacitance of the cable can mess with the low cutoff frequency with a voltage mode circuit. My cables are 20cm so not going to have an effect. I can control the low cutoff with the value of the potentiometer.

    Is there any other advantage to a charge mode amplifier? As far as I understand I would have to have the op amp powered with a voltage that is like 30v or something because the piezos produce high voltages. With the voltage mode circuit I use I can control the voltage going into the amp with the potentiometer.

    Also the problem is not the piezo response or circuit noise. Iím fairly certain itís the teensy4ís reference voltage problem. I can see digital oscillations of some kind. Especially if I transmit a lot of data over USB.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •