Clean up power supply noise Teensy 4

Status
Not open for further replies.
There is some information in this document illustrating different circuits, amongst other things, dealing with piezo sensors.

Thanks I will read it. However I think I’m getting squeeky clean signals other than the idle voltage problem which is probably a limitation of the teensy reference voltage.

I will test it when I get the voltage reference IC’s in a few days.

I will post a picture of the waveforms I’m getting when I get home.
 
It takes the full range of + and - piezo outputs and compresses it down to the 0-2V range. Piezo outputs near zero cause large voltage output changes and piezo outputs near min and max cause little output voltage change - a logarithmic response. Piezo parameters change the values and output range, but I think it's about what you want.
 
It takes the full range of + and - piezo outputs and compresses it down to the 0-2V range. Piezo outputs near zero cause large voltage output changes and piezo outputs near min and max cause little output voltage change - a logarithmic response. Piezo parameters change the values and output range, but I think it's about what you want.

Yep thats it. So it will not have a linear response up to 0.7v or something weird like that? Any way to control the amount of the curve? How compressed it gets?
 
You can tweak the circuit once you know the piezo parameters. A 100K resistor in parallel with the diodes will change the slope at zero piezo output. You
might prefer the curves of BAT54 diodes.

The circuit you linked is similar, but will produce more like 0-1V.
 
Last edited:
The circuit you linked is similar, but will produce more like 0-1V.

Yes but the piezo voltage is more like -10 to +10v around vcc/2 so it might give me 0-3.3v i to the op amp.

Also it seems you control the voltage swing with the resistor in series with the diodes.

I will try both and see what works.
 
Last edited:
When designing a PCB that the teensy4 gets soldered onto, should I leave the unused pins unconnected? I’m only using the ADC pins and 3.3v/ground pins.

I only use one ground pin and I’m not sure if the unused stuff should be connected to the ground plane or left away from it.

Thanks.
 
I'm interested knowing if you detect any noise difference with all unused pins set with pinMode(xxx, INPUT_PULLUP) vs the default UNUSED.
 
I'm interested knowing if you detect any noise difference with all unused pins set with pinMode(xxx, INPUT_PULLUP) vs the default UNUSED.

I will have to test. I’m designing a new pcb with only surface mount components and it’s much smaller so all loops should be smaller. Will see if there is any difference. Star grounding seems pretty impossible though. I’ve paid much more attention to current return paths. However I’m not sure I know what I’m doing.

The old pcb has a ground plane on the whole board including where the teensy pins are but they are not connected to it.

Since this noise is low frequency, I’m thinking it’s a ground loop problem but the weird thing is that it increases when the USB is used so it definitely has an effect.

I should also add that the noise is maybe +/- 7 values. The maximum signal is +/- 35000 or so. This is after filtering and the values are doubles. Maybe I’m just asking for too much. There is plenty of resolution and signal to noise. I’m just thinking since I didn’t use any noise decoupling I could get even better results. It’s certaintly good enough. It’s just a shame because if there was none of this low frequency noise the noise floor would be maybe +/-3 or so.
 
Nope, that made no noticeable difference. Neither did pulldown.

I loaded up a fresh teensy4 without any circuit. Just sampling the empty analog pin has more noise than my circuit. Why is that.

I think this is as good as it's going to get with a teensy4. I'll just make another PCB with the voltage reference and some bypass caps on the op amps and be done with it.

Is there any way to power my circuit from the 5V coming from the USB?
 
You could use two series 2K resistors from 3.3V to ground and connect the midpoint to an ADC input. This should be about as good as possible - reported to be about 10 bits (without using a trimmed mean).

I expect that different inputs have slightly different noise levels.
 
You could use two series 2K resistors from 3.3V to ground and connect the midpoint to an ADC input. This should be about as good as possible - reported to be about 10 bits (without using a trimmed mean).

I expect that different inputs have slightly different noise levels.

Ok thanks. How exactly do you calculate how many bits? I'm guessing it should be dividing the max value with the noise value and then if it's about 1024 it's 10 bits.
 
Ok, so I got a voltage reference in the mail, the LM385Z https://www.ti.com/lit/ds/symlink/l...94048&ref_url=https%3A%2F%2Fwww.mouser.com%2F

I hooked it up to my breadboard circuit and this does not seem to work. I'm only getting positive values from the piezo. The reference is at 1.2V and I only get positive spikes from 1.2v up to 3.3V. I replaced the virtual ground in my circuit with this voltage reference. Am I missing something? I seem to be getting a stable 1.2v but the piezo signal is not behaving as it should.
 
Ok, so I got a voltage reference in the mail, the LM385Z https://www.ti.com/lit/ds/symlink/l...94048&ref_url=https%3A%2F%2Fwww.mouser.com%2F

I hooked it up to my breadboard circuit and this does not seem to work. I'm only getting positive values from the piezo. The reference is at 1.2V and I only get positive spikes from 1.2v up to 3.3V. I replaced the virtual ground in my circuit with this voltage reference. Am I missing something? I seem to be getting a stable 1.2v but the piezo signal is not behaving as it should.

The Texas Instruments manual for some reason showed the pins from upside down view. Voltage reference is working now.

However the problem was not the voltage reference or the circuit. Basically I was pushing the ADC too hard. I was reading at 12 bits with 4 averages with HIGH_SPEED in the ADC library. 10 sensors at 50kHz each.

I'm using a bit more averaging and the noise is much less. Frequency is 28.5kHz and 10 bit but when using doubles and some filters the noise is non existant and resolution is very good anyway.
 
I have now switched to using a voltage reference and I have a question about overvoltage protection.

The op amp inputs in my circuit are protected with resistors so there should be no currents anywhere close to the specified max current of 10mA into the inputs.

However the piezo is directly connected to the voltage reference output to one side of the piezo. The other side of the piezo is also connected to it but there is a resistor between. How do I protect the voltage reference from an overvoltage from the piezo which can swing up to several tens of volts probably when the reference is connected to 0-3.3V?

Is it even necessary? The reference is always at the reference voltage no matter the voltage the piezo outputs.

I can’t connect a resistor to the voltage reference because I get 60hz oscillation and then there is no point to using a voltage reference.

Or maybe I can compensate for it by increasing the resistor in the feedback loop of the op amp by the same amount.

(BTW the solution to the problem of the 60hz oscillation was to balance both inputs to the op amp so adding an equal feedback resistor as the non inverting input impedance).
 
Status
Not open for further replies.
Back
Top