Teensie 3.2 EMI??

Status
Not open for further replies.

J-Ro

Member
I have built a project where I have a teensie 3.2 measuring 2 thermistors, totaling interrupts from a hall effect sensor (measuring a flow meter), and then sends the 2 temps and total counts (and a calculated flowrate) from the flowmeter over canbus using a TI CAN transceiver.

I posted about it previously in this thread:
https://forum.pjrc.com/threads/53153-Teensie-3-2-Max-Temperature

I've since fixed the power supply side of things described in the previous thread and have been having my flowmeters run problem free ever since...until recently

Recently I installed a UHF communication radio (450 something MHz), also powered by the car's 12V system, and I've noticed some strange behavior -- When the radio is transmitting, I show a higher flow rate on the flowmeter that is pretty close to the UHF Antenna. The fluid is in no way tied to if the radio is transmitting or not so the change of measured flow rate is an error.

I hooked my oscilloscope up to the input (between the hall effect sensors and the Teensie input pin) and I cannot perceive a change in the frequency of the square wave pulses even though the teensie is reporting up to a 3 times higher flowrate than just before the radio begins transmitting.

Here's the code in question:

void PulseCounter() {
IRQcount++;
}

TotalPulses = IRQcount;
if ((millis() - LastTime) >= 2000){
FlowRate = ((0.00013)*(TotalPulses-LastPulses) / ((millis() - LastTime) / 60000.0)) * 60.0;
}

I have the interrupt attached to pin 6, Falling. The circuit is 3.3v supplied though a 30K pull-up resistor to the input pin (pin 6) with the hall effect sensor pulling to ground for each pulse of flow.

So my question is this...If my input signal to the teensie seems unchanged and my outputted value over the CANbus is the variable "Flowrate" shown calculated above increases up to 3 times higher, what could be an explanation for this? I think its EMI because if I unplug the antenna from the UHF radio, I don't see the change in flowrate. I expected to see something with my Oscilloscope during radio transmission but I don't and that's why I'm confused on where to go next.

My Oscilliscope is only 100MHz, maybe that's a problem with seeing some sort of noise coming from the 450 something MHz UHF radio???
 
Maybe try adding a small capacitor, like 100 pF, between the Teensy pin and GND. Try to get it as physically close to the Teensy and GND as reasonably possible.

Maybe also add a ferrite bead on the signal wire near the Teensy.
 
Any chance the : " a higher flow rate on the flowmeter that is pretty close to the UHF Antenna "

Antenna is directly messing with the flowmeter's hall effect sensor? Causing it to detect 3X rate of flow change?
 
I ordered some Ferrite beads & 100 pf capacitor and will give those a try when they arrive later this week.

As for directly effecting the Hall effect sensor, Any ideas on how I could diagnose this? When I check the signal with my oscilloscope heading into the teensie it seems unaffected by the Radio but again maybe this is a limitation of my 100 Mhz oscilloscope???
 
I ordered some Ferrite beads & 100 pf capacitor and will give those a try when they arrive later this week.

As for directly effecting the Hall effect sensor, Any ideas on how I could diagnose this? When I check the signal with my oscilloscope heading into the teensie it seems unaffected by the Radio but again maybe this is a limitation of my 100 Mhz oscilloscope???

... is the sensor actually triggering and returning 3 times faster? :: "the teensie is reporting up to a 3 times higher flowrate than just before the radio begins transmitting"

A piece of foil between the sensor and the antenna might rule it out. 'before the radio beings' Would suggest removing the antenna would have no effect.
 
Any ideas on how I could diagnose this?

Maybe tell us or better show us with photos the sort of wiring you're using? If it's just loose unshielded wire, well, you can expect it to act like an antenna, especially if the GND wire doesn't run together very close with each signal wire.


but again maybe this is a limitation of my 100 Mhz oscilloscope???

Of course your 100 MHz scope isn't going to help diagnose at issue with 450 MHz RF.

The scope is also (probably) earth grounded, so from an RF antenna coupling perspective you're changing the whole system when you connect the ground clips of the probes.


I'm pretty sure you'll get the most results from the capacitor and ferrite bead (which goes between the pin+capacitor to the sensor - not between the pin and capacitor). If this is an open collector type signal and you're using a pin with INPUT_PULLUP mode (just a blind guess since we know so little of your design), try adding a real pullup resistor between the pin and 3.3V. Use a relatively low value, like 1K or even 100 ohms.
 
Last edited:
Couple of points from early days in RF.:
Any mismatch in the Transmitter>feedline>antenna arrangement can cause the feedline to radiate energy. Sharp bends in the feedline are best avoided.
Sensor cabling would be best run at right angles to the antenna feedline, keep them separate.
Ferrite suppression sleeves such as these https://hken.rs-online.com/web/p/ferrite-sleeves/8119133/ on both the antenna feedline and sensor cabling may be useful
Packaging the sensor in "lossy" (to RF) material such as stainless steel wool or copper kitchen scouring pads may be useful. I've seen Ham Radio nerds run feedline coax, central for several metres in PVC stormwater pipe and fill the empty space with steel wool to stop feedline radiation from interfering with other gear. IMHO, move them apart.
 
I'd like to follow up on this as this thread directed me to the the solution, it took me a while to test everything out due to having potted components so I needed to make some more and be sure they also had the original problem, etc.

What ended up working to varying levels of success was a few different things:

1) Complete success - Moving the antenna further away from the Teensie. I was able to eliminate the interference if I increased the distance from the antenna to the Teensie from approximately 2 feet up to somewhere around 4 feet...this however isn't really a viable solution.

2) Partial Success - Wrapping the teensie in a grounded aluminum foil ball. With this solution the radio would cause a small increase in measured flowrate (from ~1 GPH to ~1.5 GPH) with the teensie at the 2 foot mark. This is much improved over the previously mentioned >3 times increase in measured flowrate.

3) Partial Success - Adding 100 pf capacitor & Ferrite Bead as close as possible to Teensie pin. Radio impact on measured flowrate was very similar to scenario 2, however marginally better.

4) Complete Success - Using Solution 3 and changing my pull-up resistor from a 30K to the suggested smaller values (both the 1k and 100 ohm seemed to perform the same). With this configuration I could have the Teensie as close as 6 inches inches to the antenna (which is actually as close as I could physically move them together) with no impact on the measured flow rate due to the radio transmission...which is way closer than they need to live relative to each other.

Thanks all for the input, really appreciate the help in solving this problem.

!Bead.JPG !Pull_up.JPG
 
Status
Not open for further replies.
Back
Top